Table of Contents

Struct YCbCrTransform

Namespace
SixLabors.ImageSharp.ColorProfiles
Assembly
SixLabors.ImageSharp.dll

Represents a YCbCr color transform containing forward and inverse transformation matrices, and the chrominance offsets to apply for full-range encoding

These matrices must be selected to match the characteristics of the associated RgbWorkingSpace, including its transfer function (gamma or companding) and chromaticity coordinates. Using mismatched matrices and working spaces will produce incorrect conversions.

public readonly struct YCbCrTransform
Inherited Members

Constructors

YCbCrTransform(Matrix4x4, Matrix4x4, Vector3)

Initializes a new instance of the YCbCrTransform struct.

public YCbCrTransform(Matrix4x4 forward, Matrix4x4 inverse, Vector3 offset)

Parameters

forward Matrix4x4

The forward transformation matrix from RGB to YCbCr. The matrix must include the standard chrominance offsets in the fourth column, such as (0, 0.5, 0.5).

inverse Matrix4x4

The inverse transformation matrix from YCbCr to RGB. This matrix expects that chrominance offsets have already been subtracted prior to application.

offset Vector3

The chrominance offsets to be added after the forward conversion, and subtracted before the inverse conversion. Usually (0, 0.5, 0.5).

Properties

Forward

Gets the matrix used to convert gamma-encoded RGB to YCbCr.

public Matrix4x4 Forward { get; }

Property Value

Matrix4x4

Inverse

Gets the matrix used to convert YCbCr back to gamma-encoded RGB.

public Matrix4x4 Inverse { get; }

Property Value

Matrix4x4

Offset

Gets the chrominance offset vector to apply during encoding (add) or decoding (subtract).

public Vector3 Offset { get; }

Property Value

Vector3