# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CRGBA Class Reference

Class pixel RGBA. More...

#include <rgba.h>

Collaboration diagram for NLMISC::CRGBA:

Collaboration graph
[legend]
List of all members.

Public Methods

 CRGBA ()
 Default constructor. do nothing. More...

 CRGBA (uint8 r, uint8 g, uint8 b, uint8 a=255)
 Constructor. More...

uint getPacked () const
 Return a packed pixel. More...

bool operator< (const CRGBA &c) const
 Comparison operator. More...

bool operator!= (const CRGBA &c) const
 Comparison operator. More...

bool operator== (const CRGBA &c) const
 Equality operator. More...

void serial (class NLMISC::IStream &f)
 Serialisation. More...

void blendFromui (const CRGBA &c0, const CRGBA &c1, uint coef)
 Blend two colors. More...

void modulateFromui (CRGBA &c0, uint a)
 Modulate colors with a constant. More...

void modulateFromColor (const CRGBA &c0, const CRGBA &c1)
 Modulate colors with another color. More...

void set (uint8 r, uint8 g, uint8 b, uint8 a=255)
 Set colors. More...

uint16 get565 () const
 Get a 16 bits 565 pixel. More...

void set565 (uint16 col)
 Set the RGB fields with a 16 bits 565 pixel. More...

void avg2 (const CRGBA &a, const CRGBA &b)
 Compute in this the average of 2 RGBA. More...

void avg4 (const CRGBA &a, const CRGBA &b, const CRGBA &c, const CRGBA &d)
 Compute in this the average of 4 RGBA. More...


Public Attributes

uint8 R
 Red componant. More...

uint8 G
 Green componant. More...

uint8 B
 Blue componant. More...

uint8 A
 Alpha componant. More...


Static Public Attributes

const CRGBA Black
 some colors.

const CRGBA Red
const CRGBA Green
const CRGBA Yellow
const CRGBA Blue
const CRGBA Magenta
const CRGBA Cyan
const CRGBA White

Detailed Description

Class pixel RGBA.

Author(s):
Cyril Corvazier , Nevrax France
Date:
2000

Definition at line 43 of file rgba.h.


Constructor & Destructor Documentation

NLMISC::CRGBA::CRGBA ( ) [inline]
 

Default constructor. do nothing.

Definition at line 48 of file rgba.h.

NLMISC::CRGBA::CRGBA ( uint8 r,
uint8 g,
uint8 b,
uint8 a = 255 ) [inline]
 

Constructor.

Parameters:
r   Red componant.
g   Green componant.
b   Blue componant.
a   Alpha componant.

Definition at line 57 of file rgba.h.


Member Function Documentation

void NLMISC::CRGBA::avg2 ( const CRGBA & a,
const CRGBA & b ) [inline]
 

Compute in this the average of 2 RGBA.

Definition at line 166 of file rgba.h.

void NLMISC::CRGBA::avg4 ( const CRGBA & a,
const CRGBA & b,
const CRGBA & c,
const CRGBA & d ) [inline]
 

Compute in this the average of 4 RGBA.

The average is "correct": +1 is added to the four color, to make a "round" like average.

Definition at line 178 of file rgba.h.

void NLMISC::CRGBA::blendFromui ( const CRGBA & c0,
const CRGBA & c1,
uint coef ) [inline]
 

Blend two colors.

Parameters:
c0   Color 0.
c1   Color 1.
coef   Blend factor. 0~255. 0 return c0 and 255 return c1.

Definition at line 92 of file rgba.h.

Referenced by NLMISC::CBitmap::decompressDXT1(), NLMISC::CBitmap::decompressDXT3(), and NLMISC::CBitmap::decompressDXT5().

uint16 NLMISC::CRGBA::get565 ( ) const [inline]
 

Get a 16 bits 565 pixel.

Definition at line 142 of file rgba.h.

uint NLMISC::CRGBA::getPacked ( ) const [inline]
 

Return a packed pixel.

Definition at line 63 of file rgba.h.

void NLMISC::CRGBA::modulateFromColor ( const CRGBA & c0,
const CRGBA & c1 ) [inline]
 

Modulate colors with another color.

Parameters:
c0   Color 0.
c1   Color 1. c0*c1 returned into this.

Definition at line 121 of file rgba.h.

void NLMISC::CRGBA::modulateFromui ( CRGBA & c0,
uint a ) [inline]
 

Modulate colors with a constant.

Parameters:
c0   Color 0.
a   E [0,255]. c0*a returned into this.

Definition at line 107 of file rgba.h.

Referenced by NL3D::CPSRibbon::setupColor(), and NL3D::CPSTailDot::setupColor().

bool NLMISC::CRGBA::operator!= ( const CRGBA & c ) const [inline]
 

Comparison operator.

Definition at line 72 of file rgba.h.

bool NLMISC::CRGBA::operator< ( const CRGBA & c ) const [inline]
 

Comparison operator.

Definition at line 68 of file rgba.h.

bool NLMISC::CRGBA::operator== ( const CRGBA & c ) const [inline]
 

Equality operator.

Definition at line 77 of file rgba.h.

void NLMISC::CRGBA::serial ( class NLMISC::IStream & f )
 

Serialisation.

Parameters:
f   Stream used for serialisation.

Definition at line 52 of file rgba.cpp.

void NLMISC::CRGBA::set ( uint8 r,
uint8 g,
uint8 b,
uint8 a = 255 )
 

Set colors.

Parameters:
r   Red componant.
g   Green componant.
b   Blue componant.
a   Alpha componant.

Definition at line 60 of file rgba.cpp.

Referenced by NLMISC::CBitmap::decompressDXT1(), NLMISC::CBitmap::decompressDXT3(), NLMISC::CBitmap::decompressDXT5(), and NLMISC::CBitmap::makeDummy().

void NLMISC::CRGBA::set565 ( uint16 col ) [inline]
 

Set the RGB fields with a 16 bits 565 pixel.

Definition at line 150 of file rgba.h.


Member Data Documentation

uint8 NLMISC::CRGBA::A
 

Alpha componant.

Definition at line 194 of file rgba.h.

uint8 NLMISC::CRGBA::B
 

Blue componant.

Definition at line 192 of file rgba.h.

const CRGBA NLMISC::CRGBA::Black [static]
 

some colors.

const CRGBA NLMISC::CRGBA::Blue [static]
 

Definition at line 202 of file rgba.h.

const CRGBA NLMISC::CRGBA::Cyan [static]
 

Definition at line 204 of file rgba.h.

uint8 NLMISC::CRGBA::G
 

Green componant.

Definition at line 190 of file rgba.h.

const CRGBA NLMISC::CRGBA::Green [static]
 

Definition at line 200 of file rgba.h.

const CRGBA NLMISC::CRGBA::Magenta [static]
 

Definition at line 203 of file rgba.h.

uint8 NLMISC::CRGBA::R
 

Red componant.

Definition at line 188 of file rgba.h.

const CRGBA NLMISC::CRGBA::Red [static]
 

Definition at line 199 of file rgba.h.

const CRGBA NLMISC::CRGBA::White [static]
 

Definition at line 205 of file rgba.h.

const CRGBA NLMISC::CRGBA::Yellow [static]
 

Definition at line 201 of file rgba.h.


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