IVisualRasterizer

Description

interface Tinman.Engine.Drawing.IVisualRasterizer

Derived from

IBeginEnd

Extended by

VisualRasterizer abstract

Base interface for classes that are capable of rasterizing a 2D visual.

Public / Methods

Check​Support


[BeginEnd]
public method CheckSupport → (1)

visual in : IVisual

The visual to check.

returns → bool

true if visual in may be passed to the other methods,
false if visual in is null or not supported by this rasterizer.

Checks if this rasterizer supports the given visual in.

Measure​Bounds


[BeginEnd]
public method MeasureBounds → (1)

visual in : IVisual

[not-null]
The visual to measure.

returns → Box2F

The measured visual bounds of visual in, which are guaranteed to contain all parts of the visual. Will be Box2F.Inverse iff CheckSupport would return false for visual in.

Measures the effective bounds of the given visual in, when being rasterized with this rasterizer.

Rasterize


[BeginEnd]
public method Rasterize → (4)

visual in : IVisual

[not-null]
The visual to rasterize. This method will return silently if a IVisual object is passed to it for which CheckSupport would return false.

visualBounds in : Box2F

The visual bounds to rasterize.

output in : ColorBuffer

[not-null]
The output pixel buffer.

outputBounds in : Box2I

The output bounds in output in, which correlate with visualBounds in: the top-left corner of the pixel at Box2I.TopLeft corresponds to Box2D.TopLeft of visualBounds in in visual coordinates, the bottom-right corner of the pixel at Box2I.BottomRight corresponds to Box2D.BottomRight of visualBounds in. This method will return silently if outputBounds in is not fully contained in output in.

Rasterizes the given visual in into the given output in buffer.

The transformation from visualBounds in to outputBounds in (see Visual.ComputeTransform) depicts the effective resolution and aspect ratio of the rasterized visual.