engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | 所有成员列表
FLinearColor结构体 参考

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

#include <Color.h>

Public 成员函数

float ComputeLuminance () const
 Computes the perceptually weighted luminance value of a color.
 
CORE_API FLinearColor Desaturate (float Desaturation) const
 Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation 更多...
 
CORE_API FLinearColor (const FColor &Color)
 Converts an FColor which is assumed to be in sRGB space, into linear color space. 更多...
 
FORCEINLINE float GetMax () const
 Returns the maximum value in this color structure 更多...
 
FORCEINLINE float GetMin () const
 Returns the minimum value in this color structure 更多...
 
CORE_API FLinearColor HSVToLinearRGB () const
 Converts an HSV color to a linear space RGB color
 
bool InitFromString (const FString &InSourceString)
 Initialize this Color based on an FString. 更多...
 
bool IsAlmostBlack () const
 useful to detect if a light contribution needs to be rendered
 
CORE_API FLinearColor LinearRGBToHSV () const
 Converts a linear space RGB color to an HSV color
 
FORCEINLINE bool operator== (const FLinearColor &ColorB) const
 Comparison operators
 
CORE_API FColor Quantize () const
 Quantizes the linear color and returns the result as a FColor. 更多...
 
CORE_API FColor QuantizeRound () const
 Quantizes the linear color with rounding and returns the result as a FColor. 更多...
 
CORE_API FColor ToFColor (const bool bSRGB) const
 Quantizes the linear color and returns the result as a FColor with optional sRGB conversion and quality as goal.
 

静态 Public 成员函数

static float Dist (const FLinearColor &V1, const FLinearColor &V2)
 Euclidean distance between two points.
 
static CORE_API float EvaluateBezier (const FLinearColor *ControlPoints, int32 NumPoints, TArray< FLinearColor > &OutPoints)
 Generates a list of sample points on a Bezier curve defined by 2 points. 更多...
 
static CORE_API FLinearColor FromPow22Color (const FColor &Color)
 Converts an FColor coming from an observed Pow(1/2.2) output, into a linear color. 更多...
 
static CORE_API FLinearColor FromSRGBColor (const FColor &Color)
 Converts an FColor coming from an observed sRGB output, into a linear color. 更多...
 
static CORE_API FLinearColor LerpUsingHSV (const FLinearColor &From, const FLinearColor &To, const float Progress)
 Linearly interpolates between two colors by the specified progress amount. 更多...
 
static CORE_API FLinearColor MakeFromColorTemperature (float Temp)
 Converts temperature in Kelvins of a black body radiator to RGB chromaticity.
 
static CORE_API FLinearColor MakeFromHSV8 (uint8 H, uint8 S, uint8 V)
 Converts byte hue-saturation-brightness to floating point red-green-blue.
 
static CORE_API FLinearColor MakeRandomColor ()
 Makes a random but quite nice color.
 

静态 Public 属性

static float Pow22OneOver255Table [256]
 Static lookup table used for FColor -> FLinearColor conversion. 更多...
 
static float sRGBToLinearTable [256]
 Static lookup table used for FColor -> FLinearColor conversion. 更多...
 

详细描述

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

示例
/github/workspace/Engine/Source/Runtime/UMG/Public/Components/Widget.h.

构造及析构函数说明

◆ FLinearColor()

CORE_API FLinearColor::FLinearColor ( const FColor &  Color)

Converts an FColor which is assumed to be in sRGB space, into linear color space.

参数
ColorThe sRGB color that needs to be converted into linear space.

成员函数说明

◆ Desaturate()

CORE_API FLinearColor FLinearColor::Desaturate ( float  Desaturation) const

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

参数
DesaturationDesaturation factor in range [0..1]
返回
Desaturated color

◆ EvaluateBezier()

static CORE_API 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.

参数
ControlPointsArray of 4 Linear Colors (vert1, controlpoint1, controlpoint2, vert2).
NumPointsNumber of samples.
OutPointsReceives the output samples.
返回
Path length.

◆ FromPow22Color()

static CORE_API FLinearColor FLinearColor::FromPow22Color ( const FColor &  Color)
static

Converts an FColor coming from an observed Pow(1/2.2) output, into a linear color.

参数
ColorThe Pow(1/2.2) color that needs to be converted into linear space.

◆ FromSRGBColor()

static CORE_API FLinearColor FLinearColor::FromSRGBColor ( const FColor &  Color)
static

Converts an FColor coming from an observed sRGB output, into a linear color.

参数
ColorThe sRGB color that needs to be converted into linear space.

◆ GetMax()

FORCEINLINE float FLinearColor::GetMax ( ) const
inline

Returns the maximum value in this color structure

返回
The maximum color channel value

◆ GetMin()

FORCEINLINE float FLinearColor::GetMin ( ) const
inline

Returns the minimum value in this color structure

返回
The minimum color channel value

◆ InitFromString()

bool FLinearColor::InitFromString ( const FString &  InSourceString)
inline

Initialize this Color based on an FString.

The String is expected to contain R=, G=, B=, A=. The FLinearColor will be bogus when InitFromString returns false.

参数
InSourceStringFString containing the color values.
返回
true if the R,G,B values were read successfully; false otherwise.

◆ LerpUsingHSV()

static CORE_API 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.

参数
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)
返回
The interpolated color in linear RGB space along with the interpolated alpha value

◆ Quantize()

CORE_API FColor FLinearColor::Quantize ( ) const

Quantizes the linear color and returns the result as a FColor.

This bypasses the SRGB conversion.

◆ QuantizeRound()

CORE_API FColor FLinearColor::QuantizeRound ( ) const

Quantizes the linear color with rounding and returns the result as a FColor.

This bypasses the SRGB conversion.

类成员变量说明

◆ Pow22OneOver255Table

float FLinearColor::Pow22OneOver255Table[256]
static

Static lookup table used for FColor -> FLinearColor conversion.

Pow(2.2)

◆ sRGBToLinearTable

float FLinearColor::sRGBToLinearTable[256]
static

Static lookup table used for FColor -> FLinearColor conversion.

sRGB


该结构体的文档由以下文件生成: