[cairo] Cairo and OpenVG Radial Gradient
Emmanuel Pacaud
emmanuel.pacaud at lapp.in2p3.fr
Sat Sep 29 01:05:11 PDT 2007
Hi,
Le samedi 29 septembre 2007 à 06:57 +0000, KULBHUSHAN PACHAURI a écrit :
> As per your reply for my query cairo to openvg radial gradient
> conversion i looked at the how cairo radial gradient is mapped to svg.
>
> But i have some doubt about that mapping..
>
> for the case if two circle radius are equal and extend is not equal
> to cairo_extend_none and no of stops is greater than 2. in that case
> that mapping works or ot.
> (line no: 1466 & file name cairo-svg-surface.c)
It looks like there's a bug here. stops[1] should probably be
stops[pattern->base.n_stops - 1] lines 1498 - 1500. Apart from that,
it's supposed to work.
> Also the offset for both the stops are 0. (??) (lineno: 1494 & file
> name cairo-svg_surface.c)
That's fine. SVG says:
"If two gradient stops have the same offset value, then the latter
gradient stop controls the color value at the overlap point. In
particular:
<stop offset="0" stop-color="white"/>
<stop offset=".2" stop-color="red"/>
<stop offset=".2" stop-color="blue"/>
<stop offset="1" stop-color="black"/>
will have approximately the same effect as:
<stop offset="0" stop-color="white"/>
<stop offset=".1999999999" stop-color="red"/>
<stop offset=".2" stop-color="blue"/>
<stop offset="1" stop-color="black"/>
which is a gradient that goes smoothly from white to red, then abruptly
shifts from red to blue, and then goes smoothly from blue to black."
Emmanuel.
More information about the cairo
mailing list