Table of Contents

Class PdfJpegMask

Namespace
PdfEngine.Vector
Assembly
PdfEngine.Abstractions.dll

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

Data ReadOnlyMemory<byte>
Width int
Height int
Invert bool

/Decode [1 0]: sample 0 is opaque.

Properties

Data

public ReadOnlyMemory<byte> Data { get; init; }

Property Value

ReadOnlyMemory<byte>

Height

public int Height { get; init; }

Property Value

int

Invert

/Decode [1 0]: sample 0 is opaque.

public bool Invert { get; init; }

Property Value

bool

Width

public int Width { get; init; }

Property Value

int

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

pixels ReadOnlySpan<byte>
bytesPerPixel int
stride int

Returns

byte[]