Utility class used to perform image operations in software. Not using GPU / hardware acceleration.
#include <graphics/YiBitmapUtilities.h>
Public Types | |
| enum | ORIENTATION { DEGREES_90, DEGREES_180, DEGREES_270, VERTICAL_FLIP, HORIZONTAL_FLIP } |
Static Public Member Functions | |
| static bool | RGB2BGR (CYIBitmap *pBitmap) |
| static bool | Reorient (CYIBitmap *pBitmap, ORIENTATION angle) |
| static bool | SavePNG (const CYIBitmap *pBitmap, const CYIString &filename) |
| static bool | BitmapToPNG (const CYIBitmap *pBitmap, std::vector< uint8_t > *pOut) |
| static bool | AddBitmaps (CYIBitmap *pBitmapDest, const CYIBitmap *pBitmapSrc) |
| static bool | SubtractBitmaps (CYIBitmap *pBitmapDest, const CYIBitmap *pBitmapSrc) |
Used by Reorient() to determine how to rotate or flip the image.
|
static |
Adds two 32-bit buffers of the same size. Adds each pixel in pBitmapSrc to pBitmapDest and replaces the pixels in pBitmapDest with the result.
Returns true if successful. Returns false if pBitmapDest or pBitmapSrc is nullptr.
Returns false if pBitmapDest and pBitmapSrc differ in size.
Returns false if pBitmapDest and pBitmapSrc is not 32-bit images.
|
static |
Converts pBitmap to a PNG vector.
Returns true if the conversion is successful.
Returns false if pBitmap is not a 32-bit image or if the conversion fails.
|
static |
Performs a transformation on pBitmap as defined in angle.
|
static |
Converts all the pixels of pBitmap from RGB color to BGR color.
Returns true for a successful conversion.
Returns false if pBitmap is nullptr.
|
static |
Save pBitmap to a file named filename. This function only works for 32-bit images.
Returns true if the file was successfully saved.
Returns false if the saves fails.
Returns false if pBitmap is not a 32-bit image.
|
static |
Subtracts two 32-bit buffers of the same size. Subtracts each pixel in pBitmapSrc to pBitmapDest and replaces the pixels in pBitmapDest with the result.
Returns true if successful. Returns false if pBitmapDest or pBitmapSrc is nullptr.
Returns false if pBitmapDest and pBitmapSrc differ in size.
Returns false if pBitmapDest and pBitmapSrc is not 32-bit images.