|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
Transportable image update: either a full frame or a compressed (RLE and/or difference) delta against a previous frame. More...
#include <Bitmap.h>
Public Types | |
| enum | Type { FULL , RUNLENGTH , RL16 , DIF , DIFRUNLENGTH , NONE } |
| Payload encoding: FULL raw frame, RUNLENGTH RLE frame, RL16 16-bit RLE, DIF raw difference, DIFRUNLENGTH RLE difference, NONE empty. More... | |
Public Member Functions | |
| BitmapUpdate () | |
| Empty update. | |
| BitmapUpdate (uint32 w, uint32 h) | |
| Pre-sized update for a w x h frame. | |
| BitmapUpdate (const char *filename, bool compress) | |
| Load a BMP file as an update. | |
| virtual | ~BitmapUpdate () |
| bool | init (uint32 w, uint32 h) |
| (Re)initialize for a w x h frame. | |
| bool | reset () |
| Release the payload. | |
| bool | update (BitmapUpdate *update) |
| Merge a newer update into this one. | |
| Bitmap * | toBitmap () |
| Decode into a new full Bitmap (caller owns); requires a FULL-equivalent payload. | |
| bool | setUpdateType (BitmapUpdate::Type updateType) |
| Set the payload encoding tag. | |
| BitmapUpdate::Type | getUpdateType () |
| bool | setFullUpdate (Bitmap *bitmap) |
Fill as an uncompressed full frame from bitmap. | |
| bool | readFromFile (const char *filename) |
| Load a BMP file as a FULL update. | |
| bool | readFromFileRLE (const char *filename) |
| Load a BMP file and RLE-compress it. | |
| bool | readFromFileDiff (const char *filename, Bitmap *oldBitmap) |
Load a BMP file and store the difference against oldBitmap. | |
| bool | readFromFileRLEDiff (const char *filename, Bitmap *oldBitmap) |
Load, difference against oldBitmap and RLE-compress. | |
Public Attributes | |
| enum cmlabs::BitmapUpdate::Type | type |
| uint32 | width |
| Frame width in pixels. | |
| uint32 | height |
| Frame height in pixels. | |
| uint32 | size |
| Payload size in bytes. | |
| char * | data |
Encoded payload (interpretation depends on type). | |
Transportable image update: either a full frame or a compressed (RLE and/or difference) delta against a previous frame.
Produced by Bitmap::operator-, runLengthEncode() and getCompressedUpdate(); consumed by Bitmap::updateBitmap(). Difference-typed updates (DIF, DIFRUNLENGTH) are only meaningful when applied to a bitmap holding the exact frame they were diffed against, and of matching dimensions; applying them to anything else yields garbage pixels. Only FULL-equivalent payloads can be decoded standalone via toBitmap(). The object owns data and releases it in reset()/destructor.
| cmlabs::BitmapUpdate::BitmapUpdate | ( | ) |
Empty update.
Definition at line 4136 of file Bitmap.cpp.
References init().
Referenced by update().
| cmlabs::BitmapUpdate::BitmapUpdate | ( | uint32 | w, |
| uint32 | h ) |
| cmlabs::BitmapUpdate::BitmapUpdate | ( | const char * | filename, |
| bool | compress ) |
Load a BMP file as an update.
| filename | BMP file path. |
| compress | RLE-compress the payload. |
Definition at line 4144 of file Bitmap.cpp.
References init(), readFromFile(), and readFromFileRLE().
|
virtual |
Definition at line 4156 of file Bitmap.cpp.
References reset().
| BitmapUpdate::Type cmlabs::BitmapUpdate::getUpdateType | ( | ) |
Definition at line 4212 of file Bitmap.cpp.
References type.
Referenced by _wrap_BitmapUpdate_getUpdateType(), _wrap_BitmapUpdate_getUpdateType(), and Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1getUpdateType().
| bool cmlabs::BitmapUpdate::init | ( | uint32 | w, |
| uint32 | h ) |
(Re)initialize for a w x h frame.
Definition at line 4160 of file Bitmap.cpp.
Referenced by BitmapUpdate(), BitmapUpdate(), BitmapUpdate(), Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1init(), and setFullUpdate().
| bool cmlabs::BitmapUpdate::readFromFile | ( | const char * | filename | ) |
Load a BMP file as a FULL update.
Definition at line 4239 of file Bitmap.cpp.
References cmlabs::tagBITMAPFILEHEADER_CM::bfOffBits, cmlabs::tagBITMAPFILEHEADER_CM::bfSize, cmlabs::tagBITMAPINFOHEADER_CM::biBitCount, cmlabs::tagBITMAPINFOHEADER_CM::biCompression, cmlabs::tagBITMAPINFOHEADER_CM::biHeight, cmlabs::tagBITMAPINFOHEADER_CM::biPlanes, cmlabs::tagBITMAPINFOHEADER_CM::biSizeImage, cmlabs::tagBITMAPINFOHEADER_CM::biWidth, cmlabs::Bitmap::convertBitmapFileData(), data, FULL, height, cmlabs::utils::ReadAFile(), setUpdateType(), size, and width.
Referenced by BitmapUpdate(), and Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1readFromFile().
| bool cmlabs::BitmapUpdate::readFromFileDiff | ( | const char * | filename, |
| Bitmap * | oldBitmap ) |
Load a BMP file and store the difference against oldBitmap.
Definition at line 4373 of file Bitmap.cpp.
References cmlabs::tagBITMAPFILEHEADER_CM::bfOffBits, cmlabs::tagBITMAPFILEHEADER_CM::bfSize, cmlabs::tagBITMAPINFOHEADER_CM::biBitCount, cmlabs::tagBITMAPINFOHEADER_CM::biCompression, cmlabs::tagBITMAPINFOHEADER_CM::biHeight, cmlabs::tagBITMAPINFOHEADER_CM::biPlanes, cmlabs::tagBITMAPINFOHEADER_CM::biSizeImage, cmlabs::tagBITMAPINFOHEADER_CM::biWidth, cmlabs::Bitmap::data, data, DIF, cmlabs::Bitmap::differenceBitmapFileData(), height, cmlabs::utils::ReadAFile(), setUpdateType(), and width.
| bool cmlabs::BitmapUpdate::readFromFileRLE | ( | const char * | filename | ) |
Load a BMP file and RLE-compress it.
Definition at line 4312 of file Bitmap.cpp.
References cmlabs::tagBITMAPFILEHEADER_CM::bfOffBits, cmlabs::tagBITMAPFILEHEADER_CM::bfSize, cmlabs::tagBITMAPINFOHEADER_CM::biBitCount, cmlabs::tagBITMAPINFOHEADER_CM::biCompression, cmlabs::tagBITMAPINFOHEADER_CM::biHeight, cmlabs::tagBITMAPINFOHEADER_CM::biPlanes, cmlabs::tagBITMAPINFOHEADER_CM::biSizeImage, cmlabs::tagBITMAPINFOHEADER_CM::biWidth, cmlabs::Bitmap::convertBitmapFileDataRunLength(), data, height, cmlabs::utils::ReadAFile(), RUNLENGTH, setUpdateType(), and width.
Referenced by BitmapUpdate(), and Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1readFromFileRLE().
| bool cmlabs::BitmapUpdate::readFromFileRLEDiff | ( | const char * | filename, |
| Bitmap * | oldBitmap ) |
Load, difference against oldBitmap and RLE-compress.
Definition at line 4425 of file Bitmap.cpp.
References cmlabs::tagBITMAPFILEHEADER_CM::bfOffBits, cmlabs::tagBITMAPFILEHEADER_CM::bfSize, cmlabs::tagBITMAPINFOHEADER_CM::biBitCount, cmlabs::tagBITMAPINFOHEADER_CM::biCompression, cmlabs::tagBITMAPINFOHEADER_CM::biHeight, cmlabs::tagBITMAPINFOHEADER_CM::biPlanes, cmlabs::tagBITMAPINFOHEADER_CM::biSizeImage, cmlabs::tagBITMAPINFOHEADER_CM::biWidth, cmlabs::Bitmap::data, data, cmlabs::Bitmap::differenceBitmapFileDataRunLength(), DIFRUNLENGTH, height, cmlabs::utils::ReadAFile(), setUpdateType(), and width.
| bool cmlabs::BitmapUpdate::reset | ( | ) |
Release the payload.
Definition at line 4168 of file Bitmap.cpp.
References data, height, NONE, setUpdateType(), size, and width.
Referenced by _wrap_BitmapUpdate_reset(), _wrap_BitmapUpdate_reset(), Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1reset(), setFullUpdate(), and ~BitmapUpdate().
| bool cmlabs::BitmapUpdate::setFullUpdate | ( | Bitmap * | bitmap | ) |
Fill as an uncompressed full frame from bitmap.
Definition at line 4227 of file Bitmap.cpp.
References cmlabs::Bitmap::data, data, FULL, cmlabs::Bitmap::height, init(), reset(), setUpdateType(), cmlabs::Bitmap::size, size, and cmlabs::Bitmap::width.
| bool cmlabs::BitmapUpdate::setUpdateType | ( | BitmapUpdate::Type | updateType | ) |
Set the payload encoding tag.
Definition at line 4207 of file Bitmap.cpp.
References type.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1setUpdateType(), cmlabs::Bitmap::operator-(), readFromFile(), readFromFileDiff(), readFromFileRLE(), readFromFileRLEDiff(), reset(), cmlabs::Bitmap::runLengthDestructiveEncode(), cmlabs::Bitmap::runLengthEncode(), and setFullUpdate().
| Bitmap * cmlabs::BitmapUpdate::toBitmap | ( | ) |
Decode into a new full Bitmap (caller owns); requires a FULL-equivalent payload.
Definition at line 4203 of file Bitmap.cpp.
| bool cmlabs::BitmapUpdate::update | ( | BitmapUpdate * | update | ) |
Merge a newer update into this one.
Definition at line 4478 of file Bitmap.cpp.
References BitmapUpdate(), and update().
Referenced by _wrap_BitmapUpdate_update(), _wrap_BitmapUpdate_update(), Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1update(), and update().
| char* cmlabs::BitmapUpdate::data |
Encoded payload (interpretation depends on type).
Definition at line 347 of file Bitmap.h.
Referenced by _wrap_BitmapUpdate_data_set(), _wrap_BitmapUpdate_data_set(), Java_com_cmlabs_cmsdk_cmsdkJNI_BitmapUpdate_1data_1set(), cmlabs::Bitmap::operator-(), readFromFile(), readFromFileDiff(), readFromFileRLE(), readFromFileRLEDiff(), reset(), cmlabs::Bitmap::runLengthDestructiveEncode(), cmlabs::Bitmap::runLengthEncode(), setFullUpdate(), and cmlabs::Bitmap::updateBitmap().
| uint32 cmlabs::BitmapUpdate::height |
Frame height in pixels.
Definition at line 345 of file Bitmap.h.
Referenced by cmlabs::Bitmap::Bitmap(), init(), readFromFile(), readFromFileDiff(), readFromFileRLE(), readFromFileRLEDiff(), reset(), and cmlabs::Bitmap::updateBitmap().
| uint32 cmlabs::BitmapUpdate::size |
Payload size in bytes.
Definition at line 346 of file Bitmap.h.
Referenced by cmlabs::Bitmap::operator-(), readFromFile(), reset(), cmlabs::Bitmap::runLengthDestructiveEncode(), cmlabs::Bitmap::runLengthEncode(), setFullUpdate(), and cmlabs::Bitmap::updateBitmap().
| enum cmlabs::BitmapUpdate::Type cmlabs::BitmapUpdate::type |
Referenced by cmlabs::Bitmap::Bitmap(), getUpdateType(), setUpdateType(), and cmlabs::Bitmap::updateBitmap().
| uint32 cmlabs::BitmapUpdate::width |
Frame width in pixels.
Definition at line 344 of file Bitmap.h.
Referenced by cmlabs::Bitmap::Bitmap(), init(), readFromFile(), readFromFileDiff(), readFromFileRLE(), readFromFileRLEDiff(), reset(), and cmlabs::Bitmap::updateBitmap().