#include <bitmapfilebuffer.h>
Public Types | |
| enum | EImageFileFormat : int { PNG, JPEG, TIFF, BMP } |
Public Member Functions | |
| BitmapFileBuffer () | |
| BitmapFileBuffer (const Bitmap &bitmap, bool copyData) | |
| BitmapFileBuffer (const SurfaceDescriptor &surfaceDescriptor, const void *data, bool copyData) | |
| BitmapFileBuffer (const SurfaceDescriptor &surfaceDescriptor) | |
| ~BitmapFileBuffer () | |
| BitmapFileBuffer (const BitmapFileBuffer &rhs)=delete | |
| BitmapFileBuffer & | operator= (const BitmapFileBuffer &rhs)=delete |
| BitmapFileBuffer (BitmapFileBuffer &&rhs)=delete | |
| BitmapFileBuffer & | operator= (BitmapFileBuffer &&rhs)=delete |
| bool | load (const std::string &path, SurfaceDescriptor &outSurfaceDescriptor, utility::ErrorState &errorState) |
| bool | save (const std::string &path, utility::ErrorState &errorState) |
| void * | getData () |
| void * | getHandle () |
Bitmap extension class that encodes/decodes image data for writing to/reading from disk.
|
strong |
| BitmapFileBuffer | ( | ) |
Creates an empty bitmap file buffer
| BitmapFileBuffer | ( | const Bitmap & | bitmap, |
| bool | copyData | ||
| ) |
Creates a bitmap file buffer from a bitmap
| bitmap | the source bitmap |
| copyData | if true, allocates an additional file buffer to copy the bitmap data to, else wraps the image data |
| BitmapFileBuffer | ( | const SurfaceDescriptor & | surfaceDescriptor, |
| const void * | data, | ||
| bool | copyData | ||
| ) |
Creates a bitmap file buffer from a bitmap
| surfaceDescriptor | the surface descriptor used to allocate the file buffer |
| data | a pointer to the raw bitmap data |
| copyData | if true, allocates an additional file buffer to copy the bitmap data to, else wraps the image data |
| BitmapFileBuffer | ( | const SurfaceDescriptor & | surfaceDescriptor | ) |
Creates a bitmap file buffer from a surface descriptor
| surfaceDescriptor | the surface descriptor used to allocate the file buffer |
| ~BitmapFileBuffer | ( | ) |
Unloads the internal bitmap handle
|
delete |
BitmapFileBuffer cannot be copied
|
delete |
BitmapFileBuffer cannot be moved
| void* getData | ( | ) |
Returns a pointer to the internal pixel data
| void* getHandle | ( | ) |
Returns a handle to the FreeImage bitmap. This comprises the FreeImage info header and pixel data Cast to a FIBITMAP pointer as follows:
| bool load | ( | const std::string & | path, |
| SurfaceDescriptor & | outSurfaceDescriptor, | ||
| utility::ErrorState & | errorState | ||
| ) |
Loads an image from disk and creates the bitmap file buffer
| path | the path to the image on disk to load |
| outSurfaceDescriptor | the surface descriptor containing information about the image |
| errorState | contains the error if the image could not be loaded from disk |
|
delete |
|
delete |
| bool save | ( | const std::string & | path, |
| utility::ErrorState & | errorState | ||
| ) |
Writes this bitmap to the given location on disk with the specified image format
| path | the path including filename and image extension of the output file e.g. "targetFolder/MyOutputFile.png" |
| errorState | contains the error if the image could not be saved to disk |