TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct PixelRange in Tinman.Terrain.Imaging

The PixelRange structure is used to map raw pixel values to normalized pixel values.

struct PixelRange implements IEquatable<PixelRange>

Remarks

A pixel range is defined by two tiepoints, each containing a raw pixel value and a normalized pixel value. By carefully choosing the tiepoints, one can easily perform arbitrary linear transformations on pixel values.

See also:

VerticalRange

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<PixelRange>
value [not-null] The configurator object.

Public / Constants

DefaultFloat32

Default normalization range for 32-bit floating point sample values.

public static readonly field DefaultFloat32
type PixelRange

Remarks:

The range is [-10000..10000].

DefaultInt16

Default normalization range for 16-bit signed integer sample values.

public static readonly field DefaultInt16
type PixelRange

Remarks:

The range is [-32768..32767].

DefaultInt8

Default normalization range for 8-bit signed integer sample values.

public static readonly field DefaultInt8
type PixelRange

Remarks:

The range is [-128..127].

DefaultUInt16

Default normalization range for 16-bit unsigned integer sample values.

public static readonly field DefaultUInt16
type PixelRange

Remarks:

The range is [0..65535].

DefaultUInt8

Default normalization range for 8-bit unsigned integer sample values.

public static readonly field DefaultUInt8
type PixelRange

Remarks:

The range is [0..255].

Identity

public static readonly field Identity
type PixelRange

Invalid

An invalid pixel range.

public static readonly field Invalid
type PixelRange

See also:

IsInvalid

Public / Attributes

IsInvalid

Is this pixel range invalid?

public property IsInvalid { get }
type bool
value true if this pixel range is invalid, false if it is valid.

PixelA

The normalized pixel value that is mapped to RawA.

public readonly field PixelA
type float64

Remarks:

The valid range for normalized pixel values is [0..16777215]. However, the pixel range values used for mapping can be outside of this interval.

PixelB

The normalized pixel value that is mapped to RawB.

public readonly field PixelB
type float64

Remarks:

The valid range for normalized pixel values is [0..16777215]. However, the pixel range values used for mapping can be outside of this interval.

RawA

The raw pixel value that is mapped to PixelA.

public readonly field RawA
type float64

RawB

The raw pixel value that is mapped to PixelB.

public readonly field RawB
type float64

Transform

Returns a linear transform that maps RawA to PixelA and RawB to PixelB.

public property Transform { get }
type Vec2D
value The linear transform.

Remarks:

The linear transform is defined as follows:

f(x) = x * m + b
x    = (f(x) - b) / m
where f(x) is the normalized pixel value (see PixelA and PixelB) and x is the raw pixel value (see RawA and RawB). The coefficients m and b are returned as X and Y, respectively.

TransformInv

Returns a linear transform that maps PixelA to RawA and PixelB to RawB.

public property TransformInv { get }
type Vec2D
value The linear transform.

Remarks:

The linear transform is defined as follows:

f(x) = x * m + b
x    = (f(x) - b) / m
where x is the normalized pixel value (see PixelA and PixelB) and f(x) is the raw pixel value (see RawA and RawB). The coefficients m and b are returned as X and Y, respectively.

Public / Constructors

Default

Returns the default pixel range for the given pixel format.

public static method Default (PixelFormat format)
type PixelRange
params format The pixel format.
returns The default pixel range.

PixelRange

Creates a new instance of PixelRange.

public constructor PixelRange (float64 rawA, float64 rawB, float64 pixelA = 0, float64 pixelB = 16777215)
params rawA Raw pixel value to map to pixelA.
  rawB Raw pixel value to map to pixelB.
  pixelA Normalized pixel value to map to rawA. Defaults to 0.
  pixelB Normalized pixel value to map to rawB. Defaults to 16777215.

Public / Methods

Equals

public method Equals (PixelRange other)
type bool
params other

Pixel

Computes the normalized pixel value for the given raw pixel value.

[Pure]
public method Pixel (float64 value)
type float64
params value The raw pixel value.
returns The normalized pixel value in the range [0..16777215].

Raw

Computes the raw pixel value for the given normalized pixel value.

[Pure]
public method Raw (float64 value)
type float64
params value The normalized pixel value in the range [0..16777215].
returns The raw pixel value.