Tango Core Classes Reference  9.3.4
Tango::EncodedAttribute Class Reference

This class provides method to deal with Tango::DevEncoded attribute format. More...

#include "tango.h"

Public Member Functions

Constructors

Miscellaneous constructors

 EncodedAttribute ()
 Create a new EncodedAttribute object.
 
 EncodedAttribute (int buf_pool_size, bool serialization=false)
 Create a new EncodedAttribute object with a user defined buffer pool. More...
 
Destructor

Only one desctructor is defined for this class

 ~EncodedAttribute ()
 The attribute desctructor.
 
Image Encoding Methods
void encode_jpeg_gray8 (unsigned char *gray8, int width, int height, double quality)
 Encode a 8 bit grayscale image as JPEG format. More...
 
void encode_jpeg_rgb32 (unsigned char *rgb32, int width, int height, double quality)
 Encode a 32 bit rgb color image as JPEG format. More...
 
void encode_jpeg_rgb24 (unsigned char *rgb24, int width, int height, double quality)
 Encode a 24 bit rgb color image as JPEG format. More...
 
void encode_gray8 (unsigned char *gray8, int width, int height)
 Encode a 8 bit grayscale image (no compression) More...
 
void encode_gray16 (unsigned short *gray16, int width, int height)
 Encode a 16 bit grayscale image (no compression) More...
 
void encode_rgb24 (unsigned char *rgb24, int width, int height)
 Encode a 24 bit color image (no compression) More...
 

Image Decoding Methods

void decode_rgb32 (DeviceAttribute *attr, int *width, int *height, unsigned char **rgb32)
 Decode a color image (JPEG_RGB or RGB24) and returns a 32 bits RGB image. More...
 
void decode_gray8 (DeviceAttribute *attr, int *width, int *height, unsigned char **gray8)
 Decode a 8 bits grayscale image (JPEG_GRAY8 or GRAY8) and returns a 8 bits gray scale image. More...
 
void decode_gray16 (DeviceAttribute *attr, int *width, int *height, unsigned short **gray16)
 Decode a 16 bits grayscale image (GRAY16) and returns a 16 bits gray scale image. More...
 

Detailed Description

This class provides method to deal with Tango::DevEncoded attribute format.

Constructor & Destructor Documentation

◆ EncodedAttribute()

Tango::EncodedAttribute::EncodedAttribute ( int  buf_pool_size,
bool  serialization = false 
)

Create a new EncodedAttribute object with a user defined buffer pool.

This constructor allows the user to define the size of the buffer pool used to store the encoded images. This buffer pool is managed as a circular pool. A different buffer is used each time an image is encoded. The last used buffer is then passed to the attribute with the attribute::set_value() method

Parameters
buf_pool_sizeBuffer pool size
serializationSet to true if the instance manage the data buffer serialization

Member Function Documentation

◆ decode_gray16()

void Tango::EncodedAttribute::decode_gray16 ( DeviceAttribute attr,
int *  width,
int *  height,
unsigned short **  gray16 
)

Decode a 16 bits grayscale image (GRAY16) and returns a 16 bits gray scale image.

Throws DevFailed in case of failure.

Parameters
attrDeviceAttribute that contains the image
widthWidth of the image
heightHeight of the image
gray16Image (memory allocated by the function)

◆ decode_gray8()

void Tango::EncodedAttribute::decode_gray8 ( DeviceAttribute attr,
int *  width,
int *  height,
unsigned char **  gray8 
)

Decode a 8 bits grayscale image (JPEG_GRAY8 or GRAY8) and returns a 8 bits gray scale image.

Throws DevFailed in case of failure.

Parameters
attrDeviceAttribute that contains the image
widthWidth of the image
heightHeight of the image
gray8Image (memory allocated by the function)

◆ decode_rgb32()

void Tango::EncodedAttribute::decode_rgb32 ( DeviceAttribute attr,
int *  width,
int *  height,
unsigned char **  rgb32 
)

Decode a color image (JPEG_RGB or RGB24) and returns a 32 bits RGB image.

Throws DevFailed in case of failure.

Parameters
attrDeviceAttribute that contains the image
widthWidth of the image
heightHeight of the image
rgb32Image (memory allocated by the function)

◆ encode_gray16()

void Tango::EncodedAttribute::encode_gray16 ( unsigned short *  gray16,
int  width,
int  height 
)

Encode a 16 bit grayscale image (no compression)

Parameters
gray16Array of 16bit gray sample
widthThe image width
heightThe image height

◆ encode_gray8()

void Tango::EncodedAttribute::encode_gray8 ( unsigned char *  gray8,
int  width,
int  height 
)

Encode a 8 bit grayscale image (no compression)

Parameters
gray8Array of 8bit gray sample
widthThe image width
heightThe image height

◆ encode_jpeg_gray8()

void Tango::EncodedAttribute::encode_jpeg_gray8 ( unsigned char *  gray8,
int  width,
int  height,
double  quality 
)

Encode a 8 bit grayscale image as JPEG format.

Parameters
gray8Array of 8bit gray sample
widthThe image width
heightThe image height
qualityQuality of JPEG (0=poor quality 100=max quality)

◆ encode_jpeg_rgb24()

void Tango::EncodedAttribute::encode_jpeg_rgb24 ( unsigned char *  rgb24,
int  width,
int  height,
double  quality 
)

Encode a 24 bit rgb color image as JPEG format.

Parameters
rgb24Array of 32bit RGB sample (RGBRGB...)
widthThe image width
heightThe image height
qualityQuality of JPEG (0=poor quality 100=max quality)

◆ encode_jpeg_rgb32()

void Tango::EncodedAttribute::encode_jpeg_rgb32 ( unsigned char *  rgb32,
int  width,
int  height,
double  quality 
)

Encode a 32 bit rgb color image as JPEG format.

Parameters
rgb32Array of 32bit RGB sample (RGB0RGB0...)
widthThe image width
heightThe image height
qualityQuality of JPEG (0=poor quality 100=max quality)

◆ encode_rgb24()

void Tango::EncodedAttribute::encode_rgb24 ( unsigned char *  rgb24,
int  width,
int  height 
)

Encode a 24 bit color image (no compression)

Parameters
rgb24Array of 24bit RGB sample
widthThe image width
heightThe image height

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