Class for image input and output.
- Description:
- The Bitmap class is the bitmap itself. All image access is done through this class. The Bitmap class has methods to retrieve properties of the bitmap such as image width, height, whether it is dithered, has an alpha channel, etc. There are methods to retrieve and store pixels from the image. Additional methods allow a developer to copy bitmaps. This class also has methods to open outputs and write multi-frame files. All methods of this class are implemented by the system.
\par Examples
The following is some examples of how to write some files out to disk:
To write a single image to a file/device, first create the Create BitmapInfo class:
Then define the output file or device: or use the BitmapManager: Then define your parameters for the Bitmap: Then create the Bitmap: Then do something with the bitmap: Then you actually open, write and close the bitmap:
- To write a multi-frame file, just keep doing something different to the Bitmap and keep writing.
- To write a sequence of images to a file/device. Create BitmapInfo class Define the output file/device, either directly
bi.
SetName(_T(
"E:\Renders\file.tga"));
or using the user interface. The customize or define the BitmapInfo: Then create the Bitmap Then open the Bitmap for writing
for (
int x = 0;
x < 29;
x++)
{
## Do something to image...
}
- Note that in a localized environment there is no need to call BitmapInfo::SetDevice. This is because calling Bitmap::OpenOutput will automatically determine the device type or BitmapIO type based off of the extension of the filename. Another alternative to manually setting the device type that even works in a localized environment is to call BitmapInfo::FixDeviceName which will find the correct BitmapIO type based off of the extension.
- Note: You can add any number of outputs to a bitmap. Just keep calling map->OpenInput() with different outputs (Targa file AND Frame Buffer for instance). To write or close a specific output, use Write() and Close(). To write and close them all at once, use WriteAll() and CloseAll().
- It is ok to use WriteAll() and CloseAll() if you have just one output defined.
- See also
- Class BitmapManager, Class BitmapInfo, Class BitmapStorage, Class GBuffer, Working with Bitmaps.
|
BitmapManager * | Manager () |
|
BMMExport int | Create (BitmapInfo *bi) |
|
BMMExport BOOL | FixDeviceName (BitmapInfo *bi) |
|
int | MapReady () |
|
BMMExport void | AddOutput (BitmapIO *out) |
|
BMMExport void | RemoveOutput (BitmapIO *out, BOOL deleteOutput=TRUE) |
|
BMMExport BitmapIO * | FindOutput (BitmapInfo *bi) |
|
BMMExport PAVIFILE | GetPaviFile (BitmapInfo *bi) |
|
void * | GetVFBData () |
|
void | SetVFBData (void *vfb) |
|
int | Put16Gray (int x, int y, int pixels, WORD *ptr) |
|
void * | GetStoragePtr (int *type) |
|
void * | GetAlphaPtr (int *type) |
|
int | Get16Gray (int x, int y, int pixels, WORD *ptr) |
|
int | GetPixels (int x, int y, int pixels, BMM_Color_64 *ptr) |
|
BMMExport int | PutPixels (int x, int y, int pixels, BMM_Color_64 *ptr) |
|
int | GetLinearPixels (int x, int y, int pixels, BMM_Color_fl *ptr) |
|
int | CropImage (int width, int height, BMM_Color_64 fillcolor) |
|
int | CropImage (int width, int height, BMM_Color_fl fillcolor) |
|
int | CropImage (int width, int height, int fillindex) |
|
int | CopyImage (Bitmap *from, int operation, BMM_Color_fl fillcolor, BitmapInfo *bi=NULL) |
|
BMMExport void | FilmGrain (float grain, BOOL mask, PBITMAP_FX_CALLBACK callback=NULL, void *param=NULL) |
|
BMMExport BOOL | PrepareGChannels (DWORD channels) |
|
BMMExport int | GetFiltered (float u, float v, float du, float dv, BMM_Color_64 *ptr) |
|
BMMExport int | Fill (const BMM_Color_fl &fillColor) |
|
BMMExport int | Fill (const BMM_Color_64 &fillColor) |
|
DWORD | GetModifyID () |
|
void | SetModifyID (DWORD m) |
|
BMMExport void | IncrModifyID () |
|
|
BMMExport void | DeleteThis () |
|
|
DWORD | Flags () |
|
void | SetFlag (DWORD flag) |
|
void | ToggleFlag (DWORD flag) |
|
void | ClearFlag (DWORD flag) |
|
|
The following methods return properties of the bitmap.
When these methods are called, they are passed to the BitmapStorage instance maintained by the Bitmap. The BitmapStorage implements these methods by returning the properties of the BitmapInfo instance maintained by the storage. Therefore, the values returned from the methods represent what is returned from the BitmapInfo instance associated with the Bitmap.
|
int | Width () |
|
int | Height () |
|
float | Aspect () |
|
float | Gamma () |
|
int | Paletted () |
|
int | IsDithered () |
|
int | PreMultipliedAlpha () |
|
int | HasAlpha () |
|
int | IsHighDynamicRange () |
|
int | MaxRGBLevel () |
|
int | MaxAlphaLevel () |
|
BMMExport BMMRES | GoTo (BitmapInfo *bi) |
|
BitmapInfo | GetBitmapInfo () |
|
|
The following methods access pixel data one scanline at a time.
Thus, x + pixels must be less than the bitmap width.
|
int | Put16Gray (int x, int y, int pixels, float *ptr) |
|
int | Get16Gray (int x, int y, int pixels, float *ptr) |
|
int | GetPixels (int x, int y, int pixels, BMM_Color_fl *ptr) |
|
BMMExport int | PutPixels (int x, int y, int pixels, BMM_Color_fl *ptr) |
|
int | GetLinearPixels (int x, int y, int pixels, BMM_Color_64 *ptr) |
|
int | GetIndexPixels (int x, int y, int pixels, BYTE *ptr) |
|
int | PutIndexPixels (int x, int y, int pixels, BYTE *ptr) |
|
|
int | ResizeImage (int width, int height, int newpalette) |
|
int | CopyImage (Bitmap *from, int operation, BMM_Color_64 fillcolor, BitmapInfo *bi=NULL) |
|
int | CopyImage (Bitmap *from, int operation, int fillindex) |
|
BMMExport PBITMAPINFO | ToDib (int depth=24, UWORD *gam=NULL, BOOL doDither=FALSE, BOOL displayGamma=FALSE) |
|
BMMExport BOOL | FromDib (PBITMAPINFO pbmi) |
|
|
int | GetPalette (int start, int count, BMM_Color_48 *ptr) |
|
int | SetPalette (int start, int count, BMM_Color_48 *ptr) |
|
|
void * | GetChannel (ULONG channelID, ULONG &chanType) |
|
GBuffer * | GetGBuffer () |
|
ULONG | CreateChannels (ULONG channelIDs) |
|
void | DeleteChannels (ULONG channelIDs) |
|
ULONG | ChannelsPresent () |
|
RenderInfo * | GetRenderInfo () |
|
RenderInfo * | AllocRenderInfo () |
|
BMMExport BOOL | PrepareGChannels (BitmapInfo *bi) |
|
|
BMMExport int | GetFiltered (float u, float v, float du, float dv, BMM_Color_fl *ptr) |
|
BMMExport int | SetDither (UINT nDitherType) |
|
BMMExport int | SetFilter (UINT nFilterType) |
|
int | HasFilter () |
|
BitmapFilter * | Filter () |
|
BMMExport int | SetStorage (BitmapStorage *pstorage) |
|
BitmapStorage * | Storage () |
|
void | NullStorage () |
|
|
|
BMMExport int | Display (const MCHAR *title=NULL, int position=BMM_CN, BOOL autonomous=FALSE, BOOL savebutton=TRUE, CropCallback *crop=NULL, Bitmap *cloneMyVFB=NULL) |
|
BMMExport int | UnDisplay () |
|
BMMExport HWND | GetWindow () |
|
BMMExport void | RefreshWindow (RECT *rect=NULL) |
|
BMMExport void | SetWindowTitle (const MCHAR *title) |
|
BMMExport void | SetCroppingValues (float u, float v, float w, float h, BOOL placeImage) |
|
BMMExport BOOL | IsAutonomousVFB () |
|
|
BMMExport int | Fill (int r, int g, int b, int alpha) |
|
BMMExport void | Print (bool silent=false) |
|
BMMExport void | ShowProgressLine (int y) |
|
|
|
BMMExport void | SetNotify (BitmapNotify *bmnot=NULL) |
|
BitmapNotify * | GetNotify () |
|
|
BMMExport INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
|
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...
|
|
Tab< BaseInterface * > | interfaces |
|