NLMISC::CRGBA Class Reference

#include <rgba.h>


Detailed Description

Class pixel RGBA
Author:
Cyril Corvazier

Nevrax France

Date:
2000

Definition at line 44 of file rgba.h.

Public Member Functions

void add (CRGBA c0, CRGBA c1)
void avg2 (CRGBA a, CRGBA b)
void avg4 (CRGBA a, CRGBA b, CRGBA c, CRGBA d)
void blendFromui (CRGBA c0, CRGBA c1, uint coef)
 CRGBA (uint8 r, uint8 g, uint8 b, uint8 a=255)
 CRGBA ()
 Default constructor. do nothing.

uint16 get565 () const
uint getPacked () const
void modulateFromColor (CRGBA c0, CRGBA c1)
void modulateFromui (CRGBA c0, uint a)
bool operator!= (CRGBA c) const
bool operator< (CRGBA c) const
bool operator== (CRGBA c) const
void serial (class NLMISC::IStream &f)
void set (uint8 r, uint8 g, uint8 b, uint8 a=255)
void set565 (uint16 col)
void setPacked (uint packed)
void sub (CRGBA c0, CRGBA c1)
RGBOnly methods. Same f() as their homonym, but don't modify A component.
void addRGBOnly (CRGBA c0, CRGBA c1)
 see add()

void avg2RGBOnly (CRGBA a, CRGBA b)
 see avg2()

void avg4RGBOnly (CRGBA a, CRGBA b, CRGBA c, CRGBA d)
 see avg4()

void blendFromuiRGBOnly (CRGBA c0, CRGBA c1, uint coef)
 see blendFromui()

void modulateFromColorRGBOnly (CRGBA c0, CRGBA c1)
 see modulateFromColor()

void modulateFromuiRGBOnly (CRGBA c0, uint a)
 see modulateFromui()

void subRGBOnly (CRGBA c0, CRGBA c1)
 see sub()

Color space conversions RGB only
void buildFromHLS (float h, float l, float s)
bool convertToHLS (float &h, float &l, float &S) const

Static Public Member Functions

Color group manipulation
void addColors (CRGBA *dest, const CRGBA *src1, const CRGBA *src2, uint numColors, uint srcStride=sizeof(CRGBA), uint destStride=sizeof(CRGBA), uint dup=1)
void modulateColors (CRGBA *dest, const CRGBA *src1, const CRGBA *src2, uint numColors, uint srcStride=sizeof(CRGBA), uint destStride=sizeof(CRGBA), uint dup=1)
void subtractColors (CRGBA *dest, const CRGBA *src1, const CRGBA *src2, uint numColors, uint srcStride=sizeof(CRGBA), uint destStride=sizeof(CRGBA), uint dup=1)

Data Fields

uint8 A
 Alpha componant.

uint8 B
 Blue componant.

uint8 G
 Green componant.

uint8 R
 Red componant.


Static Public Attributes

const CRGBA Black
 some colors

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


Constructor & Destructor Documentation

NLMISC::CRGBA::CRGBA  )  [inline]
 

Default constructor. do nothing.

Definition at line 49 of file rgba.h.

00049 {};

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 58 of file rgba.h.

References r, and uint8.

00058                                                       :
00059                 R(r), G(g), B(b), A(a) {}


Member Function Documentation

void NLMISC::CRGBA::add CRGBA  c0,
CRGBA  c1
[inline]
 

Do the sum of 2 rgba, clamp, and store in this

Definition at line 201 of file rgba.h.

References A, B, G, min, R, r, uint, and uint8.

Referenced by addColors(), NL3D::CTextureEmboss::doGenerate(), and NL3D::CParticleSystemModel::traverseRender().

00202         {
00203                 uint    r,g,b,a;
00204                 r= c0.R + c1.R; r= std::min(r, 255U);   R= (uint8)r;
00205                 g= c0.G + c1.G; g= std::min(g, 255U);   G= (uint8)g;
00206                 b= c0.B + c1.B; b= std::min(b, 255U);   B= (uint8)b;
00207                 a= c0.A + c1.A; a= std::min(a, 255U);   A= (uint8)a;
00208         }

void NLMISC::CRGBA::addColors CRGBA dest,
const CRGBA src1,
const CRGBA src2,
uint  numColors,
uint  srcStride = sizeof(CRGBA),
uint  destStride = sizeof(CRGBA),
uint  dup = 1
[static]
 

Add a group of colors with saturation, using mmx instructions when present. dest The destination color buffer, encoded as CRGBA's. src1 The first source color buffer, encoded as CRGBA's. src2 The second source color buffer, encoded as CRGBA's. numColors The number of colors to compute Stride between each source color. Stride between each destination color. Dup the number of time the result must be duplicated in the destination.

Definition at line 79 of file rgba.cpp.

References add(), offset, sub(), uint, and uint8.

Referenced by NL3D::Make4Private(), NL3D::MakeNPrivate(), and NL3D::MakePrivate().

00080 {
00081         if (numColors == 0) return;
00082         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00083         if (!CSystemInfo::hasMMX())
00084         #endif
00085         {   // unoptimized version
00086                 if (dup == 1)
00087                 {
00088                         while (numColors--)
00089                         {
00090                                 dest->add(*src1, *src2);
00091                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00092                                 src1 = (CRGBA *) ((uint8 *) src1 + srcStride);
00093                                 src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00094                         }
00095                 }
00096                 else
00097                 {
00098                         if (dup == 4) // optimisation for the 4 case
00099                         {
00100                                 while (numColors--)
00101                                 {
00102                                         dest->add(*src1, *src2);
00103                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00104                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00105                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00106                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00107                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00108                                         dest = (CRGBA *) ((uint8 *) dest + (destStride << 1));
00109 
00110                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00111                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00112                                 }
00113                         }
00114                         else
00115                         {
00116                                 while (numColors--)
00117                                 {
00118                                         dest->add(*src1, *src2);
00119 
00120                                         uint k = dup - 1;
00121                                         do
00122                                         {
00123                                                 * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00124                                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00125                                         }
00126                                         while (--k);
00127                                         
00128                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00129                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00130                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00131                                 }
00132                         }
00133                 }
00134         }
00135         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00136         else // optimized mmx version
00137         {       
00139                 if (dup == 1)
00140                 {
00141                         __asm
00142                         {
00143                                                 push        ebp                                         
00144                                                 mov                     edi, dest
00145                                                 mov                     esi, src1
00146                                                 mov                     ebx, src2
00147                                                 sub                     ebx, esi  ; offset to source 2
00148                                                 mov                     ecx, numColors
00149                                                 mov         edx, destStride
00150                                                 mov         ebp, srcStride
00151                                                 sub         edi, edx
00152                                 myLoop:                                                                                         
00153                                                 movd        mm0, [esi]
00154                                                 add         edi, edx
00155                                                 movd        mm1, [esi + ebx]
00156                                                 paddusb     mm0, mm1
00157                                                 movd        [edi], mm0
00158                                                 add         esi, ebp                                            
00159                                                 dec                     ecx
00160                                                 jne         myLoop                      
00161                                                 pop                     ebp
00162                                                 emms
00163                         }
00164                 }
00165                 else
00166                 {
00167                         if (dup == 4)
00168                         {
00169                                 __asm
00170                                 {
00171                                                         push        ebp
00172                                                         mov                     edi, dest
00173                                                         mov                     esi, src1
00174                                                         mov                     ebx, src2
00175                                                         sub                     ebx, esi  ; offset to source 2
00176                                                         mov                     ecx, numColors
00177                                                         mov         edx, destStride
00178                                                         mov         ebp, srcStride
00179                                         myLoop4:                                                        
00180                                                         movd        mm0, [esi]                                                  
00181                                                         movd        mm1, [esi + ebx]
00182                                                         paddusb     mm0, mm1
00183                                                         movd        eax, mm0
00184                                                         
00185                                                         mov         [edi], eax                  
00186                                                         mov         [edi + edx], eax
00187                                                         mov         [edi + 2 * edx], eax
00188                                                         lea         edi, [edi + edx * 2]
00189                                                         mov         [edi + edx], eax
00190                                                         lea         edi, [edi + edx * 2]                                                
00191                                                         add         esi, ebp
00192 
00193                                                         dec         ecx
00194                                                         jne         myLoop4                                     
00195                                                         pop                     ebp
00196                                                         emms
00197                                 }
00198                         }
00199                         else
00200                         {
00201                                 __asm
00202                                 {                                                   
00203                                                         push        ebp
00204                                                         mov                     edi, dest
00205                                                         mov                     esi, src1
00206                                                         mov                     ebx, src2
00207                                                         sub                     ebx, esi  ; offset to source 2
00208                                                         mov                     ecx, numColors
00209                                                         mov         edx, destStride
00210                                                         mov         eax, dup
00211                                                         mov         ebp, srcStride
00212                                                         push        eax
00213                                         myLoopN:                                                                                                
00214                                                         movd        mm0, [esi]                                                  
00215                                                         movd        mm1, [esi + ebx]
00216                                                         push        ecx
00217                                                         paddusb     mm0, mm1
00218                                                         mov         ecx, 4[esp]
00219                                                         movd        eax, mm0
00220                                         dupLoopN:
00221                                                         mov         [edi], eax
00222                                                         dec         ecx
00223                                                         lea         edi, [edi + edx]
00224                                                         jne                 dupLoopN
00225                                                         pop         ecx                 ; get back the loop counter                                                     
00226                                                         add         esi, ebp 
00227                                                         dec         ecx
00228                                                         jne         myLoopN                                     
00229                                                         pop eax
00230                                                         pop     ebp
00231                                                         emms
00232                                 }
00233                         }
00234                 }
00235         }
00236         #endif
00237 }

void NLMISC::CRGBA::addRGBOnly CRGBA  c0,
CRGBA  c1
[inline]
 

see add()

Definition at line 264 of file rgba.h.

References B, G, min, R, r, uint, and uint8.

Referenced by NL3D::CPatchDLMContext::addPointLightInfluence(), NL3D::CRenderTrav::changeLightSetup(), NL3D::CLightContribution::computeCurrentAmbient(), NL3D::computeVegetVertexLighting(), NL3D::computeVegetVertexLightingForceBestSided(), NL3D::CMeshMultiLodInstance::getCoarseMeshLighting(), and NL3D_expandLightmap().

00265         {
00266                 uint    r,g,b;
00267                 r= c0.R + c1.R; r= std::min(r, 255U);   R= (uint8)r;
00268                 g= c0.G + c1.G; g= std::min(g, 255U);   G= (uint8)g;
00269                 b= c0.B + c1.B; b= std::min(b, 255U);   B= (uint8)b;
00270         }

void NLMISC::CRGBA::avg2 CRGBA  a,
CRGBA  b
[inline]
 

Compute in this the average of 2 RGBA.

Definition at line 178 of file rgba.h.

References A, B, G, R, and uint.

00179         {
00180                 R= ((uint)a.R+(uint)b.R)>>1;
00181                 G= ((uint)a.G+(uint)b.G)>>1;
00182                 B= ((uint)a.B+(uint)b.B)>>1;
00183                 A= ((uint)a.A+(uint)b.A)>>1;
00184         }

void NLMISC::CRGBA::avg2RGBOnly CRGBA  a,
CRGBA  b
[inline]
 

see avg2()

Definition at line 250 of file rgba.h.

References B, G, R, and uint.

Referenced by NL3D::CPatch::getCurrentTileTLIColors().

00251         {
00252                 R= ((uint)a.R+(uint)b.R)>>1;
00253                 G= ((uint)a.G+(uint)b.G)>>1;
00254                 B= ((uint)a.B+(uint)b.B)>>1;
00255         }

void NLMISC::CRGBA::avg4 CRGBA  a,
CRGBA  b,
CRGBA  c,
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 190 of file rgba.h.

References A, B, G, R, and uint.

00191         {
00192                 R= ((uint)a.R+(uint)b.R+(uint)c.R+(uint)d.R+ 1)>>2;
00193                 G= ((uint)a.G+(uint)b.G+(uint)c.G+(uint)d.G+ 1)>>2;
00194                 B= ((uint)a.B+(uint)b.B+(uint)c.B+(uint)d.B+ 1)>>2;
00195                 A= ((uint)a.A+(uint)b.A+(uint)c.A+(uint)d.A+ 1)>>2;
00196         }

void NLMISC::CRGBA::avg4RGBOnly CRGBA  a,
CRGBA  b,
CRGBA  c,
CRGBA  d
[inline]
 

see avg4()

Definition at line 257 of file rgba.h.

References B, G, R, and uint.

00258         {
00259                 R= ((uint)a.R+(uint)b.R+(uint)c.R+(uint)d.R+ 1)>>2;
00260                 G= ((uint)a.G+(uint)b.G+(uint)c.G+(uint)d.G+ 1)>>2;
00261                 B= ((uint)a.B+(uint)b.B+(uint)c.B+(uint)d.B+ 1)>>2;
00262         }

void NLMISC::CRGBA::blendFromui CRGBA  c0,
CRGBA  c1,
uint  coef
[inline]
 

Blend two colors.

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

Definition at line 104 of file rgba.h.

References A, B, G, R, and uint.

Referenced by NL3D::CMeshMRMGeom::applyGeomorphWithVBHardPtr(), NL3D::CHLSColorTexture::compressBlockRGB(), NLMISC::CBitmap::decompressDXT1(), NLMISC::CBitmap::decompressDXT3(), NLMISC::CBitmap::decompressDXT5(), NLMISC::CBitmap::getDXTCColorFromBlock(), NL3D_expandLightmap(), NL3D::PSValueBlend(), and NL3D::CHLSColorTexture::uncompressBlockRGB().

00105         {
00106                 uint    a1 = coef;
00107                 uint    a2 = 256-a1;
00108                 R = (c0.R*a2 + c1.R*a1) >>8;
00109                 G = (c0.G*a2 + c1.G*a1) >>8;
00110                 B = (c0.B*a2 + c1.B*a1) >>8;
00111                 A = (c0.A*a2 + c1.A*a1) >>8;
00112         }

void NLMISC::CRGBA::blendFromuiRGBOnly CRGBA  c0,
CRGBA  c1,
uint  coef
[inline]
 

see blendFromui()

Definition at line 227 of file rgba.h.

References B, G, R, and uint.

Referenced by NL3D::CPatchDLMContext::blendTileToTexture(), NL3D::CHLSColorTexture::buildColorVersion(), and NL3D::CFastHLSModifier::convert().

00228         {
00229                 uint    a1 = coef;
00230                 uint    a2 = 256-a1;
00231                 R = (c0.R*a2 + c1.R*a1) >>8;
00232                 G = (c0.G*a2 + c1.G*a1) >>8;
00233                 B = (c0.B*a2 + c1.B*a1) >>8;
00234         }

void NLMISC::CRGBA::buildFromHLS float  h,
float  l,
float  s
 

Build from HLS valued Each component ranges from 0 to 1.f

Definition at line 686 of file rgba.cpp.

References NLMISC::clamp(), NLMISC::HLSValue(), s, uint8, and v.

Referenced by NL3D::CFastHLSModifier::CFastHLSModifier().

00687 {
00688         clamp(l, 0, 1);
00689         clamp(s, 0, 1);
00690 
00691         float v2 = (l <= 0.5f) ? (l * (1 + s)) : (l + s - l * s);
00692         float v1 = 2.f * l - v2;
00693 
00694         if (s == 0) // achromatic ?
00695         {
00696                 R = G = B = (uint8) (255.f * l);
00697         }
00698         else // chromatic case
00699         {
00700                 float v;
00701                 //
00702                 v = HLSValue(h + 120.f, v1, v2);
00703                 clamp(v, 0.f, 1.f);
00704                 R = (uint8) (255.f * v);
00705                 //
00706                 v = HLSValue(h, v1, v2);
00707                 clamp(v, 0.f, 1.f);
00708                 G = (uint8) (255.f * v);
00709                 //
00710                 v = HLSValue(h - 120.f, v1, v2);
00711                 clamp(v, 0.f, 1.f);
00712                 B = (uint8) (255.f * v);        
00713         }
00714 }

bool NLMISC::CRGBA::convertToHLS float &  h,
float &  l,
float &  S
const
 

Convert to HLS color space. Lightness and satuation ranges from 0 to 1 There's no range for hue, (all hues colors range from 0 to 360, from 360 to 720 and so on)

Returns:
true if the color is achromatic

Definition at line 609 of file rgba.cpp.

References NLMISC::maxof(), NLMISC::minof(), r, and s.

Referenced by NL3D::CFastHLSModifier::CFastHLSModifier(), and NL3D::CFastHLSModifier::convertRGBABitmap().

00610 {
00611         float r = R / 255.f;
00612         float g = G / 255.f;
00613         float b = B / 255.f;
00614 
00615         float maxV = NLMISC::maxof(r, g, b);
00616         float minV = NLMISC::minof(r, g, b);
00617 
00619         l = 0.5f * (maxV + minV);
00620 
00622         if (minV == maxV)  // all composants are equals -> achromatique
00623         {
00624                 s = 0;          
00625                 return true;
00626         }
00627         float diff = maxV - minV;
00629         s  = l > 0.5f                                   ?   /*are we in the top of the double-hexcone ? */
00630                 diff / (2.f - maxV - minV)  :
00631                 diff / (maxV + minV);
00632 
00633         // Get hue
00634 
00635         if (maxV == r)
00636         {
00637                 h = (g - b) / diff;
00638         }
00639         else if (maxV == g)
00640         {
00641                 h = 2.f + (b - r) / diff;
00642         }
00643         else
00644         {
00645                 h = 4.f + (r - g) / diff;
00646         }
00647                  
00648         h *= 60.f; // scale to [0..360]
00649 
00650         if (h < 0.f) h += 360.f;
00651         
00652         return false;
00653 }

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

Get a 16 bits 565 pixel.

Definition at line 154 of file rgba.h.

References uint16.

Referenced by NL3D::CFastHLSModifier::applyHLSMod(), and NL3D::CPatch::setupColorsFromTileFlags().

00155         {
00156                 return ((uint16)(R&0xf8)<<8) | ((uint16)(G&0xfc)<<3) | (uint16)(B>>3);
00157         }

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

Return a packed pixel

Definition at line 75 of file rgba.h.

References uint.

Referenced by NL3D::CRenderTrav::changeVPLightSetupMaterial(), operator<(), and NL3D::CDriverGL::setupMaterial().

00075 {return ((uint)R<<24) + ((uint)G<<16) + ((uint)B<<8) + A;}

void NLMISC::CRGBA::modulateColors CRGBA dest,
const CRGBA src1,
const CRGBA src2,
uint  numColors,
uint  srcStride = sizeof(CRGBA),
uint  destStride = sizeof(CRGBA),
uint  dup = 1
[static]
 

Modulate a group of colors with saturation, using mmx instructions when present. dest The destination color buffer, encoded as CRGBA's. src1 The first source color buffer, encoded as CRGBA's. src2 The second source color buffer, encoded as CRGBA's. numColors The number of colors to compute Stride between each color. It is the same for sources and destination.

Definition at line 239 of file rgba.cpp.

References modulateFromColor(), offset, sub(), uint, uint64, and uint8.

Referenced by NL3D::CPSConstraintMesh::computeColors(), NL3D::Make4Private(), NL3D::MakeNPrivate(), and NL3D::MakePrivate().

00240 {
00241         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00242         if (!CSystemInfo::hasMMX())
00243         #endif
00244         {   // unoptimized version
00245                 if (dup == 1)
00246                 {
00247                         while (numColors--)
00248                         {
00249                                 dest->modulateFromColor(*src1, *src2);
00250                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00251                                 src1 = (CRGBA *) ((uint8 *) src1 + srcStride);
00252                                 src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00253                         }
00254                 }
00255                 else
00256                 {
00257                         if (dup == 4) // optimisation for the 4 case
00258                         {
00259                                 while (numColors--)
00260                                 {
00261                                         dest->modulateFromColor(*src1, *src2);
00262                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00263                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00264                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00265                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00266                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00267                                         dest = (CRGBA *) ((uint8 *) dest + (destStride << 1));
00268 
00269                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00270                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00271                                 }
00272                         }
00273                         else
00274                         {
00275                                 while (numColors--)
00276                                 {
00277                                         dest->modulateFromColor(*src1, *src2);
00278 
00279                                         uint k = dup - 1;
00280                                         do
00281                                         {
00282                                                 * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00283                                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00284                                         }
00285                                         while (--k);
00286                                         
00287                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00288                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00289                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00290                                 }
00291                         }
00292                 }
00293         }
00294         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00295         else // optimized mmx version
00296         {       
00297                 uint64 blank = 0;
00299                 if (dup == 1)
00300                 {       __asm
00301                         {
00302                                                 push        ebp
00303                                                 movq        mm2, blank
00304                                                 mov                     edi, dest
00305                                                 mov                     esi, src1
00306                                                 mov                     ebx, src2
00307                                                 sub                     ebx, esi  ; offset to source 2
00308                                                 mov                     ecx, numColors
00309                                                 mov         edx, destStride
00310                                                 mov         ebp, srcStride
00311                                 myLoop:                                                                                         
00312                                                 movd                    mm0, [esi]                                                                                              
00313                                                 movd                    mm1, [esi + ebx]
00314                                                 punpcklbw       mm0, mm2
00315                                                 punpcklbw       mm1, mm2                                                
00316                                                 pmullw          mm0, mm1
00317                                                 psrlw       mm0, 8
00318                                                 packuswb    mm0, mm0
00319                                                 movd        [edi], mm0                                          
00320                                                 add         edi, edx
00321                                                 add         esi, ebp 
00322 
00323                                                 dec         ecx
00324                                                 jne         myLoop                              
00325                                                 pop                     ebp
00326                                                 emms
00327                         }
00328                 }
00329                 else
00330                 {
00331                         if (dup == 4)                   
00332                         {
00333                                 
00334                                 __asm
00335                                 {
00336                                                         push        ebp
00337                                                         movq        mm2, blank
00338                                                         mov                     edi, dest
00339                                                         mov                     esi, src1
00340                                                         mov                     ebx, src2
00341                                                         sub                     ebx, esi  ; offset to source 2
00342                                                         mov                     ecx, numColors
00343                                                         mov         edx, destStride
00344                                                         mov         ebp, srcStride
00345                                         myLoop4:
00346                                                         movd            mm0, [esi]                                                                                              
00347                                                         movd            mm1, [esi + ebx]
00348                                                         punpcklbw       mm0, mm2
00349                                                         punpcklbw       mm1, mm2                                                
00350                                                         pmullw          mm0, mm1
00351                                                         psrlw       mm0, 8
00352                                                         packuswb    mm0, mm0
00353                                                         movd        eax, mm0
00354                                                         ; duplicate the result 4 times
00355                                                         mov         [edi], eax                  
00356                                                         mov         [edi + edx], eax
00357                                                         mov         [edi + 2 * edx], eax
00358                                                         lea         edi, [edi +  2 * edx]
00359                                                         mov         [edi + edx], eax
00360                                                         lea         edi, [edi + 2 * edx]
00361                                                         add         esi, ebp 
00362                                                         dec         ecx
00363                                                         jne         myLoop4                             
00364                                                         pop                     ebp
00365                                                         emms
00366                                 }
00367                         }
00368                         else
00369                         {
00370                                 __asm
00371                                 {
00372                                                         push        ebp
00373                                                         movq        mm2, blank
00374                                                         mov                     edi, dest
00375                                                         mov                     esi, src1
00376                                                         mov                     ebx, src2
00377                                                         sub                     ebx, esi  ; offset to source 2
00378                                                         mov                     ecx, numColors
00379                                                         mov         edx, destStride
00380                                                         mov         eax, dup
00381                                                         mov         ebp, srcStride
00382                                                         push        eax
00383                                         myLoopN:
00384                                                         movd            mm0, [esi]                                                                                              
00385                                                         movd            mm1, [esi + ebx]
00386                                                         punpcklbw       mm0, mm2
00387                                                         punpcklbw       mm1, mm2                                                
00388                                                         pmullw          mm0, mm1
00389                                                         push        ecx
00390                                                         psrlw       mm0, 8
00391                                                         mov         ecx, 4[esp] 
00392                                                         packuswb    mm0, mm0
00393                                                         movd        eax, mm0
00394                                         dupLoopN:
00395                                                         mov         [edi], eax
00396                                                         dec         ecx
00397                                                         lea         edi, [edi + edx]
00398                                                         jne                 dupLoopN
00399                                                         pop         ecx                 ; get back the loop counter
00400                                                         add         esi, ebp
00401                                                         dec         ecx
00402                                                         jne         myLoopN                                     
00403                                                         pop eax
00404                                                         pop                     ebp
00405                                                         emms
00406                                 }
00407                         }
00408                 }
00409         }
00410         #endif
00411 }

void NLMISC::CRGBA::modulateFromColor CRGBA  c0,
CRGBA  c1
[inline]
 

Modulate colors with another color.

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

Definition at line 133 of file rgba.h.

References A, B, G, and R.

Referenced by NL3D::CPSShockWave::draw(), NL3D::CPSDot::draw(), NL3D::CZoneLighter::lightWater(), modulateColors(), NL3D::PSBinOpModulate(), NL3D::CPointLightNamed::setLightFactor(), NL3D::CPSTailDot::setupGlobalColor(), NL3D::CPSFanLight::setupMaterial(), NL3D::CPSRibbon::setupTexturedGlobalColor(), NL3D::CPSRibbon::setupUntexturedGlobalColor(), NL3D::CPSLight::step(), NL3D::CParticleSystem::updateColor(), and NL3D::CPSQuad::updateMatBeforeRendering().

00134         {
00135                 R = (c0.R*c1.R) >>8;
00136                 G = (c0.G*c1.G) >>8;
00137                 B = (c0.B*c1.B) >>8;
00138                 A = (c0.A*c1.A) >>8;
00139         }

void NLMISC::CRGBA::modulateFromColorRGBOnly CRGBA  c0,
CRGBA  c1
[inline]
 

see modulateFromColor()

Definition at line 243 of file rgba.h.

References B, G, and R.

Referenced by NL3D::CVegetableManager::addInstance(), NL3D_expandLightmap(), and NL3D::CVegetableManager::updateInstanceLighting().

00244         {
00245                 R = (c0.R*c1.R) >>8;
00246                 G = (c0.G*c1.G) >>8;
00247                 B = (c0.B*c1.B) >>8;
00248         }

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

Modulate colors with a constant.

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

Definition at line 119 of file rgba.h.

References A, B, G, R, and uint.

Referenced by NL3D::CVegetableLightEx::computeCurrentColors(), NL3D::CTextureEmboss::doGenerate(), NL3D::CParticleSystemModel::traverseRender(), and NL3D::CFlareModel::traverseRender().

00120         {
00121                 R = (c0.R*a) >>8;
00122                 G = (c0.G*a) >>8;
00123                 B = (c0.B*a) >>8;
00124                 A = (c0.A*a) >>8;
00125         }

void NLMISC::CRGBA::modulateFromuiRGBOnly CRGBA  c0,
uint  a
[inline]
 

see modulateFromui()

Definition at line 236 of file rgba.h.

References B, G, R, and uint.

Referenced by NL3D::CRenderTrav::changeLightSetup(), NL3D::CLightContribution::computeCurrentAmbient(), NL3D::computeVegetVertexLighting(), NL3D::computeVegetVertexLightingForceBestSided(), NL3D::CFastHLSModifier::convert(), NL3D::CMeshMultiLodInstance::getCoarseMeshLighting(), NL3D::CSkeletonModel::renderCLod(), NL3D::CPointLight::setupDriverLight(), and NL3D::CPointLight::setupDriverLightUserAttenuation().

00237         {
00238                 R = (c0.R*a) >>8;
00239                 G = (c0.G*a) >>8;
00240                 B = (c0.B*a) >>8;
00241         }

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

Comparison operator.

Definition at line 84 of file rgba.h.

00084 {return !(*this==c);}

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

Comparison operator.

Definition at line 80 of file rgba.h.

References getPacked().

00080 {return getPacked()<c.getPacked();}

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

Equality operator.

Definition at line 89 of file rgba.h.

References A, B, G, and R.

00090                 {return R==c.R && G==c.G && B==c.B && A==c.A;}

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

Serialisation.

Parameters:
f Stream used for serialisation.

Definition at line 58 of file rgba.cpp.

00059 {
00060         f.serial (R);
00061         f.serial (G);
00062         f.serial (B);
00063         f.serial (A);
00064 }

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 66 of file rgba.cpp.

References r, and uint8.

Referenced by NL3D::CIGSurfaceLightBuild::buildPLDebugMesh(), NL3D::CMesh::CCorner::CCorner(), NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CLandscape::CLandscape(), NL3D::CMaterial::CLightMap::CLightMap(), NL3D::CMaterial::CMaterial(), NL3D::CLightingManager::computeModelLightContributions(), NL3D::CTransform::CTransform(), NL3D::CVegetableManager::CVegetableManager(), NLMISC::CBitmap::decompressDXT1(), NLMISC::CBitmap::getDXTCColorFromBlock(), NL3D::CVisualCollisionEntity::getStaticLightSetup(), NL3D::CIGSurfaceLight::getStaticLightSetup(), NLMISC::CBitmap::makeDummy(), NL3D::CRenderTrav::resetLightSetup(), NL3D::CMaterial::CTexEnv::setDefault(), NL3D::CDriverGL::setDisplay(), and NL3D::CDriverGL::swapBuffers().

00067 {
00068         R = r;
00069         G = g;
00070         B = b;
00071         A = a;
00072 }

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

Set the RGB fields with a 16 bits 565 pixel.

Definition at line 162 of file rgba.h.

References uint16.

Referenced by NL3D::CFastHLSModifier::CFastHLSModifier(), NL3D::CHLSColorTexture::compressBlockRGB(), NL3D::CPatch::getTileTileColors(), NL3D_expandLightmap(), and NL3D::CHLSColorTexture::uncompressBlockRGB().

00163         {
00164                 // unpack.
00165                 R= col>>11;
00166                 G= (col>>5)&0x3F;
00167                 B= (col)&0x1F;
00168                 // to 8 bits.
00169                 R= (R<<3) + (R>>2);
00170                 G= (G<<2) + (G>>4);
00171                 B= (B<<3) + (B>>2);
00172         }

void NLMISC::CRGBA::setPacked uint  packed  )  [inline]
 

setup as a packed pixel

Definition at line 64 of file rgba.h.

References uint.

00065         {
00066                 R= (packed>>24)&255;
00067                 G= (packed>>16)&255;
00068                 B= (packed>>8)&255;
00069                 A= packed & 255;
00070         }

void NLMISC::CRGBA::sub CRGBA  c0,
CRGBA  c1
[inline]
 

Compute c0 - c1, and store in this

Definition at line 213 of file rgba.h.

References A, B, G, R, r, sint, and uint8.

Referenced by addColors(), modulateColors(), and subtractColors().

00214         {
00215                 sint    r,g,b,a;
00216                 r= c0.R - c1.R; r= std::max(r, 0);      R= (uint8)r;
00217                 g= c0.G - c1.G; g= std::max(g, 0);      G= (uint8)g;
00218                 b= c0.B - c1.B; b= std::max(b, 0);      B= (uint8)b;
00219                 a= c0.A - c1.A; a= std::max(a, 0);      A= (uint8)a;
00220         }

void NLMISC::CRGBA::subRGBOnly CRGBA  c0,
CRGBA  c1
[inline]
 

see sub()

Definition at line 272 of file rgba.h.

References B, G, R, r, sint, and uint8.

00273         {
00274                 sint    r,g,b;
00275                 r= c0.R - c1.R; r= std::max(r, 0);      R= (uint8)r;
00276                 g= c0.G - c1.G; g= std::max(g, 0);      G= (uint8)g;
00277                 b= c0.B - c1.B; b= std::max(b, 0);      B= (uint8)b;
00278         }

void NLMISC::CRGBA::subtractColors CRGBA dest,
const CRGBA src1,
const CRGBA src2,
uint  numColors,
uint  srcStride = sizeof(CRGBA),
uint  destStride = sizeof(CRGBA),
uint  dup = 1
[static]
 

Subtract a group of colors with saturation (src1 - src2), using mmx instructions when present. dest The destination color buffer, encoded as CRGBA's. src1 The first source color buffer, encoded as CRGBA's. src2 The second source color buffer, encoded as CRGBA's. numColors The number of colors to compute Stride between each color. It is the same for sources and destination.

Definition at line 413 of file rgba.cpp.

References offset, sub(), uint, and uint8.

Referenced by NL3D::Make4Private(), NL3D::MakeNPrivate(), and NL3D::MakePrivate().

00414 {
00415         if (numColors == 0) return;
00416         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00417         if (!CSystemInfo::hasMMX())
00418         #endif
00419         {   // unoptimized version
00420                 if (dup == 1)
00421                 {
00422                         while (numColors--)
00423                         {
00424                                 dest->sub(*src1, *src2);
00425                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00426                                 src1 = (CRGBA *) ((uint8 *) src1 + srcStride);
00427                                 src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00428                         }
00429                 }
00430                 else
00431                 {
00432                         if (dup == 4) // optimisation for the 4 case
00433                         {
00434                                 while (numColors--)
00435                                 {
00436                                         dest->sub(*src1, *src2);
00437                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00438                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00439                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00440                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00441                                         * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00442                                         dest = (CRGBA *) ((uint8 *) dest + (destStride << 1));
00443 
00444                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00445                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00446                                 }
00447                         }
00448                         else
00449                         {
00450                                 while (numColors--)
00451                                 {
00452                                         dest->sub(*src1, *src2);
00453 
00454                                         uint k = dup - 1;
00455                                         do
00456                                         {
00457                                                 * (CRGBA *) ((uint8 *) dest + destStride) = *dest;
00458                                                 dest = (CRGBA *) ((uint8 *) dest + destStride);
00459                                         }
00460                                         while (--k);
00461                                         
00462                                         dest = (CRGBA *) ((uint8 *) dest + destStride);
00463                                         src1 = (CRGBA *) ((uint8 *) src1 + srcStride);                                                                                                  
00464                                         src2 = (CRGBA *) ((uint8 *) src2 + srcStride);
00465                                 }
00466                         }
00467                 }
00468         }
00469         #if     defined(NL_OS_WINDOWS) && !defined(DISABLE_MMX_OPTIM)
00470         else // optimized mmx version
00471         {       
00473                 if (dup == 1)
00474                 {
00475                         __asm
00476                         {
00477                                                 push        ebp                                         
00478                                                 mov                     edi, dest
00479                                                 mov                     esi, src1
00480                                                 mov                     ebx, src2
00481                                                 sub                     ebx, esi  ; offset to source 2
00482                                                 mov                     ecx, numColors
00483                                                 mov         edx, destStride
00484                                                 mov         ebp, srcStride
00485                                                 sub         edi, edx
00486                                 myLoop:                                                                                         
00487                                                 movd        mm0, [esi]
00488                                                 add         edi, edx
00489                                                 movd        mm1, [esi + ebx]
00490                                                 psubusb     mm0, mm1
00491                                                 movd        [edi], mm0
00492                                                 add         esi, ebp                                            
00493                                                 dec                     ecx
00494                                                 jne         myLoop                      
00495                                                 pop                     ebp
00496                                                 emms
00497                         }
00498                 }
00499                 else
00500                 {
00501                         if (dup == 4)
00502                         {
00503                                 __asm
00504                                 {
00505                                                         push        ebp
00506                                                         mov                     edi, dest
00507                                                         mov                     esi, src1
00508                                                         mov                     ebx, src2
00509                                                         sub                     ebx, esi  ; offset to source 2
00510                                                         mov                     ecx, numColors
00511                                                         mov         edx, destStride
00512                                                         mov         ebp, srcStride
00513                                         myLoop4:                                                        
00514                                                         movd        mm0, [esi]                                                  
00515                                                         movd        mm1, [esi + ebx]
00516                                                         psubusb     mm0, mm1
00517                                                         movd        eax, mm0
00518                                                         
00519                                                         mov         [edi], eax                  
00520                                                         mov         [edi + edx], eax
00521                                                         mov         [edi + 2 * edx], eax
00522                                                         lea         edi, [edi + edx * 2]
00523                                                         mov         [edi + edx], eax
00524                                                         lea         edi, [edi + edx * 2]                                                
00525                                                         add         esi, ebp
00526 
00527                                                         dec         ecx
00528                                                         jne         myLoop4
00529                                                         pop                     ebp
00530                                                         emms
00531                                 }
00532                         }
00533                         else
00534                         {
00535                                 __asm
00536                                 {
00537                                                         push        ebp
00538                                                         mov                     edi, dest
00539                                                         mov                     esi, src1
00540                                                         mov                     ebx, src2
00541                                                         sub                     ebx, esi  ; offset to source 2
00542                                                         mov                     ecx, numColors
00543                                                         mov         edx, destStride
00544                                                         mov         eax, dup
00545                                                         mov         ebp, srcStride
00546                                                         push        eax
00547                                         myLoopN:                                                                                                
00548                                                         movd        mm0, [esi]                                                  
00549                                                         movd        mm1, [esi + ebx]
00550                                                         push        ecx
00551                                                         psubusb     mm0, mm1
00552                                                         mov         ecx, 4[esp]
00553                                                         movd        eax, mm0
00554                                         dupLoopN:
00555                                                         mov         [edi], eax
00556                                                         dec         ecx
00557                                                         lea         edi, [edi + edx]
00558                                                         jne                 dupLoopN
00559                                                         pop         ecx                 ; get back the loop counter                                                     
00560                                                         add         esi, ebp 
00561                                                         dec         ecx
00562                                                         jne         myLoopN                                     
00563                                                         pop eax
00564                                                         pop     ebp
00565                                                         emms
00566                                 }
00567                         }
00568                 }
00569         }
00570         #endif
00571 }


Field Documentation

uint8 NLMISC::CRGBA::A
 

Alpha componant.

Definition at line 340 of file rgba.h.

Referenced by add(), NL3D::CVegetableManager::addInstance(), NL3D::CLodCharacterManager::addRenderCharacterKey(), NL3D::CLodCharacterManager::addTextureCompute(), NL3D::CCloudScape::anim(), NL3D::CMRMBuilder::attToColor(), avg2(), avg4(), blendFromui(), NL3D::CTextureFile::buildBitmapFromFile(), NL3D::CMRMBuilder::buildBlendShapes(), NLMISC::CBitmap::buildMipMaps(), NLMISC::CBGRA::CBGRA(), NL3D::CRenderTrav::changeLightSetup(), NL3D::CDriverGL::clear2D(), NL3D::CHLSColorTexture::compressBlockRGB(), NL3D::CLightContribution::computeCurrentAmbient(), NL3D::CPatch::computeGeomorphAlphaFar1VertexListVB(), NL3D::computeVegetVertexLighting(), NL3D::computeVegetVertexLightingForceBestSided(), NL3D::convColor(), NL3D::CMaterialBase::copyFromMaterial(), NL3D::copyToValue(), NLMISC::CRGBAF::CRGBAF(), NLMISC::CBitmap::decompressDXT1(), NL3D::CTextureEmboss::doGenerate(), NL3D::CLodCharacterManager::endTextureCompute(), NL3D::CMRMBuilder::findInsertColorInBaseMesh(), NL3D::CDriverGL::forceActivateTexEnvColor(), NL3D::CMeshMultiLodInstance::getCoarseMeshLighting(), NLMISC::CBitmap::getDXTC3Texel(), NLMISC::CBitmap::getDXTC5Texel(), NLMISC::CBitmap::getDXTCColorFromBlock(), NL3D::CDriverGL::getFogColor(), NL3D::CMaterial::getOpacity(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NL3D::CCloud::light(), modulateFromColor(), modulateFromui(), NL3D_drawFarTileInFarTextureAdditiveAlpha(), NL3D_drawFarTileInFarTextureAlpha(), operator==(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CTextContext::printAt(), NL3D::CTextContext::printClipAt(), NL3D::CTextContext::printClipAtUnProjected(), NL3D::CTextContext::printfAt(), NL3D::CMaterial::setOpacity(), NL3D::CTileFarBank::CTileFar::setPixels(), NL3D::CDriverGL::setupFog(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverGL::setupMaterial(), NL3D::CLandscape::setupStaticLight(), NL3D::CDriverGLStates::setVertexColorLighted(), sub(), NL3D::CAnimatedMaterial::update(), NL3D::CVegetableManager::updateInstanceLighting(), and NLLIGO::IPrimitive::write().

uint8 NLMISC::CRGBA::B
 

Blue componant.

Definition at line 338 of file rgba.h.

Referenced by add(), NL3D::CVegetableManager::addInstance(), NL3D::CPatchDLMContext::addPointLightInfluence(), addRGBOnly(), NL3D::CCloudScape::anim(), NL3D::CMRMBuilder::attToColor(), avg2(), avg2RGBOnly(), avg4(), avg4RGBOnly(), blendFromui(), blendFromuiRGBOnly(), NL3D::CTextureFile::buildBitmapFromFile(), NL3D::CMRMBuilder::buildBlendShapes(), NLMISC::CBitmap::buildMipMaps(), NLMISC::CBGRA::CBGRA(), NL3D::CDriverGL::clear2D(), NL3D::CPatchDLMPointLight::compile(), NL3D::CHLSColorTexture::compressBlockRGB(), NL3D::CPatch::computeCurrentTLILightmapDiv2(), NL3D::computeLodLighting(), NL3D::CLightingManager::computeModelLightContributions(), NL3D::CShadowMapManager::computeShadowColors(), NL3D::CShadowMapManager::computeShadowDirection(), NL3D::convColor(), NLGEORGES::CFormElm::convertValue(), NL3D::copyToValue(), NLMISC::CRGBAF::CRGBAF(), NL3D::CMRMBuilder::findInsertColorInBaseMesh(), NL3D::CDriverGL::forceActivateTexEnvColor(), NL3D::CDriverGL::getFogColor(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NL3D::CTextureDLM::modulateAndfillRect565(), NL3D::CTextureDLM::modulateAndfillRect8888(), NL3D::CTextureDLM::modulateConstantAndfillRect(), modulateFromColor(), modulateFromColorRGBOnly(), modulateFromui(), modulateFromuiRGBOnly(), NL3D_drawFarTileInFarTexture(), NL3D_drawFarTileInFarTextureAdditive(), NL3D_drawFarTileInFarTextureAdditiveAlpha(), NL3D_drawFarTileInFarTextureAlpha(), NL3D_expandLightmap(), operator==(), NL3D::PSBinOpAdd(), NL3D::PSBinOpSubtract(), NL3D::CLandscape::render(), NL3D::CSkeletonModel::renderCLod(), NL3D::CShadowMapManager::renderProject(), NL3D::CDriverGL::setAmbientColor(), NL3D::CMaterial::setDiffuse(), NL3D::CDriverGL::setLight(), NL3D::CDriverGL::setupFog(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverGL::setupMaterial(), NL3D::CLandscape::setupStaticLight(), NL3D::CDriverGLStates::setVertexColorLighted(), sub(), subRGBOnly(), and NLLIGO::IPrimitive::write().

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

some colors

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

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

uint8 NLMISC::CRGBA::G
 

Green componant.

Definition at line 336 of file rgba.h.

Referenced by add(), NL3D::CVegetableManager::addInstance(), NL3D::CPatchDLMContext::addPointLightInfluence(), addRGBOnly(), NL3D::CCloudScape::anim(), NL3D::CMRMBuilder::attToColor(), avg2(), avg2RGBOnly(), avg4(), avg4RGBOnly(), blendFromui(), blendFromuiRGBOnly(), NL3D::CTextureFile::buildBitmapFromFile(), NL3D::CMRMBuilder::buildBlendShapes(), NLMISC::CBitmap::buildMipMaps(), NL3D::CIGSurfaceLightBuild::buildPLDebugMesh(), NLMISC::CBGRA::CBGRA(), NL3D::CDriverGL::clear2D(), NL3D::CPatchDLMPointLight::compile(), NL3D::CHLSColorTexture::compressBlockRGB(), NL3D::CPatch::computeCurrentTLILightmapDiv2(), NL3D::computeLodLighting(), NL3D::CLightingManager::computeModelLightContributions(), NL3D::CShadowMapManager::computeShadowColors(), NL3D::CShadowMapManager::computeShadowDirection(), NL3D::convColor(), NLGEORGES::CFormElm::convertValue(), NL3D::copyToValue(), NLMISC::CRGBAF::CRGBAF(), NL3D::CMRMBuilder::findInsertColorInBaseMesh(), NL3D::CDriverGL::forceActivateTexEnvColor(), NL3D::CDriverGL::getFogColor(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NL3D::CTextureDLM::modulateAndfillRect565(), NL3D::CTextureDLM::modulateAndfillRect8888(), NL3D::CTextureDLM::modulateConstantAndfillRect(), modulateFromColor(), modulateFromColorRGBOnly(), modulateFromui(), modulateFromuiRGBOnly(), NL3D_drawFarTileInFarTexture(), NL3D_drawFarTileInFarTextureAdditive(), NL3D_drawFarTileInFarTextureAdditiveAlpha(), NL3D_drawFarTileInFarTextureAlpha(), NL3D_expandLightmap(), operator==(), NL3D::PSBinOpAdd(), NL3D::PSBinOpSubtract(), NL3D::CLandscape::render(), NL3D::CSkeletonModel::renderCLod(), NL3D::CShadowMapManager::renderProject(), NL3D::CDriverGL::setAmbientColor(), NL3D::CMaterial::setDiffuse(), NL3D::CDriverGL::setLight(), NL3D::CDriverGL::setupFog(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverGL::setupMaterial(), NL3D::CLandscape::setupStaticLight(), NL3D::CDriverGLStates::setVertexColorLighted(), sub(), subRGBOnly(), and NLLIGO::IPrimitive::write().

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

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

uint8 NLMISC::CRGBA::R
 

Red componant.

Definition at line 334 of file rgba.h.

Referenced by add(), NL3D::CVegetableManager::addInstance(), NL3D::CPatchDLMContext::addPointLightInfluence(), addRGBOnly(), NL3D::CCloudScape::anim(), NL3D::CMRMBuilder::attToColor(), avg2(), avg2RGBOnly(), avg4(), avg4RGBOnly(), NL3D::bilinearColor(), blendFromui(), blendFromuiRGBOnly(), NL3D::CVegetableShape::build(), NL3D::CTextureFile::buildBitmapFromFile(), NL3D::CMRMBuilder::buildBlendShapes(), NLMISC::CBitmap::buildMipMaps(), NL3D::CIGSurfaceLightBuild::buildPLDebugMesh(), NLMISC::CBGRA::CBGRA(), NL3D::CDriverGL::clear2D(), NL3D::CPatchDLMPointLight::compile(), NL3D::CHLSColorTexture::compressBlockRGB(), NL3D::CPatch::computeCurrentTLILightmapDiv2(), NL3D::computeLodLighting(), NL3D::CLightingManager::computeModelLightContributions(), NL3D::CShadowMapManager::computeShadowColors(), NL3D::CShadowMapManager::computeShadowDirection(), NL3D::convColor(), NLGEORGES::CFormElm::convertValue(), NL3D::copyToValue(), NLMISC::CRGBAF::CRGBAF(), NLMISC::CBitmap::decompressDXT1(), NLMISC::CBitmap::decompressDXT3(), NLMISC::CBitmap::decompressDXT5(), NL3D::CTextureEmboss::doGenerate(), NL3D::CMRMBuilder::findInsertColorInBaseMesh(), NL3D::CDriverGL::forceActivateTexEnvColor(), NL3D::CDriverGL::getFogColor(), NL3D::CSurfaceLightGrid::getStaticLightSetup(), NL3D::CTextureDLM::modulateAndfillRect565(), NL3D::CTextureDLM::modulateAndfillRect8888(), NL3D::CTextureDLM::modulateConstantAndfillRect(), modulateFromColor(), modulateFromColorRGBOnly(), modulateFromui(), modulateFromuiRGBOnly(), NL3D_drawFarTileInFarTexture(), NL3D_drawFarTileInFarTextureAdditive(), NL3D_drawFarTileInFarTextureAdditiveAlpha(), NL3D_drawFarTileInFarTextureAlpha(), NL3D_expandLightmap(), operator==(), NL3D::PSBinOpAdd(), NL3D::PSBinOpSubtract(), NL3D::CLandscape::render(), NL3D::CSkeletonModel::renderCLod(), NL3D::CShadowMapManager::renderProject(), NL3D::CDriverGL::setAmbientColor(), NL3D::CMaterial::setDiffuse(), NL3D::CDriverGL::setLight(), NL3D::CDriverGL::setupFog(), NL3D::CDriverGL::setupLightMapPass(), NL3D::CDriverGL::setupMaterial(), NL3D::CLandscape::setupStaticLight(), NL3D::CDriverGLStates::setVertexColorLighted(), sub(), subRGBOnly(), and NLLIGO::IPrimitive::write().

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

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

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


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 13:32:09 2004 for NeL by doxygen 1.3.6