Base interface that declares image operations that can be performed on IImage and IImageReader objects.
interface
|
IImageOps
|
with
|
<T>
|
as
|
class
|
base of
|
IImage
|
||||
IImageReader
|
Image operations can be performed on IImage objects and IImageReader object.
Adjust the brightness and saturation of this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
Adjust
(int32 brightness,
int32 saturation = 0)
|
|||
type
|
T
|
|||
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. |
See also:
Colors.AdjustThe image scanlines will be read using concurrent background tasks.
[OwnerReturn, OwnerThis]
|
||||
method
|
Background
()
|
|||
type
|
T
|
|||
returns
|
|
The resulting IImageReader object. |
Returns an opaque grayscale image which pixel values are equal to the given pixel channel of this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
ChannelToIntensity
(PixelChannel channel)
|
|||
type
|
T
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. |
Remarks:
Void pixels in this image will also be void in the resulting image.
See also:
IntensityToChannelReturns an image that represents a sub rectangle of this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
Clip
(int32 x,
int32 y,
int32 width,
int32 height)
|
|||
type
|
T
|
|||
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. |
Assumes the image holds a non-rectangular shape that is padded with a uniform color and replaces all padding pixels with void.
[OwnerReturn, OwnerThis]
|
||||
method
|
Crop
(int64 color = Colors.Black,
int32 skip = 1)
|
|||
type
|
T
|
|||
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. |
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.
Transform linear pixel values using a custom function.
[OwnerReturn, OwnerThis]
|
||||
method
|
Function
(string function,
PixelChannel channel = PixelChannel.Intensity)
|
|||
type
|
T
|
|||
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.
|
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]
|
||||
method
|
IntensityToChannel
(PixelChannel channel)
|
|||
type
|
T
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. |
Remarks:
Void pixels in this image will also be void in the resulting image.
See also:
ChannelToIntensityReplaces a pixel channel of the given image with the grayscale intensities of this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
IntensityToChannel
(PixelChannel channel,
[Owner]
T image)
|
|||
type
|
T
|
|||
params
|
channel
|
The pixel channel to replace. | ||
image
|
[not-null]
|
The image which pixel channel is to be replaced. | ||
returns
|
|
The resulting image. |
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]
|
||||
method
|
Invert
(PixelChannel channel)
|
|||
type
|
T
|
|||
params
|
channel
|
The pixel channel. | ||
returns
|
|
The resulting image. |
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]
|
||||
method
|
Op
([Owner]
T other,
ColorOp colorOp)
|
|||
type
|
T
|
|||
params
|
other
|
[not-null]
|
The other image. | |
colorOp
|
The color operation to apply. | |||
returns
|
|
The resulting image. |
Pads this image by duplicating pixels at the borders.
[OwnerReturn, OwnerThis]
|
||||
method
|
Pad
(int32 amount = 1)
|
|||
type
|
T
|
|||
params
|
amount
|
[>=0]
|
The
pad
amount,
in
pixels.
Defaults
to
1 . |
|
returns
|
|
The resulting image. |
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.
Returns an image that represents a scaled version of this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
Scale
(int32 width,
int32 height,
InterpolationMode mode = InterpolationMode.UniformB)
|
|||
type
|
T
|
|||
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. |
Updates the value of Coverage, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetCoverage
(PixelCoverage coverage)
|
|||
type
|
T
|
|||
params
|
coverage
|
The pixel coverage. | ||
returns
|
|
The resulting image. |
Remarks:
To perform resampling between pixel-is-area and pixel-is point, use ToCoverage.
Updates the value of Gamma.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetGamma
(float64 gamma)
|
|||
type
|
T
|
|||
params
|
gamma
|
The gamma correction. | ||
returns
|
|
The resulting image. |
Updates the value of Georef, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetGeoref
(Raster georef)
|
|||
type
|
T
|
|||
params
|
georef
|
The
georeferencing
information
or
null . |
||
returns
|
|
The resulting image. |
Updates the value of Layer, without modifying the image content.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetLayer
(HeightmapLayer layer,
PixelFormat format = PixelFormat.Unknown)
|
|||
type
|
T
|
|||
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. |
Updates the value of NoData.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetNoData
(float64 noData)
|
|||
type
|
T
|
|||
params
|
noData
|
The raw pixel value to map to void pixels (see NoData). | ||
returns
|
|
The resulting image. |
Updates the value of Range.
[OwnerReturn, OwnerThis]
|
||||
method
|
SetRange
(PixelRange range,
bool reinterpret = false)
|
|||
type
|
T
|
|||
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. |
Performs sharpening on this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
Sharpen
(IImage detail,
float32 scale = 1,
int32 downsample = 4)
|
|||
type
|
T
|
|||
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. |
Performs smoothing on this image.
[OwnerReturn, OwnerThis]
|
||||
method
|
Smooth
()
|
|||
type
|
T
|
|||
returns
|
|
The resulting image. |
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]
|
||||
method
|
ToCoverage
(PixelCoverage target,
bool wrapX = false)
|
|||
type
|
T
|
|||
params
|
target
|
The pixel coverage semantic of the resulting image. | ||
wrapX
|
Is this image wrapped around the X-axis? | |||
returns
|
|
The resulting image. |
Remarks:
If this image already has the given pixel coverage semantic, no transformation will be performed.