ESRF Logo

Elettra Logo

Soleil Logo

Alba Logo

Desy Logo

MAX-lab Logo

FRM2 Logo


SYNCHROTRON ALBA --- SYNCHROTRON ELETTRA

EUROPEAN SYNCHROTRON RADIATION FACILITY --- SYNCHROTRON PETRA III

SYNCHROTRON SOLEIL --- SYNCHROTRON MAX 4

NEUTRON SOURCE FRM 2

Tango::EncodedAttribute Class Reference

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

#include <encoded_attribute.h>

List of all members.

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.
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.
void encode_jpeg_rgb32 (unsigned char *rgb32, int width, int height, double quality)
 Encode a 32 bit rgb color image as JPEG format.
void encode_jpeg_rgb24 (unsigned char *rgb24, int width, int height, double quality)
 Encode a 24 bit rgb color image as JPEG format.
void encode_gray8 (unsigned char *gray8, int width, int height)
 Encode a 8 bit grayscale image (no compression).
void encode_gray16 (unsigned short *gray16, int width, int height)
 Encode a 16 bit grayscale image (no compression).
void encode_rgb24 (unsigned char *rgb24, int width, int height)
 Encode a 24 bit color image (no compression).
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.
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.
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.


Detailed Description

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

Constructor & Destructor Documentation

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_size Buffer pool size
serialization Set to true if the instance manage the data buffer serialization


Member Function Documentation

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

Parameters:
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.

Parameters:
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).

Parameters:
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).

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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).

Parameters:
rgb24 Array of 24bit RGB sample
width The image width
height The image height


The documentation for this class was generated from the following file:
Tango Device Server User's Guide



ALBA - Control Team / DESY - Hasylab Petra III

ELETTRA - Controls and Diagnostics / ESRF - Software Engineering Group

SOLEIL - Controle Commande et Acquisition / MAX-lab - MAX 4

FRM2 - Control group