Classes | Defines | Functions | Variables

gamma.h File Reference

This reference page is linked to from the following overview topics: Gamma Preferences.


#include "maxheap.h"
#include <WTypes.h>
#include "maxtypes.h"
#include "coreexp.h"
#include "color.h"

Go to the source code of this file.

Classes

class   GammaMgr
class   GamConvert16
class   GamConvert8

Defines

#define  WRDMAX   65535
#define  FWRDMAX   65535.0f
#define  RCBITS   13
#define  RCOLN   (1<<RCBITS)
#define  RCMAX   (RCOLN-1)
#define  FRCMAX   ((float)RCMAX)
#define  RCHALF   (RCOLN>>1)
#define  RCSH   (RCBITS-8)
#define  RCSH16   (16-RCBITS)
#define  RCFRACMASK   ((ulong)((1<<RCSH)-1))
#define  RC_SCL   (1<<RCSH)
#define  RC_SCLHALF   (1<<(RCSH-1))
#define  FRC_SCL   ((float)RC_SCL)
#define  RCSHMASK   (0xffffffffL<<RCSH)
#define  RCSHMAX   (0xffL<<RCSH)
#define  GAMMA_NTSC   2.2f
#define  GAMMA_PAL   2.8f
#define  GAMMA16to8(b)   gammaMgr.disp_gamtabw[b>>RCSH16]

Functions

COLORREF  gammaCorrect (DWORD c)
UBYTE  gammaCorrect (UBYTE b)
CoreExport void  BuildGammaTab8 (UBYTE gamtab[256], float gamma, int onoff=TRUE)
CoreExport void  BuildGammaTab8 (UWORD gamtab[256], float gamma, int onoff=TRUE)
CoreExport void  BuildGammaTab (UBYTE gamtab[RCOLN], float gamma, int onoff=TRUE)
CoreExport void  BuildGammaTab (UWORD gamtab[RCOLN], float gamma, int onoff=TRUE)
CoreExport float  gammaCorrect (float v, float gamma)
CoreExport float  deGammaCorrect (float v, float gamma)
CoreExport UBYTE  gammaCorrect (UBYTE v, float gamma)
CoreExport UBYTE  deGammaCorrect (UBYTE v, float gamma)
CoreExport UWORD  gammaCorrect (UWORD c, float gamma)
CoreExport UWORD  deGammaCorrect (UWORD c, float gamma)

Variables

CoreExport GammaMgr  gammaMgr

Define Documentation

#define WRDMAX   65535

Definition at line 22 of file gamma.h.

#define FWRDMAX   65535.0f

Definition at line 23 of file gamma.h.

#define RCBITS   13

Definition at line 25 of file gamma.h.

#define RCOLN   (1<<RCBITS)

Definition at line 27 of file gamma.h.

#define RCMAX   (RCOLN-1)

Definition at line 28 of file gamma.h.

#define FRCMAX   ((float)RCMAX)

Definition at line 29 of file gamma.h.

#define RCHALF   (RCOLN>>1)

Definition at line 30 of file gamma.h.

#define RCSH   (RCBITS-8)

Definition at line 31 of file gamma.h.

#define RCSH16   (16-RCBITS)

Definition at line 32 of file gamma.h.

#define RCFRACMASK   ((ulong)((1<<RCSH)-1))

Definition at line 33 of file gamma.h.

#define RC_SCL   (1<<RCSH)

Definition at line 34 of file gamma.h.

#define RC_SCLHALF   (1<<(RCSH-1))

Definition at line 35 of file gamma.h.

#define FRC_SCL   ((float)RC_SCL)

Definition at line 36 of file gamma.h.

#define RCSHMASK   (0xffffffffL<<RCSH)

Definition at line 37 of file gamma.h.

#define RCSHMAX   (0xffL<<RCSH)

Definition at line 38 of file gamma.h.

#define GAMMA_NTSC   2.2f

Definition at line 41 of file gamma.h.

#define GAMMA_PAL   2.8f

Definition at line 42 of file gamma.h.

#define GAMMA16to8 (   b )    gammaMgr.disp_gamtabw[b>>RCSH16]

Definition at line 176 of file gamma.h.


Function Documentation

COLORREF gammaCorrect ( DWORD  c ) [inline]
Remarks:
Returns a gamma corrected version of the specified color using the display gamma setting.
Parameters:
DWORD c

The color to gamma correct.

Definition at line 167 of file gamma.h.

{ return gammaMgr.DisplayGammaCorrect(c); }
UBYTE gammaCorrect ( UBYTE  b ) [inline]
Remarks:
Returns a gamma corrected version of the specified color using the display gamma setting.
Parameters:
UBYTE b

The color to gamma correct.

Definition at line 173 of file gamma.h.

{ return gammaMgr.disp_gamtab[b]; }
CoreExport void BuildGammaTab8 ( UBYTE  gamtab[256],
float  gamma,
int  onoff = TRUE 
)
Remarks:
Builds the gamma table that maps 8->8.
Parameters:
UBYTE gamtab[256]

The table to build.

float gamma

The gamma setting.

int onoff=TRUE

TRUE to enable; FALSE to disable.
CoreExport void BuildGammaTab8 ( UWORD  gamtab[256],
float  gamma,
int  onoff = TRUE 
)
Remarks:
Builds a gamma table that maps 8->16.
Parameters:
UBYTE gamtab[256]

The table to build.

float gamma

The gamma setting.

int onoff=TRUE

TRUE to enable; FALSE to disable.
CoreExport void BuildGammaTab ( UBYTE  gamtab[RCOLN],
float  gamma,
int  onoff = TRUE 
)
Remarks:
Build a gamma table that maps RCBITS->8.
Parameters:
UBYTE gamtab[RCOLN]

The table to build.

float gamma

The gamma setting.

int onoff=TRUE

TRUE to enable; FALSE to disable.
CoreExport void BuildGammaTab ( UWORD  gamtab[RCOLN],
float  gamma,
int  onoff = TRUE 
)
Remarks:
Build a gamma table that maps RCBITS->16.
Parameters:
UWORD gamtab[RCOLN]

The table to build.

float gamma

The gamma setting.

int onoff=TRUE

TRUE to enable; FALSE to disable.
CoreExport float gammaCorrect ( float  v,
float  gamma 
)
Remarks:
Gamma corrects the value passed using the specified gamma setting.
Parameters:
float v

The value to gamma correct.

float gamma

The gamma setting.
Returns:
The gamma corrected value.
CoreExport float deGammaCorrect ( float  v,
float  gamma 
)
Remarks:
De-gamma corrects the value passed using the specified gamma setting.
Parameters:
float v

The value to de-gamma correct.

float gamma

The gamma setting.
CoreExport UBYTE gammaCorrect ( UBYTE  v,
float  gamma 
)
Remarks:
Gamma corrects the value passed using the specified gamma setting.
Parameters:
UBYTE v

The value to gamma correct.

float gamma

The gamma setting.
Returns:
The gamma corrected value.
CoreExport UBYTE deGammaCorrect ( UBYTE  v,
float  gamma 
)
Remarks:
De-gamma corrects the value passed using the specified gamma setting.
Parameters:
UBYTE v

The value to de-gamma correct.

float gamma

The gamma setting.
CoreExport UWORD gammaCorrect ( UWORD  c,
float  gamma 
)
Remarks:
Gamma corrects the value passed using the specified gamma setting.
Parameters:
UWORD c

The value to gamma correct.

float gamma

The gamma setting.
Returns:
The gamma corrected value.
CoreExport UWORD deGammaCorrect ( UWORD  c,
float  gamma 
)
Remarks:
De-gamma corrects the value passed using the specified gamma setting.
Parameters:
UWORD c

The value to de-gamma correct.

float gamma

The gamma setting.

Variable Documentation

CoreExport GammaMgr gammaMgr