Base class for image IO plugins.
- See also
- Class Bitmap, Class BitmapStorage, Class BitmapInfo, Class BitmapIOMetaData, Working with Bitmaps.
- Description:
- This is the base class used by developers creating image loader / saver plug-ins. Developers implement pure virtual methods of this class to load the image, open it for output, write to it, close it, and to provide information about the image loader/saver they are creating. These are properties such as the author name, copyright, image format description, filename extension(s) used, and the capabilities of the image loader / saver.
When a BitmapIO derived image reader reads an image, it creates a storage class that makes sense to it. For example, a paletted 8 bit is perfect for loading GIF's but not for loading 32 bit Targas. The inverse is also true. There is no point in creating a TRUE_64 storage to load a GIF. Because this is how image buffers are managed, it is also important to note that if a developer writes an image loader that creates images from scratch (a gradient generator for instance), there is no need to have any real memory allocated. The plug-in would simply derive a new type of BitmapStorage and provide the pixels through the common methods (virtual buffer), creating them as they are requested.
- Automatic gamma correction / BitmapIOMetaData
- If a particular BitmapIO is intended to read/write floating point data, or in general does not want to have the data encoded with a gamma curve, it can choose to expose the BitmapIOMetaData interface. This is done by exposing an interface with the ID of BITMAPIOMETADATA_INTERFACE_ID (retrievable via BitmapIO::GetInterface(BITMAPIOMETADATA_INTERFACE_ID)). This returns a pointer to the BitmapIO's BitmapIOMetaData interface. This exposes a function BitmapIOMetaData::UseLinearStorage() that will return true if that BitmapIO would like to (by default) load and save data linearly (i.e. with a gamma of 1.0).
See BitmapIOMetaData for more information.
|
BMMExport int | GetOutputPixels (int x, int y, int pixels, BMM_Color_fl *ptr, BOOL preMultAlpha=TRUE) |
|
BMMExport | BitmapIO () |
|
virtual BMMExport | ~BitmapIO () |
|
void | SetPrev (BitmapIO *prev) |
|
void | SetNext (BitmapIO *next) |
|
BitmapIO * | Prev () |
|
BitmapIO * | Next () |
|
virtual BMMExport BOOL | ValidatePiData (BitmapInfo *pbi, ILoad *iload=NULL) |
| This is used to make sure plugin data on the BitmapInfo belongs to this plugin. More...
|
|
virtual BMMExport PAVIFILE | GetPaviFile () |
|
BMMExport void | InitOutputGammaTable (BitmapInfo *pbi) |
|
|
BMMExport int | GetOutputPixels (int x, int y, int pixels, BMM_Color_64 *ptr, BOOL preMultAlpha=TRUE) |
|
BMMExport int | GetDitheredOutputPixels (int x, int y, int pixels, BMM_Color_32 *ptr, BOOL preMultAlpha=TRUE) |
|
|
BMMExport PBITMAPINFO | GetOutputDib (int depth=24) |
|
BMMExport PBITMAPINFO | GetDitheredOutputDib (int depth=24) |
|
|
BMMExport float | OutputGamma () |
|
|
BMMExport BOOL | DitherTrueColor () |
|
BMMExport BOOL | DitherPaletted () |
|
|
BMMExport int | CalcOutputPalette (int palsize, BMM_Color_48 *pal) |
|
|
int | OpenMode () |
|
|
BMMExport BitmapStorage * | Storage () |
|
Bitmap * | Map () |
|
|
virtual BMMExport int | ExtCount ()=0 |
|
virtual BMMExport const MCHAR * | Ext (int n)=0 |
|
|
virtual BMMExport const MCHAR * | LongDesc ()=0 |
|
virtual BMMExport const MCHAR * | ShortDesc ()=0 |
|
virtual BMMExport const MCHAR * | AuthorName ()=0 |
|
virtual BMMExport const MCHAR * | CopyrightMessage ()=0 |
|
virtual BMMExport UINT | Version ()=0 |
|
|
virtual BMMExport int | Capability ()=0 |
|
|
virtual BMMExport void | ShowAbout (HWND hWnd)=0 |
|
virtual BMMExport BOOL | ShowImage (HWND hWnd, BitmapInfo *pbi) |
|
virtual BMMExport BOOL | ShowControl (HWND hWnd, DWORD flag) |
|
|
The following methods (EvaluateConfigure(), LoadConfigure(), and SaveConfigure()) deal with BitmapIO loading and saving.
See the sample code below to know how the EPS BitmapIO plug-in uses these methods. typedef struct userSettable {
int units;
int binary;
int preview;
int orientation;
int colorType;
float paperHeight;
float paperWidth;
float xResolution;
float yResolution;
} UserSettable;
DWORD BitmapIO_EPS::EvaluateConfigure () {
return sizeof (UserSettable);
}
BOOL BitmapIO_EPS::LoadConfigure (void *ptr) {
UserSettable *buf = (UserSettable *) ptr;
memcpy (&userSettings, ptr, sizeof(UserSettable));
return TRUE;
}
BOOL BitmapIO_EPS::SaveConfigure (void *ptr) {
if (ptr) {
memcpy (ptr, &userSettings, sizeof(UserSettable));
return TRUE;
} else
return FALSE;
}
|
virtual BMMExport DWORD | EvaluateConfigure ()=0 |
|
virtual BMMExport BOOL | LoadConfigure (void *ptr, DWORD piDataSize)=0 |
|
virtual BMMExport BOOL | SaveConfigure (void *ptr)=0 |
|
|
These Cfg methods provide access to the default options of BitmapIO, as saved in its .cfg file.
The options control how files are saved to disk (JPEG compression and smoothing, for example). Formerly, most BitmapIO types implemented these methods, yet they were not derived from any superclass. The method definitions are now moved to the BitmapIO superclass, so they can easily be called on any subclass. Note: Introduced in 3ds Max 6 SDK.
|
virtual BMMExport void | GetCfgFilename (MCHAR *filename) |
|
virtual BMMExport BOOL | ReadCfg () |
|
virtual BMMExport void | WriteCfg () |
|
|
BMMExport BOOL | SilentMode () |
|
BMMExport BMMRES | GetFrame (BitmapInfo *fbi, int *frame) |
|
|
BMMExport BMMRES | ProcessImageIOError (BitmapInfo *pbi, const MCHAR *string=NULL) |
|
BMMExport BMMRES | ProcessImageIOError (BitmapInfo *pbi, int errorcode) |
|
|
virtual BMMExport DWORD | ChannelsRequired () |
|
|
virtual BMMExport BMMRES | GetImageInfoDlg (HWND hWnd, BitmapInfo *pbi, const MCHAR *filename=NULL) |
|
virtual BMMExport BMMRES | GetImageInfo (BitmapInfo *pbi)=0 |
|
virtual BMMExport BMMRES | GetImageName (BitmapInfo *pbi, MCHAR *filename) |
|
virtual BMMExport void | EvalMatch (MCHAR *matchString) |
|
|
virtual BMMExport BitmapStorage * | Load (BitmapInfo *pbi, Bitmap *pmap, BMMRES *status)=0 |
|
|
virtual BMMExport BMMRES | OpenOutput (BitmapInfo *pbi, Bitmap *pmap) |
| Opens the image for writing to file. More...
|
|
virtual BMMExport BMMRES | Write (int frame) |
|
virtual BMMExport int | Close (int flag) |
|
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
|
virtual UtilExport int | NumInterfaces () const |
|
virtual UtilExport BaseInterface * | GetInterfaceAt (int i) const |
|
virtual UtilExport | ~BaseInterfaceServer () |
|
virtual UtilExport | ~InterfaceServer () |
| Destructor. More...
|
|
|
static UtilExport void * | operator new (size_t size) |
| Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator new[] (size_t size) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
| New operator used to allocate arrays of objects. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
static UtilExport void * | operator 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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
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. More...
|
|
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
| Placement new operator. More...
|
|
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
| Placement delete operator. More...
|
|
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
| Allocates memory on a specified alignment boundary. More...
|
|
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
| Reallocates memory on a specified alignment boundary. More...
|
|
static UtilExport void | aligned_free (void *ptr) |
| Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
|
|