MapWrap

Description

struct Tinman.Terrain.Mapping.MapWrap

Implements coordinate wrapping behaviour for rectangular map rasters.

A rectangular map has two MapWrap values, one for each axis.

For a map of size S, valid coordinate values C lie within the range [0..S]. Valid coordinate values will remain unchanged when passed to Coordinate. All other coordinate values will be modified according to the specified behaviour (see Clamp, Void and Wrap).

Public / Constructors

Clamp


public static method Clamp → (3)

size in : int32

[>0]
The map size (edge length, not sample count).

minimum opt : bool = true

Clamp at minimum bound (0)?

maximum opt : bool = true

Clamp at maximum bound (size)?

returns → MapWrap

The map wrapping behaviour.

Clamps map coordinates to the range [0..size].

Void


public static method Void → (1)

size in : int32

[>0]
The map size (edge length, not sample count).

returns → MapWrap

The map wrapping behaviour.

Coordinates outside of the range [0..size] are considered to be void.

Wrap


public static method Wrap → (1)

size in : int32

[>0]
The map size (edge length, not sample count).

returns → MapWrap

The map wrapping behaviour.

Wraps map coordinates to the range [0..size].

Public / Methods

Coordinate

2 overloads


public method Coordinate1 → (1)

coordinate in : int32

The map coordinate.

returns → int32

The wrapped map or clamped coordinate.
[<0] If the coordinate refers to a void sample.

Wraps the given map coordinate.


public method Coordinate2 → (1)

coordinate in : float64

The map coordinate.

returns → float64

The wrapped map or clamped coordinate.
[<0] If the coordinate refers to a void sample.

Wraps the given map coordinate.

Public / Attributes

Is​Clamp​Max


public attribute IsClampMax → (get)

value : bool

true if coordinates are clamped, false if not.

Map coordinates are clamped at Size?

Is​Clamp​Min


public attribute IsClampMin → (get)

value : bool

true if coordinates are clamped, false if not.

Map coordinates are clamped at 0?

Is​Wrap


public attribute IsWrap → (get)

value : bool

true if coordinates wrap, false if not.

Map coordinates wrap around at [0..Size]?

Size


public attribute Size → (get)

value : int32

[>0]
The map size.

The map size (edge length, not sample count).