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.
- 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.
- Method Groups:
- See Method Groups for Class Bitmap.
- 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) |
|
BMMExport void | DeleteThis () |
|
DWORD | Flags () |
|
void | SetFlag (DWORD flag) |
|
void | ToggleFlag (DWORD flag) |
|
void | ClearFlag (DWORD flag) |
|
int | Width () |
|
int | Height () |
|
float | Aspect () |
|
float | Gamma () |
|
int | Paletted () |
|
int | IsDithered () |
|
int | PreMultipliedAlpha () |
|
int | HasAlpha () |
|
int | IsHighDynamicRange () |
|
int | MaxRGBLevel () |
|
int | MaxAlphaLevel () |
|
void | UseScaleColors (int on) |
|
int | ScaleColors () |
|
void | ClampScaleColor (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
void | ClampScaleColorA (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
int | Put16Gray (int x, int y, int pixels, WORD *ptr) |
|
int | Put16Gray (int x, int y, int pixels, float *ptr) |
|
void * | GetStoragePtr (int *type) |
|
void * | GetAlphaPtr (int *type) |
|
int | Get16Gray (int x, int y, int pixels, WORD *ptr) |
|
int | Get16Gray (int x, int y, int pixels, float *ptr) |
|
int | GetPixels (int x, int y, int pixels, BMM_Color_64 *ptr) |
|
int | GetPixels (int x, int y, int pixels, BMM_Color_fl *ptr) |
|
BMMExport int | PutPixels (int x, int y, int pixels, BMM_Color_64 *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 | GetLinearPixels (int x, int y, int pixels, BMM_Color_fl *ptr) |
|
int | GetIndexPixels (int x, int y, int pixels, BYTE *ptr) |
|
int | PutIndexPixels (int x, int y, int pixels, BYTE *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 | 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, BMM_Color_fl fillcolor, BitmapInfo *bi=NULL) |
|
int | CopyImage (Bitmap *from, int operation, int fillindex) |
|
int | GetPalette (int start, int count, BMM_Color_48 *ptr) |
|
int | SetPalette (int start, int count, BMM_Color_48 *ptr) |
|
BMMExport void | FilmGrain (float grain, BOOL mask, PBITMAP_FX_CALLBACK callback=NULL, void *param=NULL) |
|
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 BOOL | PrepareGChannels (DWORD channels) |
|
BMMExport int | GetFiltered (float u, float v, float du, float dv, BMM_Color_64 *ptr) |
|
BMMExport int | GetFiltered (float u, float v, float du, float dv, BMM_Color_fl *ptr) |
|
BMMExport int | SetDither (UINT ditherType) |
|
BMMExport int | SetFilter (UINT filterType) |
|
int | HasFilter () |
|
BitmapFilter * | Filter () |
|
BMMExport int | SetStorage (BitmapStorage *storage) |
|
BitmapStorage * | Storage () |
|
void | NullStorage () |
|
BMMExport PBITMAPINFO | ToDib (int depth=24, UWORD *gam=NULL, BOOL dither=FALSE, BOOL displayGamma=FALSE) |
|
BMMExport BOOL | FromDib (PBITMAPINFO pbmi) |
|
BMMExport BMMRES | OpenOutput (BitmapInfo *bi) |
| Opens the image for output. More...
|
|
BMMExport BMMRES | Write (BitmapInfo *bi, int frame=BMM_SINGLEFRAME) |
| Write the image from BitmapStorage to disk. More...
|
|
BMMExport BMMRES | WriteAll (int frame=BMM_SINGLEFRAME) |
|
BMMExport int | Close (BitmapInfo *bi, int flag=BMM_CLOSE_COMPLETE) |
|
BMMExport int | CloseAll (int flag=BMM_CLOSE_COMPLETE) |
|
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 BMMRES | GoTo (BitmapInfo *bi) |
|
BMMExport int | Fill (int r, int g, int b, int alpha) |
|
BMMExport int | Fill (const BMM_Color_fl &fillColor) |
|
BMMExport int | Fill (const BMM_Color_64 &fillColor) |
|
BMMExport void | SetNotify (BitmapNotify *bmnot=NULL) |
|
BitmapNotify * | GetNotify () |
|
BMMExport BOOL | IsAutonomousVFB () |
|
BMMExport INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
|
DWORD | GetModifyID () |
|
void | SetModifyID (DWORD m) |
|
BMMExport void | IncrModifyID () |
|
BMMExport void | Print (bool silent=false) |
|
BMMExport void | ShowProgressLine (int y) |
|
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 void | ClampColor (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
static void | ClampColorA (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
static void | ScaleColor (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
static void | ScaleColorA (BMM_Color_64 &out, const BMM_Color_fl &in) |
|
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...
|
|