_ __ ___Extensions___ __ _ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1. IntroductionOpenVG provides a drawing model similar to those of existing 2D drawing APIs and formats (Adobe PostScript and PDF, Sun Microsystems Java2D, MacroMedia Flash, SVG). It is specifically intended to support all drawing features required by a SVG Tiny 1.2 renderer, and additionally to support functions that may be of use for implementing an SVG Basic renderer. In addition to the base feature set, we introduce a new set of interesting extensions; developers and designers can take advantage of these new features to develop their OpenVG applications. 2. Conical gradientsConical gradients interpolate the color keys counter-clockwise around a point. A conical gradient is defined through the center point, the direction point and the number of repeats. Those points identify the line where the first color key lies on. The number of repeats tells how many times the circle will be split; all the keys take place every slice, following the classic spread mode rules.
VGfloat congrad[5];
conGrad[0] = center.x; conGrad[1] = center.y; conGrad[2] = target.x; conGrad[3] = target.y; conGrad[4] = repeats; vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_CONICAL_GRADIENT); vgSetParameterfv(paint, VG_PAINT_CONICAL_GRADIENT, 5, conGrad); 3. Advancend blend modesThis extension completes the OpenVG 1.0 blend modes to support a full extended Porter-Duff rendering model (the same rendering model used by SVG 1.2). Some of these new modes are available only if GLSL shaders are supported: Overlay, Color Dodge, Color Burn, Hard Light, Soft Light, Difference. When shaders aren't available a Src Over fallback will be used.
vgSeti(VG_BLEND_MODE, VG_BLEND_COLOR_DODGE);
4. Separable blend modesOpenVG 1.0 specifications provide a way to set a single blend mode, that will be used for both stroke and fill drawing. With this extension it is possible to independently specify a blend mode for the stroke and a blend mode for the fill.
vgSeti(VG_FILL_BLEND_MODE, VG_BLEND_SRC_OVER);
vgSeti(VG_STROKE_BLEND_MODE, VG_BLEND_ADDITIVE); 5. Color ramp interpolationAccording to OpenVG 1.0 specifications, color and alpha values at offset values between the values given by stops are defined by means of linear interpolation between the values defined at the nearest stops above and below the given offset value. Linear interpolation suffers of the so called 'key highlights' issue; it is very noticeable when large surfaces are filled with a poor of keys gradient. This behaviour could be changed by defining a new color ramp interpolation schema. This extension introduces a smooth color interpolation, based on the Hermite interpolant coupled with Catmull-Rom tangents calculation. The result is a much smoother transition.
vgSetParameteri(paint0,
VG_PAINT_COLOR_RAMP_INTERPOLATION_TYPE, VG_COLOR_RAMP_INTERPOLATION_SMOOTH); vgSetParameteri(paint0, VG_PAINT_COLOR_RAMP_INTERPOLATION_TYPE, VG_COLOR_RAMP_INTERPOLATION_LINEAR); 6. Separable cap styleOpenVG 1.0 specifications provide a way to set a single cap style, that will be used for both start-cap and end-cap in a dashed stroke. With this extension it is possible to independently specify a different style for start-cap and end-cap.
vgSeti(VG_STROKE_START_CAP_STYLE, VG_CAP_ROUND);
vgSeti(VG_STROKE_END_CAP_STYLE, VG_CAP_SQUARE); 7. Paint opacityThis extension introduces a new alpha factor (it lies in [0;1] range) that influences paint generation. It has the same behaviour as the alpha mask but it's not pixel based, it's global for the entire paint. The classic use is to do fading effects without the need to change color keys opacity (for gradients) nor pixels (for patterns and images).
vgSetParameterf(paint, VG_PAINT_OPACITY, 0.50f);
AmanithVG is a trademark of Mazatech S.r.l. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Copyright (c) 2005-2009 Mazatech s.r.l. - P.iva (VAT IT) 03498460405 - All rights reserved |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||