Default base class for IImageReader implementations that provides some more common functionality as ImageReaderBase.
abstract class
|
ImageReader
|
extends
|
ImageReaderBase
|
Returns the configuration value that describes this object.
public
method
|
ToConfig
()
|
||
type
|
ConfigValue
|
||
returns
|
|
The configuration value. | |
inherited
|
ImageReaderBase.ToConfig
|
Remarks:
All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.
The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.
Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.
The pixel coverage of the image.
public
override
sealed
property
|
Coverage
{
get
}
|
||
type
|
PixelCoverage
|
||
value
|
The pixel coverage. | ||
implements
|
ImageReaderBase.Coverage
|
Remarks:
Usually, images have a pixel coverage of PixelIsArea.
The gamma correction that must be applied to normalized image pixels in order to obtain linear pixel values.
public
override
sealed
property
|
Gamma
{
get
}
|
||
type
|
float64
|
||
value
|
The gamma correction value (see remarks). | ||
implements
|
ImageReaderBase.Gamma
|
Remarks:
Depending
on
the
value
V
of
this
property,
the
following
gamma
correction
is
applied:
V
>
0
N
,
the
resulting
linear
pixel
value
L
is
computed
as
L
=
pow(N,
V)
.
V
=
-2.2
(see
GammaFromSrgb)V
=
-0.45455
(see
GammaToSrgb)V
,
the
normalized
and
linear
pixel
values
are
treated
as
being
equivalent.
See also:
IImageReaderReturns georeferencing information.
public
override
sealed
property
|
Georef
{
get
}
|
||
type
|
Raster
|
||
value
|
The
georeferencing
object
or
null
if
no
georeferencing
is
available. |
||
implements
|
ImageReaderBase.Georef
|
Has the image reader finished (i.e. the whole image has been read)?
public
override
sealed
property
|
HasFinished
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
the
whole
image
has
been
read,
false
if
not. |
||
implements
|
ImageReaderBase.HasFinished
|
Height of the image, in pixels.
public
override
sealed
property
|
Height
{
get
}
|
||
type
|
int32
|
||
value
|
|
Height of the image, in pixels. | |
implements
|
ImageReaderBase.Height
|
Remarks:
This is the number of image pixels along the Y-axis, which may be different from the raster height (see MapInfo), depending on the pixel coverage.
The file format of the image file.
public
override
sealed
property
|
ImageFormat
{
get
}
|
||
type
|
ImageFormat
|
||
value
|
|
The image file format. | |
implements
|
ImageReaderBase.ImageFormat
|
Remarks:
The default file format is Any, which will try to load image data using any of the available image formats.
The heightmap layer which shall receive the data of this image.
public
override
sealed
property
|
Layer
{
get
}
|
||
type
|
HeightmapLayer
|
||
value
|
The target heightmap layer. | ||
implements
|
ImageReaderBase.Layer
|
Remarks:
This is not an actual property of the image, but included here for convenience when images are imported into heightmap datasets.
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Returns a MapInfo value that describes the used map raster.
public
override
sealed
property
|
Map
{
get
}
|
||
type
|
MapInfo
|
||
value
|
The map info value. | ||
implements
|
ImageReaderBase.Map
|
The raw pixel value that represents missing data (i.e. void pixels).
public
override
sealed
property
|
NoData
{
get
}
|
||
type
|
float64
|
||
value
|
The nodata value. | ||
implements
|
ImageReaderBase.NoData
|
Remarks:
The default value is NanD (i.e. all raw pixel values are valid).
See also:
IImageReaderReturns a Path object that represents the file path this object is associated with.
public
override
sealed
property
|
PathInfo
{
get
}
|
||
type
|
Path
|
||
value
|
|
The path info. | |
implements
|
ImageReaderBase.PathInfo
|
Remarks:
Objects that do not have a meaningful file path association simply return Unknown.
The pixel format of the image.
public
override
sealed
property
|
PixelFormat
{
get
}
|
||
type
|
PixelFormat
|
||
value
|
The pixel format of the image. | ||
implements
|
ImageReaderBase.PixelFormat
|
Remarks:
Image processing is always performed with with four 24-bit integer channels (see Scanline). The pixel format provides additional information about the stored pixel data.
The mapping between raw pixels values and normalized image pixels.
public
override
sealed
property
|
Range
{
get
}
|
||
type
|
PixelRange
|
||
value
|
The pixel range. | ||
implements
|
ImageReaderBase.Range
|
See also:
IImageReaderThe Y-coordinate that will be read upon the next call to ReadScanline.
public
override
sealed
property
|
ScanlineY
{
get
}
|
||
type
|
int32
|
||
value
|
|
The scanline Y-coordinate. | |
implements
|
ImageReaderBase.ScanlineY
|
Width of the image, in pixels.
public
override
sealed
property
|
Width
{
get
}
|
||
type
|
int32
|
||
value
|
|
Width of the image, in pixels. | |
implements
|
ImageReaderBase.Width
|
Remarks:
This is the number of image pixels along the X-axis, which may be different from the raster width (see MapInfo), depending on the pixel coverage.
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Adjust the brightness and saturation of this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Adjust
(int32 brightness,
int32 saturation)
|
|||
type
|
IImageReader
|
|||
params
|
brightness
|
[-1000..1000]
|
The adjustment factor for image brightness. | |
saturation
|
[-1000..1000]
|
The
adjustment
factor
for
image
saturation.
Defaults
to
0 .
|
||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Adjust
|
See also:
Colors.AdjustThe image scanlines will be read using concurrent background tasks.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Background
()
|
|||
type
|
IImageReader
|
|||
returns
|
|
The resulting IImageReader object. | ||
inherited
|
ImageReaderBase.Background
|
Returns an opaque grayscale image which pixel values are equal to the given pixel channel of this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
ChannelToIntensity
(PixelChannel channel)
|
|||
type
|
IImageReader
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.ChannelToIntensity
|
Remarks:
Void pixels in this image will also be void in the resulting image.
See also:
IImageOps.IntensityToChannelReturns an image that represents a sub rectangle of this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Clip
(int32 x,
int32 y,
int32 width,
int32 height)
|
|||
type
|
IImageReader
|
|||
params
|
x
|
[>=0]
|
X-coordinate of top-left corner of rectangle. | |
y
|
[>=0]
|
Y-coordinate of top-left corner of rectangle. | ||
width
|
[>0]
|
Width of rectangle. | ||
height
|
[>0]
|
Height of rectangle. | ||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Clip
|
Assumes the image holds a non-rectangular shape that is padded with a uniform color and replaces all padding pixels with void.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Crop
(int64 color = Colors.Black,
int32 skip = 1)
|
|||
type
|
IImageReader
|
|||
params
|
color
|
The padding pixel color (see Colors). Defaults to Black. | ||
skip
|
The
maximum
length
(in
pixels)
of
a
run
surrounded
by
void
pixels
that
will
be
interpreted
as
void,
too.
Defaults
to
1 .
|
|||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Crop
|
Remarks:
Since
the
source
image
is
read
scanline
after
scanline,
cropping
is
performed
locally
for
each
scanline:
Beginning
at
the
left
and
right
image
borders,
all
pixels
having
the
same
color
as
the
color
parameter
are
replaced
with
void
until
a
consecutive
run
of
pixels
having
different
colors
is
found
(see
skip).
The
following
figures
illustrates
this:
Pixels
that
have
the
same
color
as
the
color
parameter
are
shown
as
'.'
characters,
all
others
are
indicated
with
X
:
+-----------------------------------------------------------------------+ |.......................................................................| |.......................................................................| |............................XXX........................................| |...........................XXXXX.......................................| |.........................XXXXXXX.......................................| |.......................XXXXXXXXX.......................................| |.....................XXXXXXXXXXX.......................................| |...................XXXXXXXXXXXXXX......................................| |.................XXXXXXXXXXXXXXXX......................................| |................XXXXXXXXXXXXXXXXX......................................| |...............XXXXXXXXXXXXXXXXXXX.....................................| |................XXXXXXXXXXXXXXXXXXX....................................| |.................XXXXXXXXXXXXXXXXXXXXX.................................| |...................XXXXXXXXXXXXXXXXXXXXXXX.....X.......................| |...............XXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXX.................| |..........XXXXXXXXXXXX.......XXXXXXXXXXXXXXXXXXXXXXXXXXX...............| |.............XXXXXXX..........XXXXXXXXXXXXXXXXXXXXXXXXXX...............| |...............XXX.............XXXXXXXXXXXXXXXXXXXXXXXX................| |................................XXXXXXXXXXXXXXXXXXXXX..................| |................................XXXXXXXXXXXXXXXXX......................| |...................................XXXXXXX.............................| |.......................................................................| |.......................................................................| |.......................................................................| |.......................................................................| +-----------------------------------------------------------------------+The cropped image will look like this (whitespace represents void pixels):
+-----------------------------------------------------------------------+ | | | | | XXX | | XXXXX | | XXXXXXX | | XXXXXXXXX | | XXXXXXXXXXX | | XXXXXXXXXXXXXX | | XXXXXXXXXXXXXXXX | | XXXXXXXXXXXXXXXXX cropped because | | XXXXXXXXXXXXXXXXXXX of skipped pixels | | XXXXXXXXXXXXXXXXXXX | | | XXXXXXXXXXXXXXXXXXXXX V | | XXXXXXXXXXXXXXXXXXXXXXX | | XXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXX | | XXXXXXXXXXXX.......XXXXXXXXXXXXXXXXXXXXXXXXXXX | | XXXXXXX..........XXXXXXXXXXXXXXXXXXXXXXXXXX | | XXX.............XXXXXXXXXXXXXXXXXXXXXXXX | | ^ XXXXXXXXXXXXXXXXXXXXX | | | XXXXXXXXXXXXXXXXX | | not reachable XXXXXXX | | from left or | | right border | | | | | +-----------------------------------------------------------------------+Cropping will not change the image size or modify the georeference.
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Transform linear pixel values using a custom function.
[OwnerReturn, OwnerThis]
|
||||
public
method
|
Function
(string function,
PixelChannel channel = PixelChannel.Intensity)
|
|||
type
|
IImageReader
|
|||
params
|
function
|
[not-null]
|
A function expression (see GrammarRuleExpression) that consumes input linear pixel values in the range [0..1] and returns output linear pixel value in the range [0..1]. Output values are clamped (including infinities), not-a-number output values produce void pixels (see Void). | |
channel
|
The pixel channel the function shall be applied to. If Void, no transformation will be performed. Defaults to Intensity. | |||
returns
|
|
The
resulting
image
or
this
if
channel
is
Void.
|
||
inherited
|
ImageReaderBase.Function
|
Remarks:
The given function is evaluated on linear pixel values, that is after raw pixels have been translated to normalized pixel values (see SetRange) and after gamma correction has been applied (see SetGamma). The expression may use all members of the default Tinman script (see Tinman). The following arguments are available to the function expression:
raw
lin
A,
B,
C,
D,
E,
F
lin = pow(raw * A + B, C) raw = pow(lin, D) * E + F D = 1 / C E = 1 / A F = -B / Awhere
raw
is
the
raw
pixel
value
that
is
actually
stored
in
the
source
image
(e.g.
[0..255]
for
8-bit
images)
and
lin
is
the
linear
pixel
value
that
is
stored
in
the
image
scanline
buffer
(see
Scanline).
A
and
B
represent
the
transformation
from
raw
pixel
values
to
normalized
pixel
values
(see
SetRange);
C
is
the
exponent
that
best
approximates
the
performed
gamma
correction
(see
SetGamma).
Returns an image that has a single pixel channel (see channel parameter), initialized to the grayscale intensities of this image. All other pixel channels are initialized to their respective default values (see PixelChannel).
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
IntensityToChannel
(PixelChannel channel)
|
|||
type
|
IImageReader
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.IntensityToChannel
|
Remarks:
Void pixels in this image will also be void in the resulting image.
See also:
IImageOps.ChannelToIntensityReplaces a pixel channel of the given image with the grayscale intensities of this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
IntensityToChannel
(PixelChannel channel,
[Owner]
IImageReader image)
|
|||
type
|
IImageReader
|
|||
params
|
channel
|
The pixel channel to replace. | ||
image
|
[not-null]
|
The image which pixel channel is to be replaced. | ||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.IntensityToChannel
|
Remarks:
Void pixels in the other image are ignored (i.e. the original pixel remains unchanged). Void pixels in this image are preserved (i.e. the other pixel is ignored).
See also:
PixelChannelInverts the given pixel channel.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Invert
(PixelChannel channel)
|
|||
type
|
IImageReader
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Invert
|
Remarks:
The Void pixel channel cannot be inverted. The method will do nothing in this case.
Combines
this
image
(first
)
with
the
given
one
(second
)
using
the
specified
color
operation
(see
ColorOp).
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Op
([Owner]
IImageReader other,
ColorOp colorOp)
|
|||
type
|
IImageReader
|
|||
params
|
other
|
[not-null]
|
The other image. | |
colorOp
|
The color operation to apply. | |||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Op
|
Pads this image by duplicating pixels at the borders.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Pad
(int32 amount = 1)
|
|||
type
|
IImageReader
|
|||
params
|
amount
|
[>=0]
|
The
pad
amount,
in
pixels.
Defaults
to
1 . |
|
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Pad
|
Remarks:
Padding can be used to reduce seams that will occur when tiled geodata is imported incrementally using on-the-fly projection. The correct solution would be to merge all geodata tiles into a dataset and then perform the projection on the whole geodata.
Reads the entire image into a color buffer.
[OwnerThis]
|
||||
public
override
method
|
ReadAll
()
|
|||
type
|
ColorBuffer
|
|||
returns
|
|
The color buffer. | ||
implements
|
ImageReaderBase.ReadAll
|
Remarks:
This method must only be called when the current scanline is zero (see ScanlineY).
Reads the next scanline.
public
override
sealed
method
|
ReadScanline
(Scanline scanline)
|
||
type
|
int32
|
||
params
|
scanline
|
[not-null]
|
The output buffer for the read scanline pixels. |
returns
|
Y-coordinate of processed scanline. | ||
implements
|
ImageReaderBase.ReadScanline
|
Returns an image that represents a scaled version of this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Scale
(int32 width,
int32 height,
InterpolationMode mode = InterpolationMode.UniformB)
|
|||
type
|
IImageReader
|
|||
params
|
width
|
[>0]
|
Width of the scaled image. | |
height
|
[>0]
|
Height of the scaled image. | ||
mode
|
The interpolation mode to use for magnification. Defaults to UniformB. | |||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Scale
|
Updates the value of Coverage, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
public
override
sealed
method
|
SetCoverage
(PixelCoverage coverage)
|
|||
type
|
IImageReader
|
|||
params
|
coverage
|
The pixel coverage. | ||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetCoverage
|
Remarks:
To perform resampling between pixel-is-area and pixel-is point, use ToCoverage.
Updates the value of Gamma.
[OwnerReturn, OwnerThis]
|
||||
public
override
method
|
SetGamma
(float64 gamma)
|
|||
type
|
IImageReader
|
|||
params
|
gamma
|
The gamma correction. | ||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetGamma
|
Updates the value of Georef, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
public
override
sealed
method
|
SetGeoref
(Raster georef)
|
|||
type
|
IImageReader
|
|||
params
|
georef
|
The
georeferencing
information
or
null . |
||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetGeoref
|
Updates the value of Layer, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
public
override
sealed
method
|
SetLayer
(HeightmapLayer layer,
PixelFormat format = PixelFormat.Unknown)
|
|||
type
|
IImageReader
|
|||
params
|
layer
|
The heightmap layer. | ||
format
|
The pixel format to use for choosing the heightmap format (see For). If Unknown, the pixel format of this image will be used. Defaults to Unknown. | |||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetLayer
|
Updates the value of NoData.
[OwnerReturn, OwnerThis]
|
||||
public
override
sealed
method
|
SetNoData
(float64 noData)
|
|||
type
|
IImageReader
|
|||
params
|
noData
|
The raw pixel value to map to void pixels (see NoData). | ||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetNoData
|
Updates the value of Range.
[OwnerReturn, OwnerThis]
|
||||
public
override
method
|
SetRange
(PixelRange range,
bool reinterpret = false)
|
|||
type
|
IImageReader
|
|||
params
|
range
|
The pixel value ranges to use for translating raw pixel values to normalized pixel values (see Range). | ||
reinterpret
|
true
to
leave
raw
pixels
values
unchanged
and
reinterpret
them
according
to
range,
false
to
normalize
raw
pixel
values
to
range.
Defaults
to
false .
|
|||
returns
|
|
The resulting image. | ||
implements
|
ImageReaderBase.SetRange
|
Performs sharpening on this image.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
Sharpen
(IImage detail,
float32 scale,
int32 downsample = 6)
|
|||
type
|
IImageReader
|
|||
params
|
detail
|
[not-null]
|
The high-resolution detail image to use for sharpening. | |
scale
|
[>=0]
|
Scale
factor
to
apply
to
difference
between
full
and
reduced
resolution.
Defaults
to
1 .
|
||
downsample
|
[>0]
|
The
detail
image
will
be
downsamples
by
this
factor.
The
difference
between
the
full
and
reduced
resolutions
will
be
used
to
sharpen
this
image.
Defaults
to
4 .
|
||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Sharpen
|
Skips the given number of scanlines.
public
override
sealed
method
|
SkipScanlines
(int32 count)
|
||
params
|
count
|
[>=0]
|
The number of scanlines to skip. |
implements
|
ImageReaderBase.SkipScanlines
|
Performs smoothing on this image.
[OwnerReturn, OwnerThis]
|
||||
public
method
|
Smooth
()
|
|||
type
|
IImageReader
|
|||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.Smooth
|
Remarks:
Image smoothing is performed using an Uniform-B spline.
Transforms this image from the given pixel coverage semantic to the given one.
[OwnerReturn, OwnerThis]
|
||||
public
virtual
method
|
ToCoverage
(PixelCoverage target,
bool wrapX = false)
|
|||
type
|
IImageReader
|
|||
params
|
target
|
The pixel coverage semantic of the resulting image. | ||
wrapX
|
Is this image wrapped around the X-axis? | |||
returns
|
|
The resulting image. | ||
inherited
|
ImageReaderBase.ToCoverage
|
Remarks:
If this image already has the given pixel coverage semantic, no transformation will be performed.
Validates the state of this object.
public
override
method
|
Validate
(Validator validator)
|
||
params
|
validator
|
[not-null]
|
The validator object. |
implements
|
ImageReaderBase.Validate
|
The image file format (see ImageFormat).
protected
field
|
fileFormat
|
||
type
|
ImageFormat
|
Remarks:
Subclasses are supposed to initialize this value.
The default value is Any.
The set of ReadImageFlags that has been used to create this image reader.
protected
readonly
field
|
flags
|
||
type
|
ReadImageFlags
|
||
inherited
|
ImageReaderBase.flags
|
The georef info object (see Georef).
protected
field
|
georef
|
||
type
|
Raster
|
Remarks:
Subclasses are supposed to fill in this value.
The
default
value
is
null
.
Height of the processed image.
protected
field
|
height
|
||
type
|
int32
|
Remarks:
The value of this field must not be set explicitly. It will be initialized when the InitImageReader method is called.
Will this ImageReaderBase object be used to read actual image data?
protected
property
|
IsReadingData
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
image
data
will
be
read,
false
if
only
metadata
will
be
read.
|
||
inherited
|
ImageReaderBase.IsReadingData
|
Will this ImageReaderBase object be used to read georeferencing metadata?
protected
property
|
IsReadingGeo
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
georeferencing
metadata
will
be
read,
false
if
not. |
||
inherited
|
ImageReaderBase.IsReadingGeo
|
The image file path (see PathInfo).
protected
field
|
pathInfo
|
||
type
|
Path
|
Remarks:
Subclasses are supposed to fill in this value.
The default value is Unknown.
The pixel format of the read image.
protected
field
|
pixelFormat
|
||
type
|
PixelFormat
|
Remarks:
The value of this field can be set explicitly. It can be initialized when the InitImageReader method is called.
The validator object can be used by subclasses to report errors while reading images.
protected
field
|
validator
|
||
type
|
Validator
|
Width of the processed image.
protected
field
|
width
|
||
type
|
int32
|
Remarks:
The value of this field must not be set explicitly. It will be initialized when the InitImageReader method is called.
Creates a new instance of ImageReader.
protected
constructor
|
ImageReader
(ReadImageFlags flags)
|
||
params
|
flags
|
The set of ReadImageFlags for this image reader. |
Remarks:
Subclasses must initialize the following fields (or agree to the default values):
Additionally, subclasses must call InitImageReader once.Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.
protected
override
method
|
DisposeManaged
()
|
||
overrides
|
Disposable.DisposeManaged
|
Remarks:
This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.
Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.
The DisposeManaged method is called before the DisposeUnmanaged method.
Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.
protected
virtual
method
|
DisposeUnmanaged
()
|
||
inherited
|
Disposable.DisposeUnmanaged
|
Remarks:
Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.
The DisposeUnmanaged method is called after the DisposeManaged method.
[EmptyBody, OwnerThis]
|
||||
protected
virtual
method
|
DoReadAll
()
|
|||
type
|
ColorBuffer
|
Processes the given scanline.
protected
abstract
method
|
DoReadScanline
(int32 scanlineY,
Scanline scanline)
|
||
params
|
scanlineY
|
Y-coordinate of the processed scanline. | |
scanline
|
Data buffer that holds the scanline bytes. |
Performs implementation specific actions for skipping scanlines.
protected
abstract
method
|
DoSkipScanlines
(int32 count)
|
||
params
|
count
|
The number of scanlines to skip (will always be greater than zero). |
Remarks:
The value of ScanlineY is updated by this class after the DoSkipScanlines returns.
Initializes the Coverage property.
protected
method
|
InitCoverage
(PixelCoverage coverage)
|
||
params
|
coverage
|
The pixel coverage. |
Initializes the Coverage property.
protected
method
|
InitCoverage
(IImageInfo a,
IImageInfo b = null)
|
||
params
|
a
|
First
image
info
object
to
initialize
from
or
null . |
|
b
|
Second
image
info
object
to
initialize
from
or
null . |
Remarks:
If all non-null image info objects have the same pixel coverage, the Coverage field will be set to the pixel coverage value of the first non-null image info object. Otherwise, the current value will be retained.
Initializes the fileFormat and pathInfo fields.
protected
method
|
InitFileInfo
(IImageInfo a)
|
||
params
|
a
|
The
image
info
from
which
to
read
the
values.
If
null ,
the
fields
will
not
be
updated.
|
Initializes the Gamma property.
protected
method
|
InitGamma
(float64 gamma)
|
||
params
|
gamma
|
The gamma correction to apply (on top of InitGammaImplicit). |
Initializes the Gamma property.
protected
method
|
InitGammaImplicit
(float64 gamma)
|
||
params
|
gamma
|
The implicit gamma correction to apply. |
Initializes the georef field.
protected
method
|
InitGeoref
(IImageInfo a,
IImageInfo b = null)
|
||
params
|
a
|
First
image
info
object
to
initialize
from
or
null . |
|
b
|
Second
image
info
object
to
initialize
from
or
null . |
Remarks:
If
the
current
georef
object
is
null
,
it
will
be
set
to
the
first
non-null
georef
object
(see
Georef)
of
the
first
non-null
image
info
object.
Otherwise,
the
current
value
will
be
retained.
Initializes the ImageReader.
protected
method
|
InitImageReader
(int32 width,
int32 height,
PixelFormat pixelFormat = PixelFormat.Unknown)
|
||
params
|
width
|
[>0]
|
Image width, in pixels. |
height
|
[>0]
|
Image height, in pixels. | |
pixelFormat
|
The final pixel format. If Unknown, the current pixel format will be used. Defaults to Unknown. |
Remarks:
The following fields are initialized by this method:
width
height
pixelFormat
This method must be called once during initialization.
When SetRange has not been called yet, this method will do so, passing Identity as argument.
Initializes the Layer property.
protected
method
|
InitLayer
(HeightmapLayer layer,
PixelFormat format = PixelFormat.Unknown)
|
||
params
|
layer
|
The heightmap layer. | |
format
|
The layer pixel format. |
Initializes the Layer property.
protected
method
|
InitLayer
(IImageInfo a,
IImageInfo b = null)
|
||
params
|
a
|
First
image
info
object
to
initialize
from
or
null . |
|
b
|
Second
image
info
object
to
initialize
from
or
null . |
Remarks:
If the current layer value is None, it will be set to the first height layer value different to None (see Layer) of the first non-null image info object. Otherwise, the current value will be retained.
Initializes the NoData property.
protected
method
|
InitNoData
(float64 noData)
|
||
params
|
noData
|
The nodata value or NanD. |
Initializes the Range property.
protected
method
|
InitRange
(PixelRange range,
bool reinterpret = false)
|
||
params
|
range
|
The pixel range. | |
reinterpret
|
Use
identity
transform
instead
of
Transform?
Defaults
to
false .
|
Initializes the Range property.
protected
method
|
InitRangeImplicit
(PixelRange range)
|
||
params
|
range
|
The implicit pixel range. |
A feature of a binary data format is not supported.
protected
static
method
|
NotSupported
(string feature)
|
||
type
|
IValidateMessage
|
||
params
|
feature
|
Describes the feature that is not supported. | |
returns
|
The ready-to-throw exception. |
Chooses the binary sample format.
protected
method
|
SampleFormat
(int32 value)
|
||
params
|
value
|
The sample format code (see remarks). |
Remarks:
Setting this property will reset the normalization value range:
-2
:
16-bit
signed
integer
=>DefaultInt16-1
:
8-bit
signed
integer
=>DefaultInt80
:
32-bit
floating
point
=>DefaultFloat321
:
8-bit
unsigned
integer
=>DefaultUInt82
:
16-bit
unsigned
integer
=>DefaultUInt16See also:
SampleReadReads the next sample from the image data, normalizes it and returns the resulting value as a 24-bit unsigned integer.
protected
method
|
SampleRead
(IDataStream stream)
|
||
type
|
int32
|
||
params
|
stream
|
The IDataStream to read from. | |
returns
|
|
The
sample
value
or
-1
if
void. |
See also:
SampleFormatTranslates
the
given
sample
value
to
[0..16777215]
.
The
translated
sample
value
is
clamped
to
the
output
range.
protected
method
|
SampleTranslate
(float64 sample)
|
||
type
|
int32
|
||
params
|
sample
|
The sample value. | |
returns
|
|
The
translated
sample
value
or
-1
if
no
data. |
Translates all samples in the given scanline.
protected
method
|
SampleTranslate
(Scanline scanline)
|
||
params
|
scanline
|
The scanline to process. |
Translates
the
given
sample
value
to
[0..16777215]
,
skipping
gamma
correction.
The
translated
sample
value
is
clamped
to
the
output
range.
protected
method
|
SampleTranslateNoGamma
(float64 sample)
|
||
type
|
int32
|
||
params
|
sample
|
The sample value. | |
returns
|
|
The
translated
sample
value
or
-1
if
no
data. |