PaletteOptimiser Class Reference

#include <gpalopt.h>

List of all members.

Public Types

enum  {
  AXIS = 0x21, AXIS2 = AXIS*AXIS, AXIS3 = AXIS*AXIS*AXIS, MAXCOLOURS = 0x100,
  RED = 0, GREEN = 1, BLUE = 2
}

Public Member Functions

 PaletteOptimiser ()
void Initialise ()
void AddStats (cpcRGBQUAD pBitmap, cUINT32 uSize)
void GenPalette (cUINT32 uMaxColours=0x100)
bool GetPalette (cpLOGPALETTE pPalette, cUINT32 MaxColours)
void AddSystemColours (cBOOL bAddSysClrs)
void UseBrowserPalette (cBOOL bUseBrwsrPal)
void UseBitmapColours (cBOOL bUseBtmpClrs)
void SnapToPrimaries (cUINT32 uSnap)
void SnapToBrowserPalette (cUINT32 uSnap)
void AddLockedColour (cBYTE red, cBYTE green, cBYTE blue)
void RemoveLockedColours ()
void SetFast (cBOOL bFast)

Protected Types

typedef const Stats cStats
typedef StatspStats
typedef const StatspcStats
typedef Stats *const cpStats
typedef const Stats *const cpcStats
typedef Stats ** ppStats
typedef const Stats ** ppcStats
typedef Stats **const cppStats
typedef const Clr cClr
typedef ClrpClr
typedef const ClrpcClr
typedef Clr *const cpClr
typedef const Clr *const cpcClr
typedef Clr ** ppClr
typedef const Clr ** ppcClr
typedef Clr **const cppClr
typedef const Box cBox
typedef BoxpBox
typedef const BoxpcBox
typedef Box *const cpBox
typedef const Box *const cpcBox
typedef Box ** ppBox
typedef const Box ** ppcBox
typedef Box **const cppBox
typedef const PalEntry cPalEntry
typedef PalEntrypPalEntry
typedef const PalEntrypcPalEntry
typedef PalEntry *const cpPalEntry
typedef const PalEntry *const cpcPalEntry
typedef PalEntry ** ppPalEntry
typedef const PalEntry ** ppcPalEntry
typedef PalEntry **const cppPalEntry

Protected Member Functions

double Snap (cpBox pCube, cDOUBLE halfW, cDOUBLE halfR, cDOUBLE halfG, cDOUBLE halfB)
double LCube (double Stats::*p, cUINT32 r, cUINT32 g, cUINT32 b) const
double Vol (cpcBox pCube, double Stats::*p) const
double Bottom (cpcBox pCube, cUINT32 dir, double Stats::*p) const
double Top (cpcBox pCube, cUINT32 dir, cUINT32 pos, double Stats::*p) const
double Var (cpcBox pCube) const
void Store (cUINT32 i, cpBox pCube)
void Moments3D ()
double Maximize (cpBox pCube, cUINT32 dir, cUINT32 first, cUINT32 last, cpBox pCube1, cpBox pCube2, cDOUBLE wholeW, cDOUBLE wholeR, cDOUBLE wholeG, cDOUBLE wholeB)
double Maximize (cpBox pCube, cUINT32 dir, cUINT32 first, cUINT32 last, cpBox pCube1, cpBox pCube2, cpBox pCube3, cDOUBLE wholeW, cDOUBLE wholeR, cDOUBLE wholeG, cDOUBLE wholeB)
bool Cut (cpBox pSet1, cpBox pSet2, cpDOUBLE pMax)
bool Cut (cpBox pSet1, cpBox pSet2, cpBox pSet3)

Static Protected Member Functions

static INT32 __cdecl SortFn (pcVOID elem1, pcVOID elem2)

Protected Attributes

bool m_bFast
bool m_bMoments
bool m_bAddSystemColours
bool m_bUseBrowserPalette
bool m_bUseBitmapColours
UINT32 m_uSnapToPrimaries
UINT32 m_uSnapToPrimaries2
UINT32 m_uSnapToBrowserPalette
UINT32 m_uSnapToBrowserPalette2
UINT32 m_uTotalColours
RGBQUAD m_aColours [MAXCOLOURS+1]
UINT32 m_aCount [MAXCOLOURS+1]
UINT32 m_uLockedColours
UINT32 m_uAllLockedColours
PALETTEENTRY m_aLockedColours [MAXCOLOURS]
UINT32 m_uPaletteEntries
PalEntry m_aPalette [3 *MAXCOLOURS]
Stats m_aStats [AXIS3]

Static Protected Attributes

static const BYTE aSnap [0x132]
static const UINT32 aBDist [0x100]
static const UINT32 aPDist [0x100]
static const UINT32 aSqrs [0x100]

Classes

struct  Box
struct  Clr
struct  PalEntry
struct  Stats


Detailed Description

Definition at line 136 of file gpalopt.h.


Member Typedef Documentation

typedef const Box PaletteOptimiser::cBox [protected]
 

Definition at line 318 of file gpalopt.h.

typedef const Clr PaletteOptimiser::cClr [protected]
 

Definition at line 317 of file gpalopt.h.

typedef const PalEntry PaletteOptimiser::cPalEntry [protected]
 

Definition at line 319 of file gpalopt.h.

typedef Box* const PaletteOptimiser::cpBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Box* const PaletteOptimiser::cpcBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Clr* const PaletteOptimiser::cpcClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef Clr* const PaletteOptimiser::cpClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef const PalEntry* const PaletteOptimiser::cpcPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef const Stats* const PaletteOptimiser::cpcStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef PalEntry* const PaletteOptimiser::cpPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef Box** const PaletteOptimiser::cppBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef Clr** const PaletteOptimiser::cppClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef PalEntry** const PaletteOptimiser::cppPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef Stats** const PaletteOptimiser::cppStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef Stats* const PaletteOptimiser::cpStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef const Stats PaletteOptimiser::cStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef Box* PaletteOptimiser::pBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Box* PaletteOptimiser::pcBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Clr* PaletteOptimiser::pcClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef Clr* PaletteOptimiser::pClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef const PalEntry* PaletteOptimiser::pcPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef const Stats* PaletteOptimiser::pcStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef PalEntry* PaletteOptimiser::pPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef Box** PaletteOptimiser::ppBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Box** PaletteOptimiser::ppcBox [protected]
 

Definition at line 319 of file gpalopt.h.

typedef const Clr** PaletteOptimiser::ppcClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef Clr** PaletteOptimiser::ppClr [protected]
 

Definition at line 318 of file gpalopt.h.

typedef const PalEntry** PaletteOptimiser::ppcPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef const Stats** PaletteOptimiser::ppcStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef PalEntry** PaletteOptimiser::ppPalEntry [protected]
 

Definition at line 320 of file gpalopt.h.

typedef Stats** PaletteOptimiser::ppStats [protected]
 

Definition at line 317 of file gpalopt.h.

typedef Stats* PaletteOptimiser::pStats [protected]
 

Definition at line 317 of file gpalopt.h.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
AXIS 
AXIS2 
AXIS3 
MAXCOLOURS 
RED 
GREEN 
BLUE 

Definition at line 279 of file gpalopt.h.

00279          {
00280         AXIS        = 0x21,
00281         AXIS2       = AXIS*AXIS,
00282         AXIS3       = AXIS*AXIS*AXIS,
00283 
00284         MAXCOLOURS  = 0x100,
00285 
00286         RED         = 0,
00287         GREEN       = 1,
00288         BLUE        = 2
00289     } ;


Constructor & Destructor Documentation

PaletteOptimiser::PaletteOptimiser  )  [inline]
 

Definition at line 142 of file gpalopt.h.

00142                        :
00143         m_bFast                 (false),
00144         m_bMoments              (false),
00145         m_bAddSystemColours     (false),
00146         m_bUseBrowserPalette    (false),
00147         m_bUseBitmapColours     (true),
00148         m_uSnapToPrimaries      (0),
00149         m_uSnapToBrowserPalette (0),
00150         m_uTotalColours         (0),
00151         m_uLockedColours        (0),
00152         m_uAllLockedColours     (0),
00153         m_uPaletteEntries       (0)
00154     {} ;


Member Function Documentation

void PaletteOptimiser::AddLockedColour cBYTE  red,
cBYTE  green,
cBYTE  blue
 

void PaletteOptimiser::AddStats cpcRGBQUAD  pBitmap,
cUINT32  uSize
 

void PaletteOptimiser::AddSystemColours cBOOL  bAddSysClrs  )  [inline]
 

Definition at line 223 of file gpalopt.h.

00223 { m_bAddSystemColours = bAddSysClrs ; } ;

double PaletteOptimiser::Bottom cpcBox  pCube,
cUINT32  dir,
double Stats::*  p
const [protected]
 

bool PaletteOptimiser::Cut cpBox  pSet1,
cpBox  pSet2,
cpBox  pSet3
[protected]
 

bool PaletteOptimiser::Cut cpBox  pSet1,
cpBox  pSet2,
cpDOUBLE  pMax
[protected]
 

void PaletteOptimiser::GenPalette cUINT32  uMaxColours = 0x100  ) 
 

bool PaletteOptimiser::GetPalette cpLOGPALETTE  pPalette,
cUINT32  MaxColours
 

void PaletteOptimiser::Initialise  ) 
 

double PaletteOptimiser::LCube double Stats::*  p,
cUINT32  r,
cUINT32  g,
cUINT32  b
const [inline, protected]
 

Definition at line 346 of file gpalopt.h.

00346 { return m_aStats[(r*AXIS+g)*AXIS+b].*p ; }

double PaletteOptimiser::Maximize cpBox  pCube,
cUINT32  dir,
cUINT32  first,
cUINT32  last,
cpBox  pCube1,
cpBox  pCube2,
cpBox  pCube3,
cDOUBLE  wholeW,
cDOUBLE  wholeR,
cDOUBLE  wholeG,
cDOUBLE  wholeB
[protected]
 

double PaletteOptimiser::Maximize cpBox  pCube,
cUINT32  dir,
cUINT32  first,
cUINT32  last,
cpBox  pCube1,
cpBox  pCube2,
cDOUBLE  wholeW,
cDOUBLE  wholeR,
cDOUBLE  wholeG,
cDOUBLE  wholeB
[protected]
 

void PaletteOptimiser::Moments3D  )  [protected]
 

void PaletteOptimiser::RemoveLockedColours  )  [inline]
 

Definition at line 267 of file gpalopt.h.

00267 { m_uLockedColours = 0 ; }

void PaletteOptimiser::SetFast cBOOL  bFast  )  [inline]
 

Definition at line 275 of file gpalopt.h.

00275 { m_bFast = bFast ; }

double PaletteOptimiser::Snap cpBox  pCube,
cDOUBLE  halfW,
cDOUBLE  halfR,
cDOUBLE  halfG,
cDOUBLE  halfB
[protected]
 

void PaletteOptimiser::SnapToBrowserPalette cUINT32  uSnap  )  [inline]
 

Definition at line 253 of file gpalopt.h.

00253 { m_uSnapToBrowserPalette = uSnap ; } ;

void PaletteOptimiser::SnapToPrimaries cUINT32  uSnap  )  [inline]
 

Definition at line 245 of file gpalopt.h.

00245 { m_uSnapToPrimaries = uSnap ; } ;

static INT32 __cdecl PaletteOptimiser::SortFn pcVOID  elem1,
pcVOID  elem2
[static, protected]
 

void PaletteOptimiser::Store cUINT32  i,
cpBox  pCube
[protected]
 

double PaletteOptimiser::Top cpcBox  pCube,
cUINT32  dir,
cUINT32  pos,
double Stats::*  p
const [protected]
 

void PaletteOptimiser::UseBitmapColours cBOOL  bUseBtmpClrs  )  [inline]
 

Definition at line 237 of file gpalopt.h.

00237 { m_bUseBitmapColours = bUseBtmpClrs ; } ;

void PaletteOptimiser::UseBrowserPalette cBOOL  bUseBrwsrPal  )  [inline]
 

Definition at line 230 of file gpalopt.h.

00230 { m_bUseBrowserPalette = bUseBrwsrPal ; } ;

double PaletteOptimiser::Var cpcBox  pCube  )  const [protected]
 

double PaletteOptimiser::Vol cpcBox  pCube,
double Stats::*  p
const [protected]
 


Member Data Documentation

const UINT32 PaletteOptimiser::aBDist[0x100] [static, protected]
 

Definition at line 388 of file gpalopt.h.

const UINT32 PaletteOptimiser::aPDist[0x100] [static, protected]
 

Definition at line 389 of file gpalopt.h.

const BYTE PaletteOptimiser::aSnap[0x132] [static, protected]
 

Definition at line 387 of file gpalopt.h.

const UINT32 PaletteOptimiser::aSqrs[0x100] [static, protected]
 

Definition at line 390 of file gpalopt.h.

RGBQUAD PaletteOptimiser::m_aColours[MAXCOLOURS+1] [protected]
 

Definition at line 333 of file gpalopt.h.

UINT32 PaletteOptimiser::m_aCount[MAXCOLOURS+1] [protected]
 

Definition at line 334 of file gpalopt.h.

PALETTEENTRY PaletteOptimiser::m_aLockedColours[MAXCOLOURS] [protected]
 

Definition at line 338 of file gpalopt.h.

PalEntry PaletteOptimiser::m_aPalette[3 *MAXCOLOURS] [protected]
 

Definition at line 341 of file gpalopt.h.

Stats PaletteOptimiser::m_aStats[AXIS3] [protected]
 

Definition at line 385 of file gpalopt.h.

bool PaletteOptimiser::m_bAddSystemColours [protected]
 

Definition at line 324 of file gpalopt.h.

bool PaletteOptimiser::m_bFast [protected]
 

Definition at line 320 of file gpalopt.h.

bool PaletteOptimiser::m_bMoments [protected]
 

Definition at line 323 of file gpalopt.h.

bool PaletteOptimiser::m_bUseBitmapColours [protected]
 

Definition at line 326 of file gpalopt.h.

bool PaletteOptimiser::m_bUseBrowserPalette [protected]
 

Definition at line 325 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uAllLockedColours [protected]
 

Definition at line 337 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uLockedColours [protected]
 

Definition at line 336 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uPaletteEntries [protected]
 

Definition at line 340 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uSnapToBrowserPalette [protected]
 

Definition at line 329 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uSnapToBrowserPalette2 [protected]
 

Definition at line 330 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uSnapToPrimaries [protected]
 

Definition at line 327 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uSnapToPrimaries2 [protected]
 

Definition at line 328 of file gpalopt.h.

UINT32 PaletteOptimiser::m_uTotalColours [protected]
 

Definition at line 332 of file gpalopt.h.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 03:59:26 2007 for Camelot by  doxygen 1.4.4