IVisual

Description

interface Tinman.Engine.Drawing.IVisual

Derived from

IVersioned

Extended by

Visual abstract

Base interface for classes that describe an arbitrary 2D visual that may be rasterized and then rendered as a whole, using textured quadrilaterals.

The specification of a visual uses coordinates and length in visual units, which refer to an unspecified unit of measure that the application has chosen to use consistently. For example, an application may choose to use inch as visual unit and then express resolution values as dots-per-inch (DPI). As far as the rasterization framework is concerned, no knowledge of the visual unit is required, except the guarantee that the application will use it consistently.

When a visual is rasterized, the application specifies a resolution which is then used to generate the textured quadrilaterals. Vertex and texture coordinates are generated so that the coordinate origin (0,0) in visual units corresponds to the screen coordinates (0,0), when the textured quadrilaterals are rendered without transformation.

The data version of a 2D visual is incremented if a change has occurred which affects the pixel content that results from rasterization and is used at runtime to discard cached data.

Public / Attributes

Bounds


public attribute Bounds → (get)

value : Box2F

The bounds, in visual units. Will be Box2F.Inverse iff the bounds depend on the used rasterizer.

Returns the bounds of the visual.

The bounds of a visual may always be obtained via IVisualRasterizer.MeasureBounds. This property returns the visual bounds iff they are independent of the used used rasterizer. This should be decided at compile-time, so that a rasterizer can easily use the visitor pattern to decide whether to delegate to this property or to compute the bounds by itself.