The PixelRange structure is used to map raw pixel values to normalized pixel values.
struct
|
PixelRange
|
implements
|
IEquatable<PixelRange>
|
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:
VerticalRangeThe configurator object for this type.
public
static
property
|
Config
{
get
}
|
||
type
|
IConfigurator<PixelRange>
|
||
value
|
|
The configurator object. |
Default normalization range for 32-bit floating point sample values.
public
static
readonly
field
|
DefaultFloat32
|
||
type
|
PixelRange
|
Remarks:
The
range
is
[-10000..10000]
.
Default normalization range for 16-bit signed integer sample values.
public
static
readonly
field
|
DefaultInt16
|
||
type
|
PixelRange
|
Remarks:
The
range
is
[-32768..32767]
.
Default normalization range for 8-bit signed integer sample values.
public
static
readonly
field
|
DefaultInt8
|
||
type
|
PixelRange
|
Remarks:
The
range
is
[-128..127]
.
Default normalization range for 16-bit unsigned integer sample values.
public
static
readonly
field
|
DefaultUInt16
|
||
type
|
PixelRange
|
Remarks:
The
range
is
[0..65535]
.
Default normalization range for 8-bit unsigned integer sample values.
public
static
readonly
field
|
DefaultUInt8
|
||
type
|
PixelRange
|
Remarks:
The
range
is
[0..255]
.
public
static
readonly
field
|
Identity
|
||
type
|
PixelRange
|
An invalid pixel range.
public
static
readonly
field
|
Invalid
|
||
type
|
PixelRange
|
See also:
IsInvalidIs this pixel range invalid?
public
property
|
IsInvalid
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
pixel
range
is
invalid,
false
if
it
is
valid. |
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.
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.
The raw pixel value that is mapped to PixelA.
public
readonly
field
|
RawA
|
||
type
|
float64
|
The raw pixel value that is mapped to PixelB.
public
readonly
field
|
RawB
|
||
type
|
float64
|
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) / mwhere
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.
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) / mwhere
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.
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. |
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
method
|
Equals
(PixelRange other)
|
||
type
|
bool
|
||
params
|
other
|
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]. |
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. |