libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
ColorSpace Class Reference

Represents a color space with chromaticity coordinates and transfer functions. More...

#include <colorspace.h>

Classes

struct  Data
 Static data describing a color space. More...
 

Public Types

enum  ID {
  Invalid = 0 , Rec709 , LinearRec709 , Rec601_PAL ,
  LinearRec601_PAL , Rec601_NTSC , LinearRec601_NTSC
}
 Identifies a known color space. More...
 
typedef double(* TransformFunc) (double)
 Function pointer type for electro-optical transfer functions.
 
typedef std::array< CIEPoint, 4 > Params
 CIE chromaticity coordinates: red, green, blue primaries and white point.
 

Public Member Functions

 ColorSpace (ID id=Invalid)
 Constructs a ColorSpace from the given ID, defaulting to Invalid.
 
const ID id () const
 Returns the color space ID.
 
ColorSpace inverseColorSpace ()
 Returns the inverse color space.
 
const String name () const
 Returns the color space name.
 
const String desc () const
 Returns the color space description.
 
const CIEPointred () const
 Returns the red chromaticity coordinate.
 
const CIEPointgreen () const
 Returns the green chromaticity coordinate.
 
const CIEPointblue () const
 Returns the blue chromaticity coordinate.
 
const CIEPointwhitePoint () const
 Returns the white point chromaticity coordinate.
 
double transferFunc (double input) const
 Applies the forward transfer function (OETF) to the given value.
 
double invtTransferFunc (double input) const
 Applies the inverse transfer function (EOTF) to the given value.
 

Detailed Description

Represents a color space with chromaticity coordinates and transfer functions.

Wraps a static lookup table of known color spaces (e.g. Rec. 709, Rec. 601) with their CIE chromaticity primaries, white point, and electro-optical / opto-electronic transfer functions.

Member Enumeration Documentation

◆ ID

Identifies a known color space.

Enumerator
Invalid 

Invalid or unset color space.

Rec709 

ITU-R BT.709 (gamma-corrected).

LinearRec709 

ITU-R BT.709 (linear / scene-referred).

Rec601_PAL 

ITU-R BT.601 PAL (gamma-corrected).

LinearRec601_PAL 

ITU-R BT.601 PAL (linear).

Rec601_NTSC 

ITU-R BT.601 NTSC (gamma-corrected).

LinearRec601_NTSC 

ITU-R BT.601 NTSC (linear).

Member Function Documentation

◆ invtTransferFunc()

double ColorSpace::invtTransferFunc ( double  input) const
inline

Applies the inverse transfer function (EOTF) to the given value.

Parameters
inputThe gamma-corrected value to linearize.
Returns
The linear-light value.

◆ transferFunc()

double ColorSpace::transferFunc ( double  input) const
inline

Applies the forward transfer function (OETF) to the given value.

Parameters
inputThe linear-light value to transform.
Returns
The gamma-corrected value.

The documentation for this class was generated from the following file: