TinyLine
v2.0

com.tinyline.svg
Class SVGRaster

java.lang.Object
  extended bycom.tinyline.svg.SVGRaster

public class SVGRaster
extends java.lang.Object

The SVGRaster class rasterizes the tree of SVGNodes onto the pixel buffer.

Rendering process

Each SVGNode "paint" operation draws over some area of the pixel buffer. When the area overlaps a previously painted area the new paint partially or completely obscures the old. When the paint is not completely opaque, the result is defined by the simple alpha blending rules.

Nodes in the SVGT tree have an implicit z drawing order. Subsequent nodes are painted on top of previously painted nodes.

When a graphic object is rendered, the geometry, image, and attribute information are combined to calculate which pixel values must be changed

paint() vs. update()

What is the purpose of having separate paint() and update() methods? A call to update() implies that the area defined by the device clip rectangle is "damaged" and must be completely repainted or updated, however a call to paint() does not imply this, which enables to do incremental painting.

Version:
1.10
Author:
Andrew Girow

Field Summary
 SVGDocument document
          The current SVGT document
 SVGRect origview
          The original viewport for this SVGRaster.
 SVGNode root
          The current SVGT root
static int version
          The SVGRaster version number
 SVGRect view
          The current viewport for this SVGRaster.
 TinyRect viewport
          The current device viewport for this SVGRaster.
 
Constructor Summary
SVGRaster(TinyBuffer pixbuf)
          Constructs a new SVGRaster for the given pixel buffer.
 
Method Summary
 SVGDocument createSVGDocument()
          Creates and returns a new EMPTY SVGT Document.
 void flush()
          Flushs the SVGRaster allocated resources.
 SVGDocument getSVGDocument()
          Returns the current SVGT Document.
 Tiny2D getTiny2D()
          Returns the current Tiny2D object.
 void paint()
          Paints the area under the device clip rectangle.
 void setCamera()
          Sets the camera transform of this SVGRaster.
 void setSVGDocument(SVGDocument doc)
          Sets the new current SVGT document.
 void update()
          Updates the area under the device clip rectangle.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final int version
The SVGRaster version number

See Also:
Constant Field Values

document

public SVGDocument document
The current SVGT document


root

public SVGNode root
The current SVGT root


view

public SVGRect view
The current viewport for this SVGRaster.


origview

public SVGRect origview
The original viewport for this SVGRaster.


viewport

public TinyRect viewport
The current device viewport for this SVGRaster.

Constructor Detail

SVGRaster

public SVGRaster(TinyBuffer pixbuf)
Constructs a new SVGRaster for the given pixel buffer.

Parameters:
pixbuf - the pixel buffer.
Method Detail

setSVGDocument

public void setSVGDocument(SVGDocument doc)
Sets the new current SVGT document.


createSVGDocument

public SVGDocument createSVGDocument()
Creates and returns a new EMPTY SVGT Document.


getSVGDocument

public SVGDocument getSVGDocument()
Returns the current SVGT Document.


getTiny2D

public Tiny2D getTiny2D()
Returns the current Tiny2D object.


flush

public void flush()
Flushs the SVGRaster allocated resources.


setCamera

public void setCamera()
Sets the camera transform of this SVGRaster.


update

public void update()
Updates the area under the device clip rectangle. The area defined by the device clip rectangle was "damaged" and must be completely repainted.


paint

public void paint()
Paints the area under the device clip rectangle.


TinyLine
v2.0

Provided under the terms of the TinyLine License Agreement that has been included with this distribution