DpxEncoder Class

Immutable settings for DPX encoding (SMPTE ST 268, version 2.0: one RGB, RGBA or luma image element).

public sealed class DpxEncoder : ImageEncoder

Remarks

The output has one uncompressed image element, after the generic and industry-specific headers, at the 8 KiB offset the standard recommends. Gray pixel formats are written as a luma element (descriptor 6), opaque images as RGB (50), and images that have a pixel that is not fully opaque as RGBA (51). 10-bit components are filled to 32-bit words with method A (three components per word, the first in the most significant bits, two padding bits at the bottom) and 12-bit components to 16-bit words (four padding bits at the bottom), the packing every reader reads; lines start on 32-bit words.

By default, 8-bit pixel formats are written with 8 bits, 16-bit ones with 16 bits and floating-point ones as 32-bit floating-point components (RgbaHalf exactly, through single precision). DpxEncoder.BitDepth selects another depth: integer samples are scaled to the nearest code value, round(v × (2^n - 1) / max), and samples written as floating point are v / max. Writing 16-bit samples with fewer bits loses precision and requires DpxEncoder.AllowBitDepthReduction; writing floating-point pixels as integers follows ImageEncoder.FloatingPointConversion.

The transfer characteristic and the colorimetric specification come from the metadata: linear light (ColorTransferFunction.Linear) is written as transfer 2 (linear), and the CICP descriptions of BT.709 and of the two BT.601 systems as their codes of Tables 5A and 5B; other images are written as user defined (transfer 0) with the primaries of BT.709 (colorimetric 6), the primaries of sRGB. Another CICP description or an ICC profile, EXIF, XMP, a resolution and text entries follow ImageEncoder.MetadataHandling (rejected by default). The orientation is written as the orientation code of the image header and the pixel aspect ratio in its field; ImageMetadata.DpxHeader is ignored.

DPX stores exactly one frame: animated images and images with a poster frame are rejected with an UnsupportedImageFeatureException; use ImageFrame.Save to save one frame explicitly.

Inheritance
ImageEncoder DpxEncoder

Constructors

NameDescription
DpxEncoder()

DpxEncoder()

public DpxEncoder()

No documentation is available.

Properties

NameDescription
AllowBitDepthReductionGets a value indicating whether 16-bit pixels may be written with fewer bits (DpxEncoder.BitDepth set to 8, 10 or 12), which rounds them. Defaults to false.
BitDepthGets the number of bits of the components: 8, 10, 12 or 16 (integers) or 32 (floating point), or null (the default) for the depth of the pixel format.
ByteOrderGets the byte order of the file. Defaults to DpxByteOrder.BigEndian.
FormatGets the format produced by this encoder.

AllowBitDepthReduction

DpxEncoder.cs

Gets a value indicating whether 16-bit pixels may be written with fewer bits (DpxEncoder.BitDepth set to 8, 10 or 12), which rounds them. Defaults to false.

public bool AllowBitDepthReduction { get; init; }

Property value

bool

Gets the number of bits of the components: 8, 10, 12 or 16 (integers) or 32 (floating point), or null (the default) for the depth of the pixel format.

public int? BitDepth { get; init; }

Property value

int?

Exceptions

ArgumentOutOfRangeException
The value is not 8, 10, 12, 16 or 32.

ByteOrder

DpxEncoder.cs

Gets the byte order of the file. Defaults to DpxByteOrder.BigEndian.

public DpxByteOrder ByteOrder { get; init; }

Property value

DpxByteOrder

Exceptions

ArgumentOutOfRangeException
The value is not a defined DpxByteOrder.

Gets the format produced by this encoder.

public override ImageFormat Format { get; }

Property value

ImageFormat