W3C home > Mailing lists > Public > www-svg@w3.org > February 2010

Proposed wording for 'how object transforms affect gradient rendering output'

From: Anthony Grasso <anthony.grasso@cisra.canon.com.au>
Date: Thu, 04 Feb 2010 15:58:11 +1100
Message-ID: <4B6A53E3.5020804@cisra.canon.com.au>
To: www-svg@w3.org
Hi SVG WG,

In relation to the discussion on "gradient userSpaceOnUse" [1] and the 
investigation I did on "how authoring tools apply object transforms to 
gradients" [2], I have devised some wording to put in (possibly) current and 
future SVG specifications.

I propose adding the following wording and diagrams for the different parts in 
the gradient section:

Wording to be placed after the first paragraph of the introduction for gradients 
[3] (in SVG Tiny 1.2)

[[
The angle of the color transitions along the gradient vector is defined by the 
gradient normal (see diagram below). Initially, the gradient normal is 
perpendicular with the gradient vector and is the same magnitude as the gradient 
vector. If an object references a gradient, conceptually the object should take 
a copy of the gradient vector and gradient normal and treat it as part of its 
own geometry. Any transformations applied to the object geometry also apply to 
the copied gradient vector and gradient normal. Any gradient transforms that are 
specified on the reference gradient are applied after object transformations 
have been applied but prior to rendering.
]]


The wording in the last sentence of the second last paragraph for gradientUnits 
attribute [4] should be reworded to:

[[
When the object's bounding box is not square, the gradient normal which is 
initially perpendicular to the gradient vector within object bounding box space 
shall render non-perpendicular relative to the gradient vector in user space. 
This transformation is due to application of the non-uniform scaling 
transformation from bounding box space to user space.
]]



Note that this wording is a first draft and open to discussion. To my understand 
of the issue, there are some implementations that have an alternative method of 
applying transforms and thus producing a different result. I can sympathise that 
this wording is potentially contentious, but given that gradients are an 
integral part of any graphics language, a consensus must be reached on this 
issue so all implementations will produce the same result.

Cheers,

Anthony


[1] http://lists.w3.org/Archives/Public/www-svg/2010Jan/0000.html
[2] http://lists.w3.org/Archives/Public/public-svg-wg/2010JanMar/0035.html
[3] http://www.w3.org/TR/SVGTiny12/painting.html#Gradients
[4] http://www.w3.org/TR/SVGTiny12/painting.html#LinearGradientUnitsAttribute


gradient_vector_and_normal_diagram.svg
(image/svg+xml attachment: gradient_vector_and_normal_diagram.svg)

gradient_vector_and_normal_diagram.png
(image/png attachment: gradient_vector_and_normal_diagram.png)

Received on Thursday, 4 February 2010 04:58:51 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT