Scanline
Description
This class represents the scanline data of an image and provides methods for pixel manipulation.
Image processing is performed scanline after scanline. Regardless of the actual pixel format of an image, during processing scanline pixels are represented as 96-bit color values with 24-bits for each color channel (see Pixels).
An image can contain void pixels. These pixels do not store data and thus represent holes in the image data. Void pixels are represented by the out-of-range pixel channel value -1
.
Public / Methods
Channel
2 overloads
Returns a channel value of the given pixel.
Sets a channel value of the given pixel.
Set_RGB_16
2 overloads
Sets a pixel of the scanline (16 bits precision).
- See also
Sets a pixel of the scanline (16 bits precision).
Set_RGB_8
2 overloads
Sets a pixel of the scanline (8 bits precision).
- See also
Sets a pixel of the scanline (8 bits precision).
Public / Attributes
Format
The pixel format of the scanline.
This property is set by image readers for informational purposes only. It does not affect pixel processing.
Pixels
The pixels of the scanline.
Pixel data is always processed in an uniform layout that is independent of the actual PixelFormat of the image:
+---+---+---+---+---+---+---+---+---+---+---+---+-----+---+---+---+---+ | R | G | B | A | R | G | B | A | R | G | B | A | | R | G | B | A | +---+---+---+---+---+---+---+---+---+---+---+---+ ... +---+---+---+---+ | Pixel 0 | Pixel 1 | Pixel 0 | | Pixel Width-1 | +---------------+---------------+---------------+-----+---------------+
Each of color channels R
, G
, B
and A
are encoded as an unsigned 24-bit integer value in the range [0..16777215]
.
An image may contain pixels that represent missing data and thus do not have a value. For those pixels, all channel values are set to -1
. It is sufficient to test if any channel value is less than zero for determining if a pixel is void.
This array can be indexed as follows:
Pixels[x * 4 + 0] := red channel value in the range [0..16777215] or -1 if void pixel. Pixels[x * 4 + 1] := green channel value in the range [0..16777215] or -1 if void pixel. Pixels[x * 4 + 2] := blue channel value in the range [0..16777215] or -1 if void pixel. Pixels[x * 4 + 3] := alpha channel value in the range [0..16777215] or -1 if void pixel.
where x
is the X-coordinate of a pixel in the Scanline.