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.
- Method Groups:
- See Method Groups for
Class BitmapIO.
- 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 (retreivable
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 linearily (i.e. with a gamma of
1.0).
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.
|