W3C

SVG pinnedClip 1.0, Part 2: Language

W3C Working Draft

This version:
Latest version:
Editors:
Alex Danilo, Abbra <alex@abbra.com>
Authors:
See Author List

Abstract

This Working Draft defines features of the Scalable Vector Graphics (SVG) Language that are specifically for device pixel aligned clipping environments.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C.

This document is an editors draft. It defines features of SVG specific to supporting device axis pixel aligned clipping of SVG content. It is a draft in progress; some descriptions in this document may be incomplete. This document shows the current thoughts of the SVG Working Group on the use of SVG for pixel aligned clipping and should not yet be considered stable. There is an accompanying SVG pinnedClip 1.0, Part 1: Primer that lists the ways SVG pinnedClip may be used for clipping of SVG content to a device pixel aligned rectangle.

This document has been produced by the W3C SVG Working Group as part of the W3C Graphics Activity within the Interaction Domain. The Working Group expects to advance this Working Draft to Recommendation Status.

We explicitly invite comments on this specification. Please send them to public-svg-pinnedClip@w3.org (archives). For comments on the core SVG language, use www-svg@w3.org: the public email list for issues related to vector graphics on the Web (archives). Acceptance of the archiving policy is requested automatically upon first post to either list. To subscribe to these lists send an email to public-svg-pinnedClip-request@w3.org or www-svg-request@w3.org with the word subscribe in the subject line.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


How to read this document and give feedback

This draft of SVG pinnedClip is a snapshot of a work-in-progress.

The main purpose of this document is to encourage public feedback. The best way to give feedback is by sending an email to public-svg-pinnedClip@w3.org. Please include some kind of keyword that identifies the area of the specification the comment is referring to in the subject line of your message (e.g pinnedClip or rectClip or device clip). If you have comments on multiple areas of this document, then it is probably best to split those comments into multiple messages.

The public are welcome to comment on any aspect in this document, but there are a few areas in which the SVG Working Group are explicitly requesting feedback. These areas are noted in place within this document.

Introduction

This document lists features that may be used in the context of device pixel aligned clipping. The various usage scenarios are listed in the SVG pinnedClip Requirements document.

This document is normative.

This document contains explicit conformance criteria that overlap with some RNG definitions in requirements. If there is any conflict between the two, the explicit conformance criteria are the definitive reference.

Device pixel aligned clipping

This section is informative.

The functionality introduced by the pinnedClip element is primarily aimed at supporting device pixel aligned clipping for devices which support media codecs for display. Such devices as an example may contain hardware video codecs whose display support is restricted to a device aligned pixel rectangle.
In order to integrate use of such imaging codecs with the SVG language, the pinnedClip element may be used to specify the device display area used for codec output.

The pinnedClip element

The pinnedClip element specifies a device axis aligned clipping rectangle whose child content is clipped to the resultant specified rectangle.

Any transform attributes placed on the pinnedClip element act as all other SVG primitives in modfiying the device specific position and width/height. However, the 'x', 'y', 'width' and 'height' transformed into device co-ordinates is integral device pixel aligned and no sub-pixel aliasing is performed.

As the pinnedClip element uses an 'x' and 'y' attribute as its positioning basis, the resultant rectangle will always be device axis-aligned. Skew and rotation of the local co-ordinate system is ignored.

Schema: pinnedClip
  <define name='pinnedClip'>
    <element name='pinnedClip'>

      <ref name='pinnedClip.AT'/>
    </element>
  </define>

  <define name='pinnedClip.AT' combine='interleave'>

    <ref name='svg.XYWH.attr'/>
  </define>
    

Attribute definitions:

x = "<coordinate>"
The x-axis coordinate of the center of the clipping area.

If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: yes.
y = "<coordinate>"
The y-axis coordinate of the center of the clipping area.

If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: yes.
devicewidth = "<length>"
The width of the clipping area.

A negative value is unsupported. A value of zero disables rendering of the element. If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: yes.
deviceheight = "<length>"
The height of the clipping area.

A negative value is unsupported. A value of zero disables rendering of the element. If the attribute is not specified, the effect is as if a value of "0" were specified.

Animatable: yes.

The central point specified by 'x' and 'y' are transformed from user space into device space pixel co-ordinates. Subsequent to transformation, if any fractional pixel value exists for the device pixel co-ordinate value, that fractional value is truncated. The truncated whole-pixel values are subsequently used as the central pixel co-ordinate for defining the clipping region.

The 'devicewidth' and 'deviceheight' attributes specify device pixel width and height for the clipped area. The device width and height are truncated to an integral number of pixels as an initial step in constructing the clipping rectangle.

If a specified 'devicewidth' or 'deviceheight' results in an odd integer value, the value is halved by integer division resulting in truncation to generate a first value and that value is subtracted from the total to give a resultant remainder as a second value.

In the case of 'devicewidth', the first truncated value is subtracted from the 'x' device pixel value to give the left edge of the clipping area 'x' co-ordinate. The second remainder value is added to the 'x' value to give the right-hand 'x' co-ordinate value of the edge of the clipping area.

In the case of 'deviceheight', the first truncated value is subtracted from the 'y' device pixel value to give the top edge of the clipping area 'y' co-ordinate. The second remainder value is added to the 'y' value to give the bottom 'y' co-ordinate value of the edge of the clipping area.

References

SVG12
Scalable Vector Graphics (SVG) 1.2 Specification, Dean Jackson editor, W3C, 27 October 2004 (Working Draft). See http://www.w3.org/TR/2004/WD-SVG12-20041027/
SVG12Reqs
SVG 1.1/1.2/2.0 Requirements, Dean Jackson editor, W3C, 22 April 2002 (Working Draft). See http://www.w3.org/TR/2002/WD-SVG2Reqs-20020422/

Author List

The authors of this specification are the participants of the W3C SVG Working Group.