Class DecodedRasterImage
A decoded raster image in a renderer-neutral form: interleaved 8-bit colour samples plus an optional 8-bit alpha plane.
public sealed class DecodedRasterImage
- Inheritance
-
DecodedRasterImage
- Inherited Members
Remarks
Colour and alpha are kept in separate planes rather than interleaved as RGBA because
that is what a PDF image XObject needs — the alpha plane becomes an /SMask, a
separate stream — and a raster compositor can walk two planes as cheaply as one. Merging
them here would force the PDF writer to split them apart again.
Samples are not premultiplied and carry no colour management: values are exactly what the source file encoded, in sRGB by convention.
Constructors
- DecodedRasterImage(int, int, int, byte[], byte[]?)
Initializes a decoded image.
Properties
- AlphaData
Gets the alpha plane, or null when the image is fully opaque.
- Channels
Gets the number of colour samples per pixel.
- ColorData
Gets the interleaved colour samples.
- HasAlpha
Gets true when an alpha plane is present.
- Height
Gets the height in pixels.
- Width
Gets the width in pixels.
Methods
- GetAlpha(int, int)
Reads one pixel's alpha, or 255 when the image is opaque.
- GetRgb(int, int, out byte, out byte, out byte)
Reads one pixel as RGB, converting from whatever colour model the image carries.