My Project
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ParaEngine::LinearColor Struct Reference

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

#include <ParaColor.h>

Public Member Functions

 LinearColor (EnumForceInit)
 
 LinearColor (float InR, float InG, float InB, float InA=1.0f)
 
 LinearColor (const class Color &C)
 
 LinearColor (uint32 C)
 
 LinearColor (const float *colors)
 
 LinearColor (const class Vector3 &Vector)
 
 operator const float * () const
 
float & Component (int32 Index)
 
const float & Component (int32 Index) const
 
LinearColoroperator= (uint32 color)
 
LinearColoroperator= (const Color &color)
 
 operator uint32 () const
 
LinearColor operator+ (const LinearColor &ColorB) const
 
LinearColoroperator+= (const LinearColor &ColorB)
 
LinearColor operator- (const LinearColor &ColorB) const
 
LinearColoroperator-= (const LinearColor &ColorB)
 
LinearColor operator* (const LinearColor &ColorB) const
 
LinearColoroperator*= (const LinearColor &ColorB)
 
LinearColor operator* (float Scalar) const
 
LinearColoroperator*= (float Scalar)
 
LinearColor operator/ (const LinearColor &ColorB) const
 
LinearColoroperator/= (const LinearColor &ColorB)
 
LinearColor operator/ (float Scalar) const
 
LinearColoroperator/= (float Scalar)
 
bool operator== (const LinearColor &ColorB) const
 Comparison operators.
 
bool operator!= (const LinearColor &Other) const
 
bool Equals (const LinearColor &ColorB, float Tolerance=KINDA_SMALL_NUMBER) const
 
LinearColor CopyWithNewOpacity (float NewOpacicty)
 
LinearColor LinearRGBToHSV () const
 Converts a linear space RGB color to an HSV color.
 
LinearColor HSVToLinearRGB () const
 Converts an HSV color to a linear space RGB color.
 
Color Quantize () const
 Quantizes the linear color and returns the result as a color. More...
 
Color ToColor (bool bSRGB=false) const
 Quantizes the linear color and returns the result as a color with optional sRGB conversion and quality as goal. More...
 
Vector3 ToVector3 () const
 
LinearColor Desaturate (float Desaturation) const
 Returns a desaturated color, with 0 meaning no desaturation and 1 == full desaturation. More...
 
float ComputeLuminance () const
 Computes the perceptually weighted luminance value of a color. More...
 
float GetMax () const
 Returns the maximum value in this color structure. More...
 
bool IsAlmostBlack () const
 useful to detect if a light contribution needs to be rendered
 
float GetMin () const
 Returns the minimum value in this color structure. More...
 
float GetLuminance () const
 

Static Public Member Functions

static LinearColor FGetHSV (uint8 H, uint8 S, uint8 V)
 Converts byte hue-saturation-brightness to floating point red-green-blue.
 
static float Dist (const LinearColor &V1, const LinearColor &V2)
 Euclidean distance between two points.
 

Public Attributes

float r
 
float g
 
float b
 
float a
 

Static Public Attributes

static float PowOneOver255Table [256]
 Static lookup table used for color -> LinearColor conversion. More...
 
static const LinearColor White
 
static const LinearColor Gray
 
static const LinearColor Black
 
static const LinearColor Transparent
 
static const LinearColor Red
 
static const LinearColor Green
 
static const LinearColor Blue
 
static const LinearColor Yellow
 

Detailed Description

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

Member Function Documentation

§ ComputeLuminance()

float LinearColor::ComputeLuminance ( ) const

Computes the perceptually weighted luminance value of a color.

§ Desaturate()

LinearColor LinearColor::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

§ GetMax()

float ParaEngine::LinearColor::GetMax ( ) const
inline

Returns the maximum value in this color structure.

Returns
The maximum color channel value

§ GetMin()

float ParaEngine::LinearColor::GetMin ( ) const
inline

Returns the minimum value in this color structure.

Returns
The minimum color channel value

§ Quantize()

Color LinearColor::Quantize ( ) const

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

This bypasses the SRGB conversion.

§ ToColor()

Color LinearColor::ToColor ( bool  bSRGB = false) const

Quantizes the linear color and returns the result as a color with optional sRGB conversion and quality as goal.

Quantizes the linear color and returns the result as a Color with optional sRGB conversion and quality as goal.

Member Data Documentation

§ PowOneOver255Table

float LinearColor::PowOneOver255Table
static

Static lookup table used for color -> LinearColor conversion.

Pow table for fast Color -> LinearColor conversion.

Math::Pow( i / 255.f, 2.2f )


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