CreateImage(ReadOnlySpan, ReadOnlySpan, PdfImageLayout, PdfImageCompression) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Creates an image XObject with a soft mask from buffers of samples and alpha, or returns the one this document already has for the same buffers.

public PdfImage CreateImage(ReadOnlySpan<byte> samples, ReadOnlySpan<byte> alpha, PdfImageLayout layout, PdfImageCompression compression)

Parameters

alpha
ReadOnlySpan<Byte>

The opacity of each pixel, one sample per pixel at the layout's bits per component (0 transparent, the maximum opaque), rows byte-aligned: ceil(Width × BitsPerComponent / 8) × Height bytes.

layout
PdfImageLayout

The size, colour space and bits per component of both buffers.

compression
PdfImageCompression

How to compress the colour samples; the alpha is always compressed with Flate.

Returns

PdfImage
The image, an indirect stream whose SMask is a DeviceGray image of the alpha.

Remarks

ISO 32000-2 §8.9.5 and §11.6.5.2 (soft-mask images, PDF 1.4). As the other overload; also records PDF 1.4. A mutation.