Class PdfJpegMask
A JPEG-compressed soft mask (/SMask with /DCTDecode): its gray samples are alpha. Backends decode Data with their JPEG codec and pass the pixels to ToAlpha(ReadOnlySpan<byte>, int, int).
public sealed record PdfJpegMask : IEquatable<PdfJpegMask>
- Inheritance
-
PdfJpegMask
- Implements
- Inherited Members
Constructors
PdfJpegMask(ReadOnlyMemory<byte>, int, int, bool)
A JPEG-compressed soft mask (/SMask with /DCTDecode): its gray samples are alpha. Backends decode Data with their JPEG codec and pass the pixels to ToAlpha(ReadOnlySpan<byte>, int, int).
public PdfJpegMask(ReadOnlyMemory<byte> Data, int Width, int Height, bool Invert)
Parameters
DataReadOnlyMemory<byte>WidthintHeightintInvertbool/Decode [1 0]: sample 0 is opaque.
Properties
Data
public ReadOnlyMemory<byte> Data { get; init; }
Property Value
Height
public int Height { get; init; }
Property Value
Invert
/Decode [1 0]: sample 0 is opaque.
public bool Invert { get; init; }
Property Value
Width
public int Width { get; init; }
Property Value
Methods
ToAlpha(ReadOnlySpan<byte>, int, int)
The alpha plane (Width × Height) from the decoded mask, as BGRA or gray pixels.
public byte[] ToAlpha(ReadOnlySpan<byte> pixels, int bytesPerPixel, int stride)
Parameters
pixelsReadOnlySpan<byte>bytesPerPixelintstrideint
Returns
- byte[]