OpenDaVINCI  4.15.3
odcore::data::image::CompressedImage Class Reference

#include <CompressedImage.h>

Inheritance diagram for odcore::data::image::CompressedImage:
Inheritance graph

Public Member Functions

 CompressedImage ()
 
 CompressedImage (const string &name, const uint32_t &width, const uint32_t &height, const uint32_t &bpp, const uint32_t &compressedSize)
 
virtual ~CompressedImage ()
 
 CompressedImage (const CompressedImage &obj)
 
CompressedImageoperator= (const CompressedImage &obj)
 
const string getName () const
 
void setName (const string &name)
 
uint32_t getWidth () const
 
void setWidth (const uint32_t &width)
 
uint32_t getHeight () const
 
void setHeight (const uint32_t &height)
 
uint32_t getBytesPerPixel () const
 
void setBytesPerPixel (const uint32_t &bytesPerPixel)
 
uint32_t getSize () const
 
uint32_t getCompressedSize () const
 
uint8_t * getRawData () const
 
virtual ostream & operator<< (ostream &out) const
 
virtual istream & operator>> (istream &in)
 
virtual int32_t getID () const
 
virtual const string getShortName () const
 
virtual const string getLongName () const
 
virtual const string toString () const
 
virtual void accept (odcore::base::Visitor &v)
 

Static Public Member Functions

static int32_t ID ()
 
static const string ShortName ()
 
static const string LongName ()
 

Detailed Description

This class provides information about a compressed image using JPEG encoding based on IJG.

Constructor & Destructor Documentation

odcore::data::image::CompressedImage::CompressedImage ( )
odcore::data::image::CompressedImage::CompressedImage ( const string &  name,
const uint32_t &  width,
const uint32_t &  height,
const uint32_t &  bpp,
const uint32_t &  compressedSize 
)

Constructor that allocates the memory to store image data. At disposal, this memory is released again.

Parameters
name
width
height
bppBytes per pixel
compressedSizebytes of the compressed image
odcore::data::image::CompressedImage::~CompressedImage ( )
virtual
odcore::data::image::CompressedImage::CompressedImage ( const CompressedImage obj)

Copy constructor.

Parameters
objReference to an object of this class.

References getCompressedSize(), getRawData(), and OPENDAVINCI_CORE_DELETE_ARRAY.

Member Function Documentation

uint32_t odcore::data::image::CompressedImage::getBytesPerPixel ( ) const

This method returns the image's bytes per pixel.

Returns
Image's bytes per pixel.

Referenced by getSize(), operator<<(), operator=(), and toString().

uint32_t odcore::data::image::CompressedImage::getCompressedSize ( ) const

This method returns the image's compressed size in bytes.

Returns
Image's compressed size in bytes.

Referenced by CompressedImage(), operator<<(), operator=(), and toString().

uint32_t odcore::data::image::CompressedImage::getHeight ( ) const

This method returns the image's height.

Returns
Image's height.

Referenced by getSize(), operator<<(), operator=(), and toString().

int32_t odcore::data::image::CompressedImage::getID ( ) const
virtual

This method returns the message ID.

Returns
Message identifier.

Implements odcore::data::SerializableData.

const string odcore::data::image::CompressedImage::getLongName ( ) const
virtual

This method returns the message name including namespace.

Returns
Message name including namespace.

Implements odcore::data::SerializableData.

const string odcore::data::image::CompressedImage::getName ( ) const

This method returns the image's name.

Returns
Image's name.

Referenced by operator<<(), operator=(), and toString().

uint8_t * odcore::data::image::CompressedImage::getRawData ( ) const

This method returns the pointer to the image's raw data.

Returns
Image's bytes per pixel.

Referenced by CompressedImage(), and operator=().

const string odcore::data::image::CompressedImage::getShortName ( ) const
virtual

This method returns the message name.

Returns
Message name.

Implements odcore::data::SerializableData.

uint32_t odcore::data::image::CompressedImage::getSize ( ) const

This method returns the image's size in bytes.

Returns
Image's uncompressed size in bytes.

References getBytesPerPixel(), getHeight(), and getWidth().

uint32_t odcore::data::image::CompressedImage::getWidth ( ) const

This method returns the image's width.

Returns
Image's width.

Referenced by getSize(), operator<<(), operator=(), and toString().

int32_t odcore::data::image::CompressedImage::ID ( )
static

Referenced by accept().

const string odcore::data::image::CompressedImage::LongName ( )
static

Referenced by accept().

ostream & odcore::data::image::CompressedImage::operator<< ( ostream &  out) const
virtual

This method needs to be used to serialize data.

Parameters
outostream to serialize data to.
Returns
The ostream.

Implements odcore::serialization::Serializable.

References getBytesPerPixel(), getCompressedSize(), getHeight(), odcore::serialization::SerializationFactory::getInstance(), getName(), odcore::serialization::SerializationFactory::getSerializer(), and getWidth().

CompressedImage & odcore::data::image::CompressedImage::operator= ( const CompressedImage obj)

Assignment operator.

Parameters
objReference to an object of this class.
Returns
Reference to this instance.

References getBytesPerPixel(), getCompressedSize(), getHeight(), getName(), getRawData(), getWidth(), OPENDAVINCI_CORE_DELETE_ARRAY, setBytesPerPixel(), setHeight(), setName(), and setWidth().

istream & odcore::data::image::CompressedImage::operator>> ( istream &  in)
virtual

This method needs to be used to deserialize data.

Parameters
inistream to deserialize data from.
Returns
The istream.

Implements odcore::serialization::Serializable.

References odcore::serialization::SerializationFactory::getDeserializer(), odcore::serialization::SerializationFactory::getInstance(), and OPENDAVINCI_CORE_DELETE_ARRAY.

void odcore::data::image::CompressedImage::setBytesPerPixel ( const uint32_t &  bytesPerPixel)

This method sets the image's bytes per pixel.

Parameters
bytesPerPixelImage's bytes per pixel.

Referenced by operator=().

void odcore::data::image::CompressedImage::setHeight ( const uint32_t &  height)

This method sets the image's height.

Parameters
heightImage's height.

Referenced by operator=().

void odcore::data::image::CompressedImage::setName ( const string &  name)

This method sets the image's name.

Parameters
nameImage's name.

Referenced by operator=().

void odcore::data::image::CompressedImage::setWidth ( const uint32_t &  width)

This method sets the image's width.

Parameters
widthImage's width.

Referenced by operator=().

const string odcore::data::image::CompressedImage::ShortName ( )
static

Referenced by accept().

const string odcore::data::image::CompressedImage::toString ( ) const
virtual

This method returns a human readable format of the contained data.

Returns
Human readable representation.

Implements odcore::data::SerializableData.

References getBytesPerPixel(), getCompressedSize(), getHeight(), getName(), and getWidth().