Tango Core Classes Reference
9.3.4
|
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... | |
This class provides method to deal with Tango::DevEncoded attribute format.
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
buf_pool_size | Buffer pool size |
serialization | Set to true if the instance manage the data buffer serialization |
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.
attr | DeviceAttribute that contains the image |
width | Width of the image |
height | Height of the image |
gray16 | Image (memory allocated by the function) |
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.
attr | DeviceAttribute that contains the image |
width | Width of the image |
height | Height of the image |
gray8 | Image (memory allocated by the function) |
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.
attr | DeviceAttribute that contains the image |
width | Width of the image |
height | Height of the image |
rgb32 | Image (memory allocated by the function) |
void Tango::EncodedAttribute::encode_gray16 | ( | unsigned short * | gray16, |
int | width, | ||
int | height | ||
) |
Encode a 16 bit grayscale image (no compression)
gray16 | Array of 16bit gray sample |
width | The image width |
height | The image height |
void Tango::EncodedAttribute::encode_gray8 | ( | unsigned char * | gray8, |
int | width, | ||
int | height | ||
) |
Encode a 8 bit grayscale image (no compression)
gray8 | Array of 8bit gray sample |
width | The image width |
height | The image height |
void Tango::EncodedAttribute::encode_jpeg_gray8 | ( | unsigned char * | gray8, |
int | width, | ||
int | height, | ||
double | quality | ||
) |
Encode a 8 bit grayscale image as JPEG format.
gray8 | Array of 8bit gray sample |
width | The image width |
height | The image height |
quality | Quality of JPEG (0=poor quality 100=max quality) |
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.
rgb24 | Array of 32bit RGB sample (RGBRGB...) |
width | The image width |
height | The image height |
quality | Quality of JPEG (0=poor quality 100=max quality) |
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.
rgb32 | Array of 32bit RGB sample (RGB0RGB0...) |
width | The image width |
height | The image height |
quality | Quality of JPEG (0=poor quality 100=max quality) |
void Tango::EncodedAttribute::encode_rgb24 | ( | unsigned char * | rgb24, |
int | width, | ||
int | height | ||
) |
Encode a 24 bit color image (no compression)
rgb24 | Array of 24bit RGB sample |
width | The image width |
height | The image height |