Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class ArtRenderer

  1. Object
  2. ArtRenderer

Paints an ArtDocument into pixels.

Everything is rasterized in software, so blend modes, masks and effects look the same on every port and render in tests without a display. Text is the one exception: it is drawn with the platform’s fonts, so it needs an initialized display and is skipped without one.

Constructors

public ArtRenderer()

Methods

public static Raster render(ArtDocument doc, double scale)Renders a whole document.
public static Image toImage(ArtDocument doc, double scale)Renders a whole document to an Image.
public Raster render(ArtDocument doc, Matrix view, int[] clip)Renders through a view transform into a device rectangle.
public void renderNode(ArtNode node, Matrix parent, Raster target)Renders one node (and its children) onto target.

Inherited methods

Constructor details

ArtRenderer

public ArtRenderer()

Method details

render

public static Raster render(ArtDocument doc, double scale)
Renders a whole document.

Parameters

doc ArtDocument
the document
scale double
device pixels per document unit

Returns

a raster of the canvas, ceil(width * scale) by ceil(height * scale)

toImage

public static Image toImage(ArtDocument doc, double scale)
Renders a whole document to an Image.

Parameters

doc ArtDocument
the document
scale double
device pixels per document unit

render

public Raster render(ArtDocument doc, Matrix view, int[] clip)
Renders through a view transform into a device rectangle.

Parameters

doc ArtDocument
the document
view Matrix
maps document coordinates to device pixels
clip int[]
the device rectangle to produce, as x, y, w, h

renderNode

public void renderNode(ArtNode node, Matrix parent, Raster target)
Renders one node (and its children) onto target.

Parameters

node ArtNode
the node
parent Matrix
the transform from the node’s parent space to device pixels
target Raster
what is painted so far; the node is composited onto it