This reference page is linked to from the following overview topics: Resolution / Palettes / Pixel Storage Topics, Data Import and Export Plug-ins, Error Reporting, New Classes and Methods, Automatic Gamma Correction Best Practices, SDK Changes for Automatic Gamma Correction, Plug-in Base Classes, Writing Image IO Plug-ins, Principal Bitmap Classes.
#include <bitmap.h>
Base class for image IO plugins.
See BitmapIOMetaData for more information.
Public Member Functions |
|
| BMMExport int | GetOutputPixels (int x, int y, int pixels, BMM_Color_64 *ptr, BOOL preMultAlpha=TRUE) |
| BMMExport int | GetOutputPixels (int x, int y, int pixels, BMM_Color_fl *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) |
| BMMExport | BitmapIO () |
| virtual BMMExport | ~BitmapIO () |
| int | OpenMode () |
| void | SetPrev (BitmapIO *prev) |
| void | SetNext (BitmapIO *next) |
| BitmapIO * | Prev () |
| BitmapIO * | Next () |
| 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 *bi) |
| virtual BMMExport BOOL | ShowControl (HWND hWnd, DWORD flag) |
| virtual BMMExport DWORD | EvaluateConfigure ()=0 |
| virtual BMMExport BOOL | LoadConfigure (void *ptr, DWORD piDataSize)=0 |
| virtual BMMExport BOOL | SaveConfigure (void *ptr)=0 |
| virtual BMMExport void | GetCfgFilename (MCHAR *filename) |
| virtual BMMExport BOOL | ReadCfg () |
| virtual BMMExport void | WriteCfg () |
| virtual BMMExport BOOL | ValidatePiData (BitmapInfo *bi, ILoad *iload=NULL) |
| This is used to make sure plugin data on the
BitmapInfo belongs to this plugin. |
|
| BMMExport BOOL | SilentMode () |
| BMMExport BMMRES | GetFrame (BitmapInfo *fbi, int *frame) |
| BMMExport BMMRES | ProcessImageIOError (BitmapInfo *bi, const MCHAR *string=NULL) |
| BMMExport BMMRES | ProcessImageIOError (BitmapInfo *bi, int errorcode) |
| virtual BMMExport DWORD | ChannelsRequired () |
| virtual BMMExport BMMRES | GetImageInfoDlg (HWND hWnd, BitmapInfo *bi, const MCHAR *filename=NULL) |
| virtual BMMExport BMMRES | GetImageInfo (BitmapInfo *bi)=0 |
| virtual BMMExport BMMRES | GetImageName (BitmapInfo *bi, MCHAR *filename) |
| virtual BMMExport BitmapStorage * | Load (BitmapInfo *bi, Bitmap *map, BMMRES *status)=0 |
| virtual BMMExport BMMRES | OpenOutput (BitmapInfo *bi, Bitmap *map) |
| Opens the image for writing to file.
|
|
| virtual BMMExport BMMRES | Write (int frame) |
| virtual BMMExport int | Close (int flag) |
| virtual BMMExport PAVIFILE | GetPaviFile () |
| BMMExport void | InitOutputGammaTable (BitmapInfo *bi) |
| virtual BMMExport void | EvalMatch (MCHAR *matchString) |
Public Attributes |
|
| BitmapInfo | bi |
| Describes the properties of the bitmap being
handled by the instance of this class. |
|
Protected Attributes |
|
| float | gamma |
| The gamma setting. |
|
| Bitmap * | map |
| The Bitmap using this
OUTPUT handler. |
|
| BitmapStorage * | storage |
| The BitmapStorage used by this INPUT
handler. |
|
| int | openMode |
| The mode that the IO module is open for -
see Bitmap
Open Mode Types. |
|
| BitmapIO * | prevIO |
| A linked list pointer to the previous IO
module for multiple outputs of a single bitmap. |
|
| BitmapIO * | nextIO |
| A linked list pointer to the next IO module
for multiple outputs of a single bitmap. |
|
| BMMExport BitmapIO | ( | ) |
| virtual BMMExport ~BitmapIO | ( | ) | [virtual] |
| BMMExport int GetOutputPixels | ( | int | x, |
| int | y, | ||
| int | pixels, | ||
| BMM_Color_64 * | ptr, | ||
| BOOL | preMultAlpha =
TRUE |
||
| ) |
| BMMExport int GetOutputPixels | ( | int | x, |
| int | y, | ||
| int | pixels, | ||
| BMM_Color_fl * | 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 | ( | ) | [inline] |
{ return (openMode); }
| void SetPrev | ( | BitmapIO * | prev | ) | [inline] |
{ prevIO = prev; };
| void SetNext | ( | BitmapIO * | next | ) | [inline] |
{ nextIO = next; };
| BitmapIO* Prev | ( | ) | [inline] |
{ return prevIO; };
| BitmapIO* Next | ( | ) | [inline] |
{ return nextIO; };
| BMMExport BitmapStorage* Storage | ( | ) |
| Bitmap* Map | ( | ) | [inline] |
| virtual BMMExport int ExtCount | ( | ) | [pure virtual] |
| virtual BMMExport const MCHAR* Ext | ( | int | n | ) | [pure virtual] |
| virtual BMMExport const MCHAR* LongDesc | ( | ) | [pure virtual] |
| virtual BMMExport const MCHAR* ShortDesc | ( | ) | [pure virtual] |
| virtual BMMExport const MCHAR* AuthorName | ( | ) | [pure virtual] |
| virtual BMMExport const MCHAR* CopyrightMessage | ( | ) | [pure virtual] |
| virtual BMMExport UINT Version | ( | ) | [pure virtual] |
| virtual BMMExport int Capability | ( | ) | [pure virtual] |
| virtual BMMExport void ShowAbout | ( | HWND | hWnd | ) | [pure virtual] |
| virtual BMMExport BOOL ShowImage | ( | HWND | hWnd, |
| BitmapInfo * | bi | ||
| ) | [inline, virtual] |
{ return FALSE; }
| virtual BMMExport BOOL ShowControl | ( | HWND | hWnd, |
| DWORD | flag | ||
| ) | [inline, virtual] |
{ return FALSE; }
| virtual BMMExport DWORD EvaluateConfigure | ( | ) | [pure virtual] |
| virtual BMMExport BOOL LoadConfigure | ( | void * | ptr, |
| DWORD | piDataSize | ||
| ) | [pure virtual] |
| virtual BMMExport BOOL SaveConfigure | ( | void * | ptr | ) | [pure virtual] |
| virtual BMMExport void GetCfgFilename | ( | MCHAR * | filename | ) | [inline, virtual] |
{ filename[0]=0; }
| virtual BMMExport BOOL ReadCfg | ( | ) | [inline, virtual] |
{ return TRUE; }
| virtual BMMExport void WriteCfg | ( | ) | [inline, virtual] |
| virtual BMMExport BOOL ValidatePiData | ( | BitmapInfo * | bi, |
| ILoad * | iload = NULL |
||
| ) | [virtual] |
This is used to make sure plugin data on the BitmapInfo belongs to this plugin.
It is also called on file load to allow the plugin to version the plugin data. In this case, the iload parameter will be non-NULL. If a plugin implements this method, it must first call the method on BitmapIO and immediately return false if that implementation returns false.
BOOL BitmapIO_DS::ValidatePiData( BitmapInfo *bi, ILoad *iload ) { if (bi == NULL) return FALSE; if (!BitmapIO::ValidatePiData(bi) ) return FALSE; void* ptr = bi->GetPiData(); DWORD piDataSize = bi->GetPiDataSize(); if ((piDataSize == sizeof(AVIDATA_old_x32) + ((AVIDATA_old_x32*)ptr)->codec_data_size) || (piDataSize == sizeof(AVIDATA_old_x64) + ((AVIDATA_old_x64*)ptr)->codec_data_size)) { // old data format - update to new format if (BitmapIO_DS::LoadConfigure(ptr, piDataSize)) { DWORD newSize = EvaluateConfigure(); if (bi->AllocPiData(newSize)) SaveConfigure(bi->GetPiData()); } } return TRUE; }
| [in] | bi | The BitmapInfo holding the plugin data |
| [in] | iload | The ILoad* if called when loading the BitmapInfo from a scene file, NULL otherwise. |
| BMMExport BOOL SilentMode | ( | ) |
| BMMExport BMMRES GetFrame | ( | BitmapInfo * | fbi, |
| int * | frame | ||
| ) |
| BMMExport BMMRES ProcessImageIOError | ( | BitmapInfo * | bi, |
| const MCHAR * | string =
NULL |
||
| ) |
| BMMExport BMMRES ProcessImageIOError | ( | BitmapInfo * | bi, |
| int | errorcode | ||
| ) |
BMMRES BitmapIO_JPEG::Write(int frame)
{
//-- If we haven't gone through an OpenOutput(), leave
if (openMode != BMM_OPEN_W)
return
(ProcessImageIOError(&bi,BMMRES_INTERNALERROR));
//-- Resolve Filename --------------------------------
MCHAR filename[MAX_PATH];
if (frame == BMM_SINGLEFRAME) {
_tcscpy(filename,bi.Name());
}
else {
if (!BMMCreateNumberedFilename(bi.Name(),frame,filename)) {
return
(ProcessImageIOError(&bi,BMMRES_NUMBEREDFILENAMEERROR));
}
}
| virtual BMMExport DWORD ChannelsRequired | ( | ) | [inline, virtual] |
{ return BMM_CHAN_NONE; }
| virtual BMMExport BMMRES GetImageInfoDlg | ( | HWND | hWnd, |
| BitmapInfo * | bi, | ||
| const MCHAR * | filename =
NULL |
||
| ) | [inline, virtual] |
{return BMMRES_NODRIVER;}
| virtual BMMExport BMMRES GetImageInfo | ( | BitmapInfo * | bi | ) | [pure virtual] |
bi->SetWidth(640);
bi->SetHeight(480);
bi->SetType(BMM_TRUE_24);
bi->SetAspect(1.0f);
bi->SetGamma(1.0f);
bi->SetFirstFrame(0);
bi->SetLastFrame(0);
return BMM_SUCCESS;
| virtual BMMExport BMMRES GetImageName | ( | BitmapInfo * | bi, |
| MCHAR * | filename | ||
| ) | [inline, virtual] |
{filename[0]=0; return (BMMRES_SUCCESS);}
| virtual BMMExport BitmapStorage* Load | ( | BitmapInfo * | bi, |
| Bitmap * | map, | ||
| BMMRES * | status | ||
| ) | [pure virtual] |
| virtual BMMExport BMMRES OpenOutput | ( | BitmapInfo * | bi, |
| Bitmap * | map | ||
| ) | [virtual] |
Opens the image for writing to file.
| bi | - The image information. |
| map | - Points to the bitmap to save. |
| virtual BMMExport BMMRES Write | ( | int | frame | ) | [virtual] |
| virtual BMMExport int Close | ( | int | flag | ) | [virtual] |
| virtual BMMExport PAVIFILE GetPaviFile | ( | ) | [inline, virtual] |
{ return NULL; }
| BMMExport void InitOutputGammaTable | ( | BitmapInfo * | bi | ) |
| virtual BMMExport void EvalMatch | ( | MCHAR * | matchString | ) | [inline, virtual] |
{ matchString[0] = 0; }
float gamma
[protected] |
The gamma setting.
The Bitmap using this OUTPUT handler.
BitmapStorage* storage
[protected] |
The BitmapStorage used by this INPUT handler.
int openMode
[protected] |
The mode that the IO module is open for - see Bitmap Open Mode Types.
A linked list pointer to the previous IO module for multiple outputs of a single bitmap.
A linked list pointer to the next IO module for multiple outputs of a single bitmap.
Describes the properties of the bitmap being handled by the instance of this class.