Image Component Library (ICL)
|
Utility class for binary Image Serialization. More...
#include <ImageSerializer.h>
Public Types | |
typedef std::vector< icl8u > | ImageHeader |
Internally used type for image headers. | |
Static Public Member Functions | |
static int | getHeaderSize () |
returns the size of an image header (in Bytes) | |
static int | estimateImageDataSize (const ImgBase *image) throw (utils::ICLException) |
estimates the size for the image data of an serialized image | |
static int | estimateSerializedSize (const ImgBase *image, bool skipMetaData=false) throw (utils::ICLException) |
estimates the full size of an serialized image | |
static ImageHeader | createHeader (const ImgBase *image) throw (utils::ICLException) |
creates an image header from given image | |
static void | serialize (const ImgBase *image, icl8u *dst, const ImageHeader &header=ImageHeader(), bool skipMetaData=false) throw (utils::ICLException) |
serializes an image into given destination data-points (which has to be long enough) | |
static void | serialize (const ImgBase *image, std::vector< icl8u > &data, const ImageHeader &header=ImageHeader(), bool skipMetaData=false) throw (utils::ICLException) |
serializes an image into given vector (the vector size is adapted automatically) | |
static void | deserialize (const icl8u *data, ImgBase **dst) throw (utils::ICLException) |
deserializes an image (and optionally also the meta-data) from given icl8u data block | |
static utils::Time | deserializeTimeStamp (const icl8u *data) throw (utils::ICLException) |
extracts only an images TimeStamp from it's serialized form |
Utility class for binary Image Serialization.
Images are serialized into one binary data block as follows:
Whole-Image: [Header-Block][Channel-0-Data][Channel-1-Data][ ... ][Meta-Data] <- 44 Bytes -><- Channels x dim x sizeof(datatype) ->
The Header-Block contains a binary representation of all image properties:
Header-Block: [depth][width][height][format][channels][roi.x][roi.y][roi.width][roi.height][time-stamp] <- 4 -><- 4 -><- 4 -><- 4 -><- 4 -><- 4 -><- 4 -><- 4 -><- 4 -><- 8 -> (in Bytes)
Finally the optional meta-data block can be used to attach additional information to images:
Meta-Data-Block: [size][Meta-Data] <-4 -><- size ->
typedef std::vector<icl8u> icl::core::ImageSerializer::ImageHeader |
Internally used type for image headers.
static ImageHeader icl::core::ImageSerializer::createHeader | ( | const ImgBase * | image | ) | throw (utils::ICLException) [static] |
creates an image header from given image
static void icl::core::ImageSerializer::deserialize | ( | const icl8u * | data, |
ImgBase ** | dst | ||
) | throw (utils::ICLException) [static] |
deserializes an image (and optionally also the meta-data) from given icl8u data block
static utils::Time icl::core::ImageSerializer::deserializeTimeStamp | ( | const icl8u * | data | ) | throw (utils::ICLException) [static] |
extracts only an images TimeStamp from it's serialized form
static int icl::core::ImageSerializer::estimateImageDataSize | ( | const ImgBase * | image | ) | throw (utils::ICLException) [static] |
estimates the size for the image data of an serialized image
static int icl::core::ImageSerializer::estimateSerializedSize | ( | const ImgBase * | image, |
bool | skipMetaData = false |
||
) | throw (utils::ICLException) [static] |
estimates the full size of an serialized image
static int icl::core::ImageSerializer::getHeaderSize | ( | ) | [static] |
returns the size of an image header (in Bytes)
static void icl::core::ImageSerializer::serialize | ( | const ImgBase * | image, |
icl8u * | dst, | ||
const ImageHeader & | header = ImageHeader() , |
||
bool | skipMetaData = false |
||
) | throw (utils::ICLException) [static] |
serializes an image into given destination data-points (which has to be long enough)
static void icl::core::ImageSerializer::serialize | ( | const ImgBase * | image, |
std::vector< icl8u > & | data, | ||
const ImageHeader & | header = ImageHeader() , |
||
bool | skipMetaData = false |
||
) | throw (utils::ICLException) [static] |
serializes an image into given vector (the vector size is adapted automatically)