UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Color::FColorSpace Class Reference

#include <ColorSpace.h>

Public Member Functions

 FColorSpace ()
 
CORE_API FColorSpace (const FVector2d &InRed, const FVector2d &InGreen, const FVector2d &InBlue, const FVector2d &InWhite)
 
CORE_API FColorSpace (UE::Color::EColorSpace ColorSpaceType)
 
 FColorSpace (FColorSpace &&)=default
 
 FColorSpace (const FColorSpace &)=default
 
FColorSpaceoperator= (FColorSpace &&)=default
 
FColorSpaceoperator= (const FColorSpace &)=default
 
template<typename T >
void GetChromaticities (UE::Math::TVector2< T > &OutRed, UE::Math::TVector2< T > &OutGreen, UE::Math::TVector2< T > &OutBlue, UE::Math::TVector2< T > &OutWhite) const
 
const FVector2dGetRedChromaticity () const
 
const FVector2dGetGreenChromaticity () const
 
const FVector2dGetBlueChromaticity () const
 
const FVector2dGetWhiteChromaticity () const
 
const FMatrix44dGetRgbToXYZ () const
 
const FMatrix44dGetXYZToRgb () const
 
bool operator== (const FColorSpace &ColorSpace) const
 
bool operator!= (const FColorSpace &ColorSpace) const
 
CORE_API bool Equals (const FColorSpace &ColorSpace, double Tolerance=1.e-7) const
 
CORE_API bool Equals (const TStaticArray< FVector2d, 4 > &InChromaticities, double Tolerance=1.e-7) const
 
CORE_API bool IsSRGB () const
 
CORE_API FLinearColor MakeFromColorTemperature (float Temp) const
 
CORE_API float GetLuminance (const FLinearColor &Color) const
 
CORE_API FLinearColor GetLuminanceFactors () const
 
bool Serialize (FArchive &Ar)
 

Static Public Member Functions

static CORE_API const FColorSpaceGetWorking ()
 
static CORE_API void SetWorking (FColorSpace ColorSpace)
 
static CORE_API const FColorSpaceGetSRGB ()
 
static CORE_API TStaticArray< FVector2d, 4 > MakeChromaticities (UE::Color::EColorSpace ColorSpaceType)
 

Friends

FArchiveoperator<< (FArchive &Ar, FColorSpace &CS)
 

Detailed Description

Color space definition as 4 chromaticity coordinates, in double precision internally.

Constructor & Destructor Documentation

◆ FColorSpace() [1/5]

UE::Color::FColorSpace::FColorSpace ( )
inline

Constructor

◆ FColorSpace() [2/5]

UE::Color::FColorSpace::FColorSpace ( const FVector2d InRed,
const FVector2d InGreen,
const FVector2d InBlue,
const FVector2d InWhite 
)
explicit

Constructor

Parameters
InRedChromaticity 2D coordinates for the red color.
InGreenChromaticity 2D coordinates for the green color.
InBlueChromaticity 2D coordinates for the blue color.
InWhiteChromaticity 2D coordinates for the white point.

◆ FColorSpace() [3/5]

UE::Color::FColorSpace::FColorSpace ( UE::Color::EColorSpace  ColorSpaceType)
explicit

Constructor

Parameters
ColorSpaceTypeColor space type.

◆ FColorSpace() [4/5]

UE::Color::FColorSpace::FColorSpace ( FColorSpace &&  )
default

◆ FColorSpace() [5/5]

UE::Color::FColorSpace::FColorSpace ( const FColorSpace )
default

Member Function Documentation

◆ Equals() [1/2]

bool UE::Color::FColorSpace::Equals ( const FColorSpace ColorSpace,
double  Tolerance = 1.e-7 
) const

Check against another color space for equality, within specified error limits.

Parameters
ColorSpaceThe color space to check against.
ToleranceError tolerance.
Returns
true if the color spaces are equal within tolerance limits, false otherwise.

◆ Equals() [2/2]

bool UE::Color::FColorSpace::Equals ( const TStaticArray< FVector2d, 4 > &  InChromaticities,
double  Tolerance = 1.e-7 
) const

Check against color space chromaticities for equality, within specified error limits.

Parameters
InChromaticitiesThe color space chromaticities to check against.
ToleranceError tolerance.
Returns
true if the color spaces are equal within tolerance limits, false otherwise.

◆ GetBlueChromaticity()

const FVector2d & UE::Color::FColorSpace::GetBlueChromaticity ( ) const
inline

Gets the color space's blue chromaticity coordinates.

Returns
FVector2d xy coordinates.

◆ GetChromaticities()

template<typename T >
void UE::Color::FColorSpace::GetChromaticities ( UE::Math::TVector2< T > &  OutRed,
UE::Math::TVector2< T > &  OutGreen,
UE::Math::TVector2< T > &  OutBlue,
UE::Math::TVector2< T > &  OutWhite 
) const
inline

Getter for the color space chromaticity coordinates.

Parameters
OutRedFVector2d for the red color chromaticity coordinate.
OutGreenFVector2d for the green color chromaticity coordinate.
OutBlueFVector2d for the blue color chromaticity coordinate.
OutWhiteFVector2d for the white color chromaticity coordinate.

◆ GetGreenChromaticity()

const FVector2d & UE::Color::FColorSpace::GetGreenChromaticity ( ) const
inline

Gets the color space's green chromaticity coordinates.

Returns
FVector2d xy coordinates.

◆ GetLuminance()

float UE::Color::FColorSpace::GetLuminance ( const FLinearColor Color) const

Calculate the color's luminance value in the current space.

Parameters
ColorThe sampled color.
Returns
float Luminance value.

◆ GetLuminanceFactors()

FLinearColor UE::Color::FColorSpace::GetLuminanceFactors ( ) const

Get the luminance factors in the current space.

Returns
FLinearColor Luminance factors.

◆ GetRedChromaticity()

const FVector2d & UE::Color::FColorSpace::GetRedChromaticity ( ) const
inline

Gets the color space's red chromaticity coordinates.

Returns
FVector2d xy coordinates.

◆ GetRgbToXYZ()

const FMatrix44d & UE::Color::FColorSpace::GetRgbToXYZ ( ) const
inline

Gets the RGB-to-XYZ conversion matrix.

Returns
FMatrix conversion matrix.

◆ GetSRGB()

const FColorSpace & UE::Color::FColorSpace::GetSRGB ( )
static

Get a (statically cached) sRGB color space.

Returns
FColorSpace sRGB color space

◆ GetWhiteChromaticity()

const FVector2d & UE::Color::FColorSpace::GetWhiteChromaticity ( ) const
inline

Gets the color space's white point chromaticity coordinates.

Returns
FVector2d xy coordinates.

◆ GetWorking()

const FColorSpace & UE::Color::FColorSpace::GetWorking ( )
static

Get the global engine working color space (as a singleton).

Returns
FColorSpace working color space

NOTE: Addresses issue where shader compilation can request the working color space before it has been loaded by renderer settings. We optionally early-load the settings here and leave existing singleton interface as is.

◆ GetXYZToRgb()

const FMatrix44d & UE::Color::FColorSpace::GetXYZToRgb ( ) const
inline

Gets the XYZ-to-RGB conversion matrix.

Returns
FMatrix conversion matrix.

◆ IsSRGB()

bool UE::Color::FColorSpace::IsSRGB ( ) const

Convenience function to verify if the color space matches the engine's default sRGB chromaticities.

Returns
true if sRGB.

◆ MakeChromaticities()

TStaticArray< FVector2d, 4 > UE::Color::FColorSpace::MakeChromaticities ( UE::Color::EColorSpace  ColorSpaceType)
static

Make the chromaticities of the color space type.

Returns
TStaticArray of four chromaticities

◆ MakeFromColorTemperature()

FLinearColor UE::Color::FColorSpace::MakeFromColorTemperature ( float  Temp) const

Converts temperature in Kelvins of a black body radiator to an RGB color in the current space.

◆ operator!=()

bool UE::Color::FColorSpace::operator!= ( const FColorSpace ColorSpace) const
inline

Check against another color space for inequality.

Parameters
ColorSpaceThe color space to check against.
Returns
true if the color spaces are not equal, false otherwise.

◆ operator=() [1/2]

FColorSpace & UE::Color::FColorSpace::operator= ( const FColorSpace )
default

◆ operator=() [2/2]

FColorSpace & UE::Color::FColorSpace::operator= ( FColorSpace &&  )
default

◆ operator==()

bool UE::Color::FColorSpace::operator== ( const FColorSpace ColorSpace) const
inline

Check against another color space for equality.

Parameters
ColorSpaceThe vector to check against.
Returns
true if the color spaces are equal, false otherwise.

◆ Serialize()

bool UE::Color::FColorSpace::Serialize ( FArchive Ar)
inline

◆ SetWorking()

void UE::Color::FColorSpace::SetWorking ( FColorSpace  ColorSpace)
static

Set the global engine working color space (as a singleton).

Parameters
ColorSpaceworking color space

Friends And Related Symbol Documentation

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FColorSpace CS 
)
friend

Serializer.

Parameters
ArThe Serialization Archive.
CSThe Color Space being serialized.
Returns
Reference to the Archive after serialization.

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