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

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.


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.

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
     "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="6cm" height="2.5cm" viewBox="0 0 600 250"
     xmlns="http://www.w3.org/2000/svg" version="1.1"
     xmlns:xlink="http://www.w3.org/1999/xlink">
  <title>Example feImage - Examples of feImage use</title>
  <desc>Two examples of using feImage, the first showing the
        default rendering, the second showing the image fit
        to a box.</desc>
  <defs>
    <filter id="Default">
      <feImage xlink:href="../images/smiley.png" />
    </filter>
    <filter id="Fitted" primitiveUnits="objectBoundingBox">
      <feImage xlink:href="../images/smiley.png"
        x="0" y="0" width="100%" height="100%"
        preserveAspectRatio="none"/>
    </filter>
    <filter id="Shifted">
      <feImage xlink:href="../images/smiley.png"
        x="500" y="5"/>
    </filter>
  </defs>
  <rect fill="none" stroke="blue"  
        x="1" y="1" width="598" height="248"/>
  <g>
    <rect x="50"  y="25" width="100" height="200" style="filter:url(#Default)"/>
    <rect x="50"  y="25" width="100" height="200" fill="none" stroke="red"/>
    <rect x="250" y="25" width="100" height="200" style="filter:url(#Fitted)"/>
    <rect x="250" y="25" width="100" height="200" fill="none" stroke="red"/>
    <rect x="450" y="25" width="100" height="200" style="filter:url(#Shifted)"/>
    <rect x="450" y="25" width="100" height="200" fill="none" stroke="red"/>
  </g>
</svg>

Received on Tuesday, 20 July 2010 13:40:08 UTC