This reference page is linked to from the following overview
topics: Gamma
Preferences.
Detailed Description
- See also:
- Class Color,
COLORREF.
- Description:
- The gamma manager class. Methods of this class are used to
gamma correct and de-gamma colors in various formats. Various
settings from the 3ds Max user interface are also accessible via
data members of this class (for example the display, and file gamma
settings). These settings may be read but should not be set by a
plug-in developer. All methods of this class are implemented by the
system.
There is a global instance of this class (defined in
/MAXSDK/INCLUDE/GAMMA.H):
GammaMgr
gammaMgr;
Note the following #defines. These are used to reduce the size of
the gamma tables for correcting 16 bit values.
#define RCBITS 13
#define RCOLN (1<<RCBITS)
This class provides a set of commonly used gamma tables. This class
does not provide tables for all types of conversion however. For
example if you have a different gamma setting that you are using,
or if you are going in a different conversion direction than the
tables provided here you may use the classes GamConvert16 and GamConvert8 to build gamma
tables.
- Data Members:
- BOOL enable;
Indicates if gamma correction is enabled or disabled.
BOOL dithTrue;
Indicates if output dithering is to be used for true color
images.
BOOL dithPaletted;
Indicates if output dithering is to be used for paletted
images.
float dispGamma;
The display gamma setting.
float fileInGamma;
The file input gamma setting.
float fileOutGamma;
The file output gamma setting.
UBYTE disp_gamtab[256];
Display gamma table for drawing color swatches (8->8)
UBYTE disp_gamtabw[RCOLN];
Display gamma table (RCBITS->8).
UBYTE file_in_gamtab[256];
File input gamma table (8->8).
UWORD file_in_degamtab[256];
For de-gamifying bitmaps on input. (8->16)
UWORD file_out_gamtab[RCOLN];
Gamma correct for file output, before dither (RCBITS->16).
#include <gamma.h>
List of all
members.
Constructor & Destructor Documentation
Member Function Documentation
COLORREF DisplayGammaCorrect |
( |
COLORREF |
col |
) |
[inline] |
- Parameters:
- COLORREF col
The color to gamma correct.
- Returns:
- The gamma corrected color.
- Parameters:
- Color c
The color to gamma correct.
- Returns:
- The gamma corrected color.
CoreExport void Enable |
( |
BOOL |
onOff |
) |
|
- Parameters:
- BOOL onOff
TRUE to enable; FALSE to disable.
BOOL IsEnabled |
( |
|
) |
[inline] |
CoreExport void SetDisplayGamma |
( |
float |
gam |
) |
|
- Parameters:
- float gam
The value to set.
float GetDisplayGamma |
( |
|
) |
[inline] |
CoreExport void SetFileInGamma |
( |
float |
gam |
) |
|
- Parameters:
- float gam
The value to set.
float GetFileInGamma |
( |
|
) |
[inline] |
CoreExport void SetFileOutGamma |
( |
float |
gam |
) |
|
- Parameters:
- float gam
The value to set.
float GetFileOutGamma |
( |
|
) |
[inline] |
Member Data Documentation
GammaMgr GammaMgr GammaMgr GammaMgr
GammaMgr GammaMgr GammaMgr GammaMgr GammaMgr GammaMgr
GammaMgr GammaMgr GammaMgr GammaMgr
GammaMgr GammaMgr GammaMgr GammaMgr GammaMgr GammaMgr