#include <ImFusion/Base/ImageCompression.h>
Saving and loading of compressed image data.
More...
Saving and loading of compressed image data.
|
| ImageCompression (SharedImageSet *is, const ImageDescriptor &desc, int frames=1) |
| Constructor for loading data with empty image set container.
|
|
| ImageCompression (SharedImageSet *is) |
| Constructor with an allocated image set container to load, analyze or save.
|
|
| ~ImageCompression () |
| Destructor deleting auxiliary variables but not image data.
|
|
void | setProgress (Progress *p) |
| Set optional progress callback.
|
|
void | setOptions (int numRuns, int diffRX, int diffRY) |
| Set options for thorough compression.
|
|
unsigned long long | analyze () |
| Process the image data with given settings and return predicted size in KB.
|
|
unsigned long long | size (int mode) const |
| Return size in KB for a given compression mode after analysis.
|
|
int | scaling () const |
| Return the integer intensity scaling that was found during analysis.
|
|
bool | load (std::istream &file) |
| Loads a compressed image from file.
|
|
bool | save (std::ostream &file, bool borderRLE) |
| Save an image set using thorough compression, return true upon success.
|
|
bool | saveOnTheFly (std::ostream &file, const MemImage *img) |
| Save an image or single image frame right on the fly.
|
|
|
static bool | compress (const MemImage *img, int mode, int level, unsigned char *buffer, int &bufferSize) |
| Compress image.
|
|
static bool | uncompress (unsigned char *buffer, int bufferSize, int mode, MemImage *img) |
| Uncompress image.
|
|
◆ saveOnTheFly()
Save an image or single image frame right on the fly.
The numRuns parameter is ignored, full 8 or 16 bit range is assumed for default Huffman codes, previous frame codes are disabled.
◆ compress()
static bool compress |
( |
const MemImage * | img, |
|
|
int | mode, |
|
|
int | level, |
|
|
unsigned char * | buffer, |
|
|
int & | bufferSize ) |
|
static |
Compress image.
- Parameters
-
| img | image to compress |
| mode | compression mode: 0 = zlib default strategy, 1 = zlib huffman, 2 = zlib rle, 3 = png |
| level | compression level ranging from 0 (no compression) to 9 (maximum compression). Has no effect for huffman and rle mode |
[out] | buffer | output buffer. Size should be at least twice the size of the input image in bytes |
[in,out] | bufferSize | size of provided output buffer on input, number of bytes written on return |
- Returns
- true if successful, false otherwise
◆ uncompress()
static bool uncompress |
( |
unsigned char * | buffer, |
|
|
int | bufferSize, |
|
|
int | mode, |
|
|
MemImage * | img ) |
|
static |
Uncompress image.
- Parameters
-
| buffer | input buffer |
| bufferSize | size of input buffer |
| mode | compression mode: 0 = zlib default strategy, 1 = zlib huffman, 2 = zlib rle, 3 = png |
[out] | img | uncompressed image |
- Returns
- true if successful, false otherwise
The documentation for this class was generated from the following file:
- ImFusion/Base/ImageCompression.h