# 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  

NL3D::CFastHLSModifier Class Reference

Singleton. More...

#include <fasthls_modifier.h>

List of all members.

Public Methods

CRGBA convert (uint H, uint L, uint S)
 convert a HLS (0..255) to a RGBA. More...

void convertRGBABitmap (NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds)
 convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255). More...

void convertDDSBitmap (NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds)
 convert a DDS bitmap into another DDS, with HLS decal (0..255, -255..+255, -255..+255). More...

uint16 applyHLSMod (uint16 colorIn, uint8 dHue, uint dLum, uint dSat)
 convert a uint16 color into the uint16 with HLS decal. More...


Static Public Methods

CFastHLSModifier & getInstance ()
 get the singleton. More...


Private Types

enum  { HueTableSize = 256 }

Private Methods

 CFastHLSModifier ()
 Constructor. More...

void convertDDSBitmapDXTC1Or1A (NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, uint dLum, uint dSat)
void convertDDSBitmapDXTC3Or5 (NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, uint dLum, uint dSat)

Private Attributes

CRGBA _HueTable [HueTableSize]
CHLSA _Color16ToHLS [65536]

Static Private Attributes

CFastHLSModifier * _Instance = NULL


Detailed Description

Singleton.

allow to apply HLS coloring as fast as possible (MMX...).

Author:
Lionel Berenguier , Nevrax France
Date:
2002

Definition at line 49 of file fasthls_modifier.h.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
HueTableSize 

Definition at line 78 of file fasthls_modifier.h.


Constructor & Destructor Documentation

NL3D::CFastHLSModifier::CFastHLSModifier   [private]
 

Constructor.

Definition at line 47 of file fasthls_modifier.cpp.

References _Color16ToHLS, _HueTable, NL3D::CFastHLSModifier::CHLSA::A, NLMISC::clamp, NL3D::CFastHLSModifier::CHLSA::H, HueTableSize, NL3D::CFastHLSModifier::CHLSA::L, NLAISCRIPT::l, NL3D::CFastHLSModifier::CHLSA::S, and s.

Referenced by getInstance.


Member Function Documentation

uint16 NL3D::CFastHLSModifier::applyHLSMod uint16    colorIn,
uint8    dHue,
uint    dLum,
uint    dSat
 

convert a uint16 color into the uint16 with HLS decal.

WARNING: this code use MMX when possible, but doesn't call emms!!! It is User job to do it. dLum must be actually 0xFFFFFF00 + realDLum (where realDLum== -255..+255) dSat must be actually 0xFFFFFF00 + realDSat (where realDSat== -255..+255)

Definition at line 110 of file fasthls_modifier.cpp.

References _Color16ToHLS, convert, NL3D::CFastHLSModifier::CHLSA::H, offset, and v.

Referenced by convertDDSBitmapDXTC1Or1A, and convertDDSBitmapDXTC3Or5.

CRGBA NL3D::CFastHLSModifier::convert uint    H,
uint    L,
uint    S
 

convert a HLS (0..255) to a RGBA.

Definition at line 86 of file fasthls_modifier.cpp.

References _HueTable.

Referenced by applyHLSMod, and convertRGBABitmap.

void NL3D::CFastHLSModifier::convertDDSBitmap NLMISC::CBitmap   dst,
const NLMISC::CBitmap   src,
uint8    dh,
sint    dl,
sint    ds
 

convert a DDS bitmap into another DDS, with HLS decal (0..255, -255..+255, -255..+255).

Definition at line 393 of file fasthls_modifier.cpp.

References convertDDSBitmapDXTC1Or1A, convertDDSBitmapDXTC3Or5, nlassert, nlstop, and src.

void NL3D::CFastHLSModifier::convertDDSBitmapDXTC1Or1A NLMISC::CBitmap   dst,
const NLMISC::CBitmap   src,
uint8    dh,
uint    dLum,
uint    dSat
[private]
 

Definition at line 252 of file fasthls_modifier.cpp.

References applyHLSMod, id, and src.

Referenced by convertDDSBitmap.

void NL3D::CFastHLSModifier::convertDDSBitmapDXTC3Or5 NLMISC::CBitmap   dst,
const NLMISC::CBitmap   src,
uint8    dh,
uint    dLum,
uint    dSat
[private]
 

Definition at line 354 of file fasthls_modifier.cpp.

References applyHLSMod, and src.

Referenced by convertDDSBitmap.

void NL3D::CFastHLSModifier::convertRGBABitmap NLMISC::CBitmap   dst,
const NLMISC::CBitmap   src,
uint8    dh,
sint    dl,
sint    ds
 

convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255).

Definition at line 414 of file fasthls_modifier.cpp.

References NLMISC::clamp, convert, nlassert, NL3D::OptFastFloor, and src.

CFastHLSModifier & NL3D::CFastHLSModifier::getInstance   [static]
 

get the singleton.

Definition at line 77 of file fasthls_modifier.cpp.

References _Instance, and CFastHLSModifier.


Member Data Documentation

CHLSA NL3D::CFastHLSModifier::_Color16ToHLS[65536] [private]
 

Definition at line 85 of file fasthls_modifier.h.

Referenced by applyHLSMod, and CFastHLSModifier.

CRGBA NL3D::CFastHLSModifier::_HueTable[HueTableSize] [private]
 

Definition at line 84 of file fasthls_modifier.h.

Referenced by CFastHLSModifier, and convert.

CFastHLSModifier * NL3D::CFastHLSModifier::_Instance = NULL [static, private]
 

Definition at line 43 of file fasthls_modifier.cpp.

Referenced by getInstance.


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