Struct CicpColorSpace
- Namespace
- PaintDotNet.Imaging
- Assembly
- PaintDotNet.Windows.Core.dll
The four "coding-independent code points" (CICP) that describe the colour encoding of an image, as defined by ITU-T H.273. This is the payload of the PNG cICP chunk: four 8-bit values, in this field order.
public readonly struct CicpColorSpace : IEquatable<CicpColorSpace>
- Implements
- Inherited Members
Remarks
PNG additionally requires that MatrixCoefficients be Identity and that VideoFullRangeFlag be Full; see PaintDotNet.Imaging.CicpColorSpace.IsValidForPng. This type itself imposes no such restriction so that any cICP chunk can be read and round-tripped faithfully.
Constructors
Properties
- CanColorTransformFrom
Gets whether a color transform can be performed from these code points (i.e. whether they can be used as the source of a color transform). This is true when the matrix coefficients are Identity and either the transfer is PQ (SmpteSt2084PQ) or HLG (AribStdB67Hlg), which are decoded by a dedicated kernel, or the primaries and transfer characteristics are both representable as an ICC profile.
Unlike CanCreateColorContext, the video full range flag does not matter here: narrow (Narrow) range is expanded to full range as part of the transform.
More specifically, when this is
true, it is possible to use CreateColorTransformedBitmap(IImagingFactory, IBitmapSource, CicpColorSpace, IColorContext, in PixelFormat) and CreateColorTransformer(IBitmapSource, CicpColorSpace, IColorContext, in PixelFormat), or one of the other overloads which take a CicpColorSpace.
- CanCreateColorContext
Gets whether an IColorContext (an ICC color profile) can be created for these code points: the matrix coefficients must be Identity, the video full range flag must be Full, and the primaries and transfer characteristics must both be representable as an ICC profile.
- ColorPrimaries
The chromaticities of the source primaries (red, green, blue) and the white point.
- MatrixCoefficients
The matrix coefficients used to derive luma and chroma signals from the source primaries. For PNG this is always Identity.
- RecommendedColorSpace
Gets the KnownColorSpace whose gamut best accommodates the given CICP color information, for use as a working or destination color space.
- TransferCharacteristics
The opto-electronic / electro-optical transfer characteristic (the "gamma" or EOTF).
- VideoFullRangeFlag
The black level and range of the signal. For PNG this is always Full.
Methods
- TryGetKnownColorSpace(out KnownColorSpace)
Tries to identify the KnownColorSpace that this CICP color space exactly describes.