BitmapIOMetaData Class Reference
 
 
 
BitmapIOMetaData Class Reference

This reference page is linked to from the following overview topics: New Classes and Methods, Automatic Gamma Correction Best Practices, SDK Changes for Automatic Gamma Correction.


#include <bitmap.h>

Inheritance diagram for BitmapIOMetaData:
BaseInterface InterfaceServer MaxHeapOperators

Class Description

Extends BitmapIO with additional information for automatic gamma correction etc.

See also:
Class BitmapIO
Description:
This class exposes extended parameters for the BitmapIO class that relates to things like gamma correction preferences. It is returned as an extended interface of BitmapIO, returned by calling GetInterface(BITMAPIOMETADATA_INTERFACE_ID) on it.
If this interface is exposed, it can make a decision wether that BitmapIO implementation would preffer to save or load data linearily. It is called by the code in BitmapManager::Load() when loading and Bitmap::OpenOutput() when saving.
Any BitmapIO that does not expose this interface is simply assumed to use the default gamma value when reading and writing the files (the sRGB gamma of 2.2), very similar to how things worked in older 3ds Max versions.

Public Member Functions

virtual bool  UseLinearStorage (bool save)=0
  Does this BitmapIO preffer linear data or not?

Member Function Documentation

virtual bool UseLinearStorage ( bool  save ) [pure virtual]

Does this BitmapIO preffer linear data or not?

Parameters:
save is true if we are saving, false for loading.
Returns:
true if we preffer linear storage, false if we want to use the the default - generally sRGB - gamma.
Usage:
If this BitmapIO always wants to work with linear data, this function can just blindly return true. If, however, it can support both float formats and non-float formats depending on settings (like, for example, the DDS or RPF plugins), it needs to be able to make decisions on what to return.
To do this properly, one needs to understand the calling sequence; this function is called in two cases:
  • From BitmapManager::Load() (with save set to false). Since this is called after loading, it is legal to make decisions based on the BitmapIO::bi member, for example examining BitmapIO::bi.Type().
  • From Bitmap::OpenOutput() (with save set to true). Decisions need to be made based on the configuration of the bitmap plugin, since this is called before saving, the BitmapIO::bi member is in this case not valid.

An example of this is available in /MAXSDK/SAMPLES/IMAGES/RLA/RLA.CPP.