. AmanithVG extensions
_ __ ___Extensions___ __ _
1. Introduction

OpenVG 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 gradients

Conical 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.

Conical gradient, pad spread mode Conical gradient, repeat spread mode Conical gradient, reflect spread mode
Conical gradient, pad spread mode Conical gradient, repeat spread mode Conical gradient, reflect spread mode
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 modes

This 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.

Src blend mode Dst blend mode SrcOver blend mode DstOver blend mode SrcIn blend mode DstIn blend mode
Src

Dst

SrcOver

DstOver

SrcIn

DstIn

SrcOut blend mode DstOut blend mode SrcAtop blend mode DstAtop blend mode Clear blend mode Clear blend mode
SrcOut

DstOut

SrcAtop

DstAtop

Clear

Xor

Screen blend mode Multiply blend mode Difference blend mode Exclusion blend mode Additive blend mode Overlay blend mode
Screen

Multiply

Difference

Exclusion

Additive

Overlay

Darken blend mode Lighten blend mode ColorDodge blend mode ColorBurn blend mode HardLight blend mode SoftLight blend mode
Darken

Lighten

ColorDodge

ColorBurn

HardLight

SoftLight

vgSeti(VG_BLEND_MODE, VG_BLEND_COLOR_DODGE);
4. Separable blend modes

OpenVG 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.

Separable blend modes
SrcOver fill - Additive stroke
vgSeti(VG_FILL_BLEND_MODE, VG_BLEND_SRC_OVER);
vgSeti(VG_STROKE_BLEND_MODE, VG_BLEND_ADDITIVE);
5. Color ramp interpolation

According 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.

Linear and smooth color interpolation Radial gradient, linear color interpolation Radial gradient, smooth color interpolation
Linear and smooth color interpolation Radial gradient, linear color interpolation Radial gradient, smooth color interpolation
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 style

OpenVG 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.

Different start/end cap style Round start cap style, square end cap style Square start cap style, round end cap style
Different start/end cap styles Round start cap style, square end cap style Square start cap style, round end cap style
vgSeti(VG_STROKE_START_CAP_STYLE, VG_CAP_ROUND);
vgSeti(VG_STROKE_END_CAP_STYLE, VG_CAP_SQUARE);
7. Paint opacity

This 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).

Pattern, paint opacity = 25% Pattern, paint opacity = 50% Pattern, paint opacity = 75%
Pattern, paint opacity = 25 Pattern, paint opacity = 50 Pattern, paint opacity = 75
vgSetParameterf(paint, VG_PAINT_OPACITY, 0.50f);



AmanithVG is a trademark of Mazatech S.r.l.
Khronos and OpenVG are trademarks of The Khronos Group, Inc.
OpenGL is a registered trademark and OpenGL|ES is a trademark of Silicon Graphics, Inc.
SVG is a trademark of the World Wide Web Consortium.
PostScript, PDF and Flash are registered trademark of Adobe Systems, Inc.
Java is a registered trademark of Sun Microsystems, Inc.
All other trademarks, icons, and logos, shown or mentioned in this site, are property of their respective owners.