3ds Max C++ API Reference
Loading...
Searching...
No Matches
GammaMgr Class Reference

#include <gamma.h>

+ Inheritance diagram for GammaMgr:

Public Member Functions

CoreExport Color DisplayGammaCorrect (Color c)
 
CoreExport void Enable (BOOL onOff)
 
BOOL IsEnabled () const
 
CoreExport void SetDisplayGamma (float gam)
 
float GetDisplayGamma () const
 
CoreExport void SetFileInGamma (float gam)
 
float GetFileInGamma () const
 
CoreExport void SetFileOutGamma (float gam)
 
float GetFileOutGamma () const
 
CoreExport GammaMgr ()
 
CoreExport ~GammaMgr ()
 

Public Attributes

BOOL dithTrue
 
BOOL dithPaletted
 
UBYTE disp_gamtabw [RCOLN]
 
UWORD file_in_degamtab [256]
 
UWORD file_out_gamtab [RCOLN]
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown.
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned.
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen.
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

Detailed Description

Deprecated:
This class is deprecated: Please use MaxSDK::ColorManagement::IColorPipelineMgr which provides better color management functionality.
See also
Class Color, COLORREF.

Description:
Deprecated gamma manager class: Please use MaxSDK::ColorManagement::IColorPipelineMgr which provides better color management functionality. 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_gamtabw[RCOLN];

Display gamma table (RCBITS->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).

Constructor & Destructor Documentation

◆ GammaMgr()

Remarks
Constructor.

◆ ~GammaMgr()

Remarks
Destructor.

Member Function Documentation

◆ DisplayGammaCorrect()

CoreExport Color DisplayGammaCorrect ( Color  c)
Remarks
Gamma corrects the specified color using the display gamma setting.
Parameters:
Color c

The color to gamma correct.
Returns
The gamma corrected color.

◆ Enable()

CoreExport void Enable ( BOOL  onOff)
Remarks
Sets the gamma correction enabled setting.
Parameters:
BOOL onOff

TRUE to enable; FALSE to disable.

◆ IsEnabled()

BOOL IsEnabled ( ) const
inline
Remarks
Returns the gamma correction enabled setting; TRUE if enabled; FALSE if disabled.
115{ return enable;}

◆ SetDisplayGamma()

CoreExport void SetDisplayGamma ( float  gam)
Remarks
Sets the display gamma setting.
Parameters:
float gam

The value to set.

◆ GetDisplayGamma()

float GetDisplayGamma ( ) const
inline
Remarks
Returns the display gamma setting.
123{ return dispGamma; }

◆ SetFileInGamma()

CoreExport void SetFileInGamma ( float  gam)
Remarks
Sets the file input gamma setting.
Parameters:
float gam

The value to set.

◆ GetFileInGamma()

float GetFileInGamma ( ) const
inline
Remarks
Returns the file input gamma setting.
131{ return fileInGamma; }

◆ SetFileOutGamma()

CoreExport void SetFileOutGamma ( float  gam)
Remarks
Sets the file output gamma setting.
Parameters:
float gam

The value to set.

◆ GetFileOutGamma()

float GetFileOutGamma ( ) const
inline
Remarks
Returns the file output gamma setting.
139{ return fileOutGamma; }

Member Data Documentation

◆ dithTrue

BOOL dithTrue

◆ dithPaletted

BOOL dithPaletted

◆ disp_gamtabw

UBYTE disp_gamtabw[RCOLN]

◆ file_in_degamtab

UWORD file_in_degamtab[256]

◆ file_out_gamtab

UWORD file_out_gamtab[RCOLN]