MapField
Description
The MapField struct describes a rectangular region of a map.
The top-left corner of a map field is specified in cubemap face coordinates, i.e. face X- and Y-coordinates and cubemap face number (see Cubemap). A map field has a step value which depicts the distance between adjacent samples. The map field step is always interpreted relative to the map origin at (0,0).
When a MapField value is created with a field step greater than 1
, the given input map coordinates are adjusted to match the nearest map samples that match specified field step (e.g. the tightest fitting bounding rectangle is computed).
The following figure illustrates some example map fields for a map of size 10 x 5
:
'.' := Map sample 'o' := Map sample matching field step 'x' := Map sample contained in field +----------+ +----------+ +----------+ |xxxxoooooo| |o.o.o.o.o.| |o...x...x.| |xxxxoooooo| |..........| |..........| |xxxxoooooo| |o.x.x.x.o.| |..........| |oooooooooo| |..........| |..........| |oooooooooo| |o.x.x.x.o.| |o...o...o.| +----------+ +----------+ +----------+ FaceX := 0 FaceX := 2 FaceX := 4 FaceY := 0 FaceY := 2 FaceY := 0 Width := 4 Width := 3 Width := 2 Height := 3 Height := 2 Height := 1 Step := 1 Step := 2 Step := 4
Public / Constructors
SolidRect
2 overloads
Creates a solid MapField for the given map region.
Creates a solid MapField for the given map region.
SparsePoints
Creates a sparse MapField for the given map region.
A sparse map field contains every n
-th map sample, relative to the top-left map sample at (0,0)
. The value of n
must be a power of two.
SparseRect
Creates a sparse MapField for the given map region.
A sparse map field contains every n
-th map sample, relative to the top-left map sample at (0,0)
. The value of n
must be a power of two.