PeachImage
PeachImage.Formats.Png
PngAlphaSplitInfo Struct
The result of splitting a PNG’s per-pixel alpha channel out into an independent plane. See TrySplit(PngPassthroughInfo, PngAlphaSplitInfo).
public readonly record struct PngAlphaSplitInfo : System.IEquatable<PeachImage.Formats.Png.PngAlphaSplitInfo>
Implements System.IEquatable<PngAlphaSplitInfo>
| Constructors | |
|---|---|
| PngAlphaSplitInfo(int, int, byte, byte[], byte[], byte, bool) | The result of splitting a PNG’s per-pixel alpha channel out into an independent plane. See TrySplit(PngPassthroughInfo, PngAlphaSplitInfo). |
| Properties | |
|---|---|
| AlphaBitDepth | The bit depth of each AlphaData sample. Always 8 in the current implementation. |
| AlphaData | A complete, independent zlib (RFC 1950) stream of single-channel (DeviceGray) alpha samples, <b>PNG-filtered exactly like a PNG <c>IDAT</c> stream</b> — every row is prefixed with a filter-type byte (always 0/None here) followed by Width sample bytes, the same row shape a real PNG file’s own IDAT uses. This is deliberate, not raw flat pixel bytes: it lets a caller embed this stream as a PDF /FlateDecode/SMask with `/DecodeParms « /Predictor 15 /Colors 1 |
| /BitsPerComponent 8 /Columns »` — PDF’s own “PNG prediction” mechanism, which a compliant PDF reader decodes identically to a real PNG row filter — the same technique already applies to IdatData itself (which keeps its original filter bytes verbatim), so this keeps both halves of a split image consistent with how PNG-sourced PDF image data is always framed. | |
| ColorBitDepth | The bit depth of each ColorData sample, or 0 when ColorData is null. |
| ColorData | A complete, independent zlib (RFC 1950) stream of the de-interleaved color samples (gray or RGB, per ColorIsRgb), framed exactly like AlphaData (a leading filter-type-None byte per row) — ready to embed as a PDF /FlateDecode color XObject stream with the matching /DecodeParms /Predictor 15 (/Colors 1 or 3 per ColorIsRgb). null when the source was a palette (indexed) image: in that case the color side needs no new data at all — pair the original IdatData and PaletteData with a PDF /Indexed color space as usual, and use only AlphaData from this result as the /SMask. |
| ColorIsRgb | Whether ColorData holds 3-sample RGB pixels (source color type 6, TruecolorAlpha) as opposed to 1-sample grayscale pixels (source color type 4, GrayscaleAlpha). Meaningless when ColorData is null. |
| Height | The image height in pixels. |
| Width | The image width in pixels. |