Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
FLinearColor Struct Reference

#include <Color.h>

Public Member Functions

FORCEINLINE FLinearColor ()
 
FORCEINLINE FLinearColor (EForceInit)
 
FORCEINLINE FLinearColor (float InR, float InG, float InB, float InA=1.0f)
 
 FLinearColor (const FColor &Color)
 
FORCEINLINE float & Component (int32 Index)
 
FORCEINLINE const float & Component (int32 Index) const
 
FORCEINLINE FLinearColor operator+ (const FLinearColor &ColorB) const
 
FORCEINLINE FLinearColoroperator+= (const FLinearColor &ColorB)
 
FORCEINLINE FLinearColor operator- (const FLinearColor &ColorB) const
 
FORCEINLINE FLinearColoroperator-= (const FLinearColor &ColorB)
 
FORCEINLINE FLinearColor operator* (const FLinearColor &ColorB) const
 
FORCEINLINE FLinearColoroperator*= (const FLinearColor &ColorB)
 
FORCEINLINE FLinearColor operator* (float Scalar) const
 
FORCEINLINE FLinearColoroperator*= (float Scalar)
 
FORCEINLINE FLinearColor operator/ (const FLinearColor &ColorB) const
 
FORCEINLINE FLinearColoroperator/= (const FLinearColor &ColorB)
 
FORCEINLINE FLinearColor operator/ (float Scalar) const
 
FORCEINLINE FLinearColoroperator/= (float Scalar)
 
FORCEINLINE FLinearColor GetClamped (float InMin=0.0f, float InMax=1.0f) const
 
FORCEINLINE bool operator== (const FLinearColor &ColorB) const
 
FORCEINLINE bool operator!= (const FLinearColor &Other) const
 
FORCEINLINE bool Equals (const FLinearColor &ColorB, float Tolerance=KINDA_SMALL_NUMBER) const
 
FLinearColor CopyWithNewOpacity (float NewOpacicty) const
 
FLinearColor LinearRGBToHSV () const
 
FLinearColor HSVToLinearRGB () const
 
FLinearColor Desaturate (float Desaturation) const
 
float ComputeLuminance () const
 
FORCEINLINE float GetMax () const
 
bool IsAlmostBlack () const
 
FORCEINLINE float GetMin () const
 
FORCEINLINE float GetLuminance () const
 

Static Public Member Functions

static FLinearColor FGetHSV (uint8 H, uint8 S, uint8 V)
 
static FLinearColor MakeRandomColor ()
 
static FLinearColor MakeFromColorTemperature (float Temp)
 
static float Dist (const FLinearColor &V1, const FLinearColor &V2)
 
static float EvaluateBezier (const FLinearColor *ControlPoints, int32 NumPoints, TArray< FLinearColor > &OutPoints)
 
static FLinearColor LerpUsingHSV (const FLinearColor &From, const FLinearColor &To, const float Progress)
 

Public Attributes

float R
 
float G
 
float B
 
float A
 

Static Public Attributes

static float Pow22OneOver255Table [256]
 
static CONSTEXPR double sRGBToLinearTable [256]
 

Detailed Description

A linear, 32-bit/component floating point RGBA color.

Definition at line 33 of file Color.h.

Constructor & Destructor Documentation

◆ FLinearColor() [1/4]

FORCEINLINE FLinearColor::FLinearColor ( )
inline

Definition at line 100 of file Color.h.

◆ FLinearColor() [2/4]

FORCEINLINE FLinearColor::FLinearColor ( EForceInit )
inlineexplicit

Definition at line 101 of file Color.h.

◆ FLinearColor() [3/4]

FORCEINLINE FLinearColor::FLinearColor ( float InR,
float InG,
float InB,
float InA = 1.0f )
inline

Definition at line 104 of file Color.h.

+ Here is the caller graph for this function:

◆ FLinearColor() [4/4]

FLinearColor::FLinearColor ( const FColor & Color)
inline

Definition at line 529 of file Color.h.

Member Function Documentation

◆ Component() [1/2]

FORCEINLINE float & FLinearColor::Component ( int32 Index)
inline

Definition at line 110 of file Color.h.

◆ Component() [2/2]

FORCEINLINE const float & FLinearColor::Component ( int32 Index) const
inline

Definition at line 115 of file Color.h.

◆ ComputeLuminance()

float FLinearColor::ComputeLuminance ( ) const
inline

Computes the perceptually weighted luminance value of a color.

Definition at line 327 of file Color.h.

◆ CopyWithNewOpacity()

FLinearColor FLinearColor::CopyWithNewOpacity ( float NewOpacicty) const
inline

Definition at line 260 of file Color.h.

◆ Desaturate()

FLinearColor FLinearColor::Desaturate ( float Desaturation) const

Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation

Parameters
DesaturationDesaturation factor in range [0..1]
Returns
Desaturated color

◆ Dist()

static float FLinearColor::Dist ( const FLinearColor & V1,
const FLinearColor & V2 )
inlinestatic

Euclidean distance between two points.

Definition at line 285 of file Color.h.

+ Here is the call graph for this function:

◆ Equals()

FORCEINLINE bool FLinearColor::Equals ( const FLinearColor & ColorB,
float Tolerance = KINDA_SMALL_NUMBER ) const
inline

Definition at line 255 of file Color.h.

+ Here is the call graph for this function:

◆ EvaluateBezier()

static float FLinearColor::EvaluateBezier ( const FLinearColor * ControlPoints,
int32 NumPoints,
TArray< FLinearColor > & OutPoints )
static

Generates a list of sample points on a Bezier curve defined by 2 points.

Parameters
ControlPointsArray of 4 Linear Colors (vert1, controlpoint1, controlpoint2, vert2).
NumPointsNumber of samples.
OutPointsReceives the output samples.
Returns
Path length.

◆ FGetHSV()

static FLinearColor FLinearColor::FGetHSV ( uint8 H,
uint8 S,
uint8 V )
static

Converts byte hue-saturation-brightness to floating point red-green-blue.

◆ GetClamped()

FORCEINLINE FLinearColor FLinearColor::GetClamped ( float InMin = 0.0f,
float InMax = 1.0f ) const
inline

Definition at line 232 of file Color.h.

+ Here is the call graph for this function:

◆ GetLuminance()

FORCEINLINE float FLinearColor::GetLuminance ( ) const
inline

Definition at line 358 of file Color.h.

◆ GetMax()

FORCEINLINE float FLinearColor::GetMax ( ) const
inline

Returns the maximum value in this color structure

Returns
The maximum color channel value

Definition at line 337 of file Color.h.

+ Here is the call graph for this function:

◆ GetMin()

FORCEINLINE float FLinearColor::GetMin ( ) const
inline

Returns the minimum value in this color structure

Returns
The minimum color channel value

Definition at line 353 of file Color.h.

+ Here is the call graph for this function:

◆ HSVToLinearRGB()

FLinearColor FLinearColor::HSVToLinearRGB ( ) const

Converts an HSV color to a linear space RGB color

◆ IsAlmostBlack()

bool FLinearColor::IsAlmostBlack ( ) const
inline

useful to detect if a light contribution needs to be rendered

Definition at line 343 of file Color.h.

+ Here is the call graph for this function:

◆ LerpUsingHSV()

static FLinearColor FLinearColor::LerpUsingHSV ( const FLinearColor & From,
const FLinearColor & To,
const float Progress )
static

Linearly interpolates between two colors by the specified progress amount. The interpolation is performed in HSV color space taking the shortest path to the new color's hue. This can give better results than FMath::Lerp(), but is much more expensive. The incoming colors are in RGB space, and the output color will be RGB. The alpha value will also be interpolated.

Parameters
FromThe color and alpha to interpolate from as linear RGBA
ToThe color and alpha to interpolate to as linear RGBA
ProgressScalar interpolation amount (usually between 0.0 and 1.0 inclusive)
Returns
The interpolated color in linear RGB space along with the interpolated alpha value

◆ LinearRGBToHSV()

FLinearColor FLinearColor::LinearRGBToHSV ( ) const

Converts a linear space RGB color to an HSV color

◆ MakeFromColorTemperature()

static FLinearColor FLinearColor::MakeFromColorTemperature ( float Temp)
static

Converts temperature in Kelvins of a black body radiator to RGB chromaticity.

◆ MakeRandomColor()

static FLinearColor FLinearColor::MakeRandomColor ( )
static

Makes a random but quite nice color.

◆ operator!=()

FORCEINLINE bool FLinearColor::operator!= ( const FLinearColor & Other) const
inline

Definition at line 249 of file Color.h.

◆ operator*() [1/2]

FORCEINLINE FLinearColor FLinearColor::operator* ( const FLinearColor & ColorB) const
inline

Definition at line 156 of file Color.h.

+ Here is the call graph for this function:

◆ operator*() [2/2]

FORCEINLINE FLinearColor FLinearColor::operator* ( float Scalar) const
inline

Definition at line 174 of file Color.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator*=() [1/2]

FORCEINLINE FLinearColor & FLinearColor::operator*= ( const FLinearColor & ColorB)
inline

Definition at line 165 of file Color.h.

◆ operator*=() [2/2]

FORCEINLINE FLinearColor & FLinearColor::operator*= ( float Scalar)
inline

Definition at line 184 of file Color.h.

◆ operator+()

FORCEINLINE FLinearColor FLinearColor::operator+ ( const FLinearColor & ColorB) const
inline

Definition at line 120 of file Color.h.

+ Here is the call graph for this function:

◆ operator+=()

FORCEINLINE FLinearColor & FLinearColor::operator+= ( const FLinearColor & ColorB)
inline

Definition at line 129 of file Color.h.

◆ operator-()

FORCEINLINE FLinearColor FLinearColor::operator- ( const FLinearColor & ColorB) const
inline

Definition at line 138 of file Color.h.

+ Here is the call graph for this function:

◆ operator-=()

FORCEINLINE FLinearColor & FLinearColor::operator-= ( const FLinearColor & ColorB)
inline

Definition at line 147 of file Color.h.

◆ operator/() [1/2]

FORCEINLINE FLinearColor FLinearColor::operator/ ( const FLinearColor & ColorB) const
inline

Definition at line 193 of file Color.h.

+ Here is the call graph for this function:

◆ operator/() [2/2]

FORCEINLINE FLinearColor FLinearColor::operator/ ( float Scalar) const
inline

Definition at line 211 of file Color.h.

+ Here is the call graph for this function:

◆ operator/=() [1/2]

FORCEINLINE FLinearColor & FLinearColor::operator/= ( const FLinearColor & ColorB)
inline

Definition at line 202 of file Color.h.

◆ operator/=() [2/2]

FORCEINLINE FLinearColor & FLinearColor::operator/= ( float Scalar)
inline

Definition at line 221 of file Color.h.

◆ operator==()

FORCEINLINE bool FLinearColor::operator== ( const FLinearColor & ColorB) const
inline

Comparison operators

Definition at line 245 of file Color.h.

Member Data Documentation

◆ A

float FLinearColor::A

Definition at line 38 of file Color.h.

◆ B

float FLinearColor::B

Definition at line 37 of file Color.h.

◆ G

float FLinearColor::G

Definition at line 36 of file Color.h.

◆ Pow22OneOver255Table

float FLinearColor::Pow22OneOver255Table[256]
static

Static lookup table used for FColor -> FLinearColor conversion. Pow(2.2)

Definition at line 41 of file Color.h.

◆ R

float FLinearColor::R

Definition at line 35 of file Color.h.

◆ sRGBToLinearTable

CONSTEXPR double FLinearColor::sRGBToLinearTable[256]
static

Static lookup table used for FColor -> FLinearColor conversion. sRGB

Definition at line 44 of file Color.h.


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