Image Component Library (ICL)
Public Types | Static Public Member Functions | List of all members
icl::core::ImageSerializer Struct Reference

Utility class for binary Image Serialization. More...

#include <ImageSerializer.h>

Public Types

typedef std::vector< icl8uImageHeader
 Internally used type for image headers. More...
 

Static Public Member Functions

static int getHeaderSize ()
 returns the size of an image header (in Bytes) More...
 
static int estimateImageDataSize (const ImgBase *image)
 estimates the size for the image data of an serialized image More...
 
static int estimateSerializedSize (const ImgBase *image, bool skipMetaData=false)
 estimates the full size of an serialized image More...
 
static ImageHeader createHeader (const ImgBase *image)
 creates an image header from given image More...
 
static void serialize (const ImgBase *image, icl8u *dst, const ImageHeader &header=ImageHeader(), bool skipMetaData=false)
 serializes an image into given destination data-points (which has to be long enough) More...
 
static void serialize (const ImgBase *image, std::vector< icl8u > &data, const ImageHeader &header=ImageHeader(), bool skipMetaData=false)
 serializes an image into given vector (the vector size is adapted automatically) More...
 
static void deserialize (const icl8u *data, ImgBase **dst)
 deserializes an image (and optionally also the meta-data) from given icl8u data block More...
 
static utils::Time deserializeTimeStamp (const icl8u *data)
 extracts only an images TimeStamp from it's serialized form More...
 

Detailed Description

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  ->

Member Typedef Documentation

◆ ImageHeader

Internally used type for image headers.

Member Function Documentation

◆ createHeader()

static ImageHeader icl::core::ImageSerializer::createHeader ( const ImgBase image)
static

creates an image header from given image

◆ deserialize()

static void icl::core::ImageSerializer::deserialize ( const icl8u data,
ImgBase **  dst 
)
static

deserializes an image (and optionally also the meta-data) from given icl8u data block

◆ deserializeTimeStamp()

static utils::Time icl::core::ImageSerializer::deserializeTimeStamp ( const icl8u data)
static

extracts only an images TimeStamp from it's serialized form

◆ estimateImageDataSize()

static int icl::core::ImageSerializer::estimateImageDataSize ( const ImgBase image)
static

estimates the size for the image data of an serialized image

◆ estimateSerializedSize()

static int icl::core::ImageSerializer::estimateSerializedSize ( const ImgBase image,
bool  skipMetaData = false 
)
static

estimates the full size of an serialized image

◆ getHeaderSize()

static int icl::core::ImageSerializer::getHeaderSize ( )
static

returns the size of an image header (in Bytes)

◆ serialize() [1/2]

static void icl::core::ImageSerializer::serialize ( const ImgBase image,
icl8u dst,
const ImageHeader header = ImageHeader(),
bool  skipMetaData = false 
)
static

serializes an image into given destination data-points (which has to be long enough)

◆ serialize() [2/2]

static void icl::core::ImageSerializer::serialize ( const ImgBase image,
std::vector< icl8u > &  data,
const ImageHeader header = ImageHeader(),
bool  skipMetaData = false 
)
static

serializes an image into given vector (the vector size is adapted automatically)


The documentation for this struct was generated from the following file: