PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureColor Class Reference

Pure color class. More...

Detailed Description

Pure color class.

Definition at line 22 of file PureColor.h.

#include <PureColor.h>

Public Member Functions

 PureColor ()
 Creates a black color.
 
 PureColor (const PureColor &cm)
 
 PureColor (const TPureUByte &red, const TPureUByte &green, const TPureUByte &blue, const TPureUByte &alpha=0)
 Constructs a color.
 
TPureUByte getRed () const
 Gets red component.
 
TPureUByte getGreen () const
 Gets green component.
 
TPureUByte getBlue () const
 Gets blue component.
 
TPureUByte getAlpha () const
 Gets alpha component.
 
void Set (TPureUByte red, TPureUByte green, TPureUByte blue, TPureUByte alpha=0)
 Sets all color components.
 
void SetRed (TPureUByte red)
 Sets red component.
 
void SetGreen (TPureUByte green)
 Sets green component.
 
void SetBlue (TPureUByte blue)
 Sets blue component.
 
void SetAlpha (TPureUByte alpha)
 Sets alpha component.
 
TPureFloat getRedAsFloat () const
 Gets red component.
 
TPureFloat getGreenAsFloat () const
 Gets green component.
 
TPureFloat getBlueAsFloat () const
 Gets blue component.
 
TPureFloat getAlphaAsFloat () const
 Gets alpha component.
 
void SetAsFloats (TPureFloat red, TPureFloat green, TPureFloat blue, TPureFloat alpha=0.0f)
 Sets all color components.
 
void SetRedAsFloat (TPureFloat red)
 Sets red component.
 
void SetGreenAsFloat (TPureFloat green)
 Sets green component.
 
void SetBlueAsFloat (TPureFloat blue)
 Sets blue component.
 
void SetAlphaAsFloat (TPureFloat alpha)
 Sets alpha component.
 
TPureBool operator== (const PureColor &clr) const
 Equals to operator.
 
TPureBool operator!= (const PureColor &clr) const
 Not equals to operator.
 
PureColoroperator= (const PureColor &vec)
 Assignment operator.
 

Private Attributes

TPureUByte r
 
TPureUByte g
 
TPureUByte b
 
TPureUByte a
 

Constructor & Destructor Documentation

◆ PureColor() [1/3]

PureColor::PureColor ( )

Creates a black color.

Definition at line 23 of file PureColor.cpp.

◆ PureColor() [2/3]

PureColor::PureColor ( const PureColor & cm)

Definition at line 29 of file PureColor.cpp.

◆ PureColor() [3/3]

PureColor::PureColor ( const TPureUByte & red,
const TPureUByte & green,
const TPureUByte & blue,
const TPureUByte & alpha = 0 )

Constructs a color.

Parameters
redRed component in range [0, 255].
greenGreen component in range [0, 255].
blueBlue component in range [0, 255].
alphaAlpha component in range [0, 255].

Definition at line 44 of file PureColor.cpp.

Member Function Documentation

◆ getAlpha()

TPureUByte PureColor::getAlpha ( ) const

Gets alpha component.

Returns
Alpha component in range [0, 255].

Definition at line 93 of file PureColor.cpp.

◆ getAlphaAsFloat()

TPureFloat PureColor::getAlphaAsFloat ( ) const

Gets alpha component.

Returns
Alpha component in range [0.0f, 1.0f].

Definition at line 198 of file PureColor.cpp.

◆ getBlue()

TPureUByte PureColor::getBlue ( ) const

Gets blue component.

Returns
Blue component in range [0, 255].

Definition at line 82 of file PureColor.cpp.

◆ getBlueAsFloat()

TPureFloat PureColor::getBlueAsFloat ( ) const

Gets blue component.

Returns
Blue component in range [0.0f, 1.0f].

Definition at line 187 of file PureColor.cpp.

◆ getGreen()

TPureUByte PureColor::getGreen ( ) const

Gets green component.

Returns
Green component in range [0, 255].

Definition at line 71 of file PureColor.cpp.

◆ getGreenAsFloat()

TPureFloat PureColor::getGreenAsFloat ( ) const

Gets green component.

Returns
Green component in range [0.0f, 1.0f].

Definition at line 176 of file PureColor.cpp.

◆ getRed()

TPureUByte PureColor::getRed ( ) const

Gets red component.

Returns
Red component in range [0, 255].

Definition at line 60 of file PureColor.cpp.

◆ getRedAsFloat()

TPureFloat PureColor::getRedAsFloat ( ) const

Gets red component.

Returns
Red component in range [0.0f, 1.0f].

Definition at line 165 of file PureColor.cpp.

◆ operator!=()

TPureBool PureColor::operator!= ( const PureColor & clr) const

Not equals to operator.

Definition at line 277 of file PureColor.cpp.

◆ operator=()

PureColor & PureColor::operator= ( const PureColor & vec)

Assignment operator.

Definition at line 286 of file PureColor.cpp.

◆ operator==()

TPureBool PureColor::operator== ( const PureColor & clr) const

Equals to operator.

Definition at line 268 of file PureColor.cpp.

◆ Set()

void PureColor::Set ( TPureUByte red,
TPureUByte green,
TPureUByte blue,
TPureUByte alpha = 0 )

Sets all color components.

Parameters
redRed component in range [0, 255].
greenGreen component in range [0, 255].
blueBlue component in range [0, 255].
alphaAlpha component in range [0, 255].

Definition at line 107 of file PureColor.cpp.

◆ SetAlpha()

void PureColor::SetAlpha ( TPureUByte alpha)

Sets alpha component.

Parameters
alphaAlpha component in range [0, 255].

Definition at line 154 of file PureColor.cpp.

◆ SetAlphaAsFloat()

void PureColor::SetAlphaAsFloat ( TPureFloat alpha)

Sets alpha component.

Parameters
alphaAlpha component in range [0.0f, 1.0f].

Definition at line 259 of file PureColor.cpp.

◆ SetAsFloats()

void PureColor::SetAsFloats ( TPureFloat red,
TPureFloat green,
TPureFloat blue,
TPureFloat alpha = 0.0f )

Sets all color components.

Parameters
redRed component in range [0.0f, 1.0f].
greenGreen component in range [0.0f, 1.0f].
blueBlue component in range [0.0f, 1.0f].
alphaAlpha component in range [0.0f, 1.0f].

Definition at line 212 of file PureColor.cpp.

◆ SetBlue()

void PureColor::SetBlue ( TPureUByte blue)

Sets blue component.

Parameters
blueBlue component in range [0, 255].

Definition at line 143 of file PureColor.cpp.

◆ SetBlueAsFloat()

void PureColor::SetBlueAsFloat ( TPureFloat blue)

Sets blue component.

Parameters
blueBlue component in range [0.0f, 1.0f].

Definition at line 248 of file PureColor.cpp.

◆ SetGreen()

void PureColor::SetGreen ( TPureUByte green)

Sets green component.

Parameters
greenGreen component in range [0, 255].

Definition at line 132 of file PureColor.cpp.

◆ SetGreenAsFloat()

void PureColor::SetGreenAsFloat ( TPureFloat green)

Sets green component.

Parameters
greenGreen component in range [0.0f, 1.0f].

Definition at line 237 of file PureColor.cpp.

◆ SetRed()

void PureColor::SetRed ( TPureUByte red)

Sets red component.

Parameters
redRed component in range [0, 255].

Definition at line 121 of file PureColor.cpp.

◆ SetRedAsFloat()

void PureColor::SetRedAsFloat ( TPureFloat red)

Sets red component.

Parameters
redRed component in range [0.0f, 1.0f].

Definition at line 226 of file PureColor.cpp.

Member Data Documentation

◆ a

TPureUByte PureColor::a
private

Definition at line 82 of file PureColor.h.

◆ b

TPureUByte PureColor::b
private

Definition at line 82 of file PureColor.h.

◆ g

TPureUByte PureColor::g
private

Definition at line 82 of file PureColor.h.

◆ r

TPureUByte PureColor::r
private

Definition at line 82 of file PureColor.h.


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