Re: ISSUE-2353 (feImage coordinates): Clarify coordinates for feImage. [SVG 1.1 F2 Last Call]

On Tue, 20 Jul 2010 15:39:32 +0200, Tavmjong Bah <tavmjong@free.fr> wrote:

>
> Here is a proposed change to clarify the positioning of an image. The
> main change is to add an example to the feImage section.
>
>      Tav
>
>
> ISSUE-2353 (feImage coordinates) Clarify coordinates for feImage.
>
>
> 15.7.3 Filter primitive subregion
>
> Change:
>
> If there are no referenced nodes (e.g., for ‘feImage’ or
> ‘feTurbulence’), or one or more of the referenced nodes is a standard
> input (one of SourceGraphic, SourceAlpha, BackgroundImage,
> BackgroundAlpha, FillPaint or StrokePaint), or for ‘feTile’ (which is
> special because its principal function is to replicate the referenced
> node in X and Y and thereby produce a usually larger result), the
> default subregion is 0%,0%,100%,100%, where percentages are relative
> to the dimensions of the filter region.
>
> to:
>
> If there are no referenced nodes (e.g., for ‘feImage’ or
> ‘feTurbulence’), or one or more of the referenced nodes is a standard
> input (one of SourceGraphic, SourceAlpha, BackgroundImage,
> BackgroundAlpha, FillPaint or StrokePaint), or for ‘feTile’ (which is
> special because its principal function is to replicate the referenced
> node in X and Y and thereby produce a usually larger result), the
> default subregion is equal to the filter region.

Yes, that looks better I think, but...

It does raise the question about how the SVGLength values look like if you  
fetch them via the SVG DOM[1] (and the width/height were not specified in  
the markup). I guess it's one of these cases where you need more context  
to be able to resolve values properly, similar to trying to fetch values  
 from a gradient definition where the values depend on the boundingbox of  
the element referencing the gradient. Anyway, what unit does the  
SVGLengths have?

> 15.18 Filter primitive 'feImage'
>
> Add example:
>
> The following example illustrates how images are placed relative
> to an object. From left to right:
>
>    * The default placement of an image. Note that the image is
>      centered in the filter region and has the maximum size that will
>      fit in the region consistent with preserving the aspect ratio.
>
>    * The image fitted to the bounding box of an object.
>
>    * The image placed using user coordinates. Note that the image is
>      first centered in a box the size of the filter region and has the
>      maximum size that will fit in the box consistent with preserving
>      the aspect ratio. This box is then shifted by the given 'x' and
>      'y' values relative to the viewport the object is in.
...

If you wanted the images on the left and right sides to be within the red  
borders you need to specify the filter region such that it equals the  
boundingbox of the referencing element (<filter x="0" y="0" width="1"  
height="1"> should do it).

Cheers
/Erik

[1]  
http://www.w3.org/TR/SVG11/filters.html#InterfaceSVGFilterPrimitiveStandardAttributes

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Tuesday, 20 July 2010 14:19:17 UTC