libalvision  2.4.3.28-r2
 All Classes Namespaces Files Functions Variables Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
AL::ALImage Class Reference

#include <alimage.h>

Classes

struct  ROI
 

Public Member Functions

 ALImage (int pWidth, int pHeight, int pColorSpace, bool pDataAreExternal=false, float pLeftAngle=0.f, float pTopAngle=0.f, float pRightAngle=0.f, float pBottomAngle=0.f)
 constructor More...
 
 ALImage (int pResolution, int pColorSpace, bool pDataAreExternal=false, float pLeftAngle=0.f, float pTopAngle=0.f, float pRightAngle=0.f, float pBottomAngle=0.f)
 constructor More...
 
 ~ALImage ()
 
ALImage deepCopy ()
 data-ownership copy creation More...
 
ALValue toALValue ()
 return an ALValue containing image structure More...
 
void setWidth (const int width)
 
void setHeight (const int height)
 
void setLeftAngle (const float leftAngle)
 
void setTopAngle (const float topAngle)
 
void setRightAngle (const float rightAngle)
 
void setBottomAngle (const float bottomAngle)
 
void setAngles (const float leftAngle, const float topAngle, const float rightAngle, const float bottomAngle)
 
bool setSize (int pResolution)
 set the Resolution of the image without changing the allocation size. More...
 
bool setResolution (int pResolution)
 set the Resolution of the image without changing the allocation size. More...
 
bool setColorSpace (int pColorSpace)
 set the ColorSpace of the image without changing the allocation size. More...
 
const unsigned char * getFrame () const
 return the reference to the image data. More...
 
const unsigned char * getData () const
 return the reference to the image data. More...
 
unsigned char * getFrame ()
 return the pointer to the image data. More...
 
unsigned char * getData ()
 return the pointer to the image data. More...
 
void setData (unsigned char *pData)
 set the image data pointer to point to the specified buffer. More...
 
void setTimeStamp (const qi::os::timeval pTimeStamp)
 set the image timestamp. More...
 
void setTimeStamp (long long pTimeStamp)
 set the image timestamp More...
 
void setTimeStamp (int pSeconds, int pMicroSeconds)
 set the image timestamp More...
 
void setCameraId (char pCameraId)
 set the ID of the camera that shot the picture More...
 
unsigned int getSize () const
 
int getWidth (void) const
 
int getHeight (void) const
 
int getResolution (void) const
 
int getColorSpace (void) const
 
int getNbLayers (void) const
 
long long getTimeStamp (void) const
 
char getCameraId () const
 
int getMaxResolution (void) const
 
int getNbOfLayersMax (void) const
 
bool areDataExternal (void) const
 
int getAllocatedSize () const
 
float getLeftAngle (void) const
 
float getTopAngle (void) const
 
float getRightAngle (void) const
 
float getBottomAngle (void) const
 
void getAngles (float &leftAngle, float &topAngle, float &rightAngle, float &bottomAngle) const
 
std::string toString (void) const
 
int getNumOfROIs () const
 
const ROIgetROI (int index) const
 
void addROI (const ROI &rect)
 
void cleanROIs ()
 
void setEnableROIs (bool enable)
 
bool isROIEnabled () const
 
int writeFile (const char *_fileNameAndPath)
 
int readFile (const char *_fileNameAndPath)
 
int savePPM (const char *_fileNameAndPath)
 
bool computeYUV422imageFromBGR (int height, int width, char *data)
 
bool computeBGRimageFromYUV422 (const unsigned char *_dest)
 
bool computeYYYUUUVVVimageFromYUV422 (const unsigned char *_dest)
 
bool computeYYYYUUVVimageFromYUV422 (const unsigned char *_dest)
 

Static Public Member Functions

static ALImagefromALValue (const ALValue &image)
 Allocate an ALImage and return a pointer on it using an ALValue to fill it. More...
 

Friends

class deleter
 

Detailed Description

Definition at line 28 of file alimage.h.

Constructor & Destructor Documentation

AL::ALImage::ALImage ( int  pWidth,
int  pHeight,
int  pColorSpace,
bool  pDataAreExternal = false,
float  pLeftAngle = 0.f,
float  pTopAngle = 0.f,
float  pRightAngle = 0.f,
float  pBottomAngle = 0.f 
)

constructor

ALImage

Parameters
[in]pWidthwidth of the image
[in]pHeightheight of the image
[in]pColorSpacecolor space of the image
[in]pDataAreExternalis data buffer external, or is it allocated with the image?
[in]pLeftAnglecamera FOV left angle in radian
[in]pTopAnglecamera FOV top angle in radian
[in]pRightAnglecamera FOV right angle in radian
[in]pBottomAnglecamera FOV bottom angle in radian
AL::ALImage::ALImage ( int  pResolution,
int  pColorSpace,
bool  pDataAreExternal = false,
float  pLeftAngle = 0.f,
float  pTopAngle = 0.f,
float  pRightAngle = 0.f,
float  pBottomAngle = 0.f 
)

constructor

ALImage

Parameters
[in]pResolutionresolution of the image
[in]pColorSpacecolor space of the image
[in]pDataAreExternalis data buffer external, or is it allocated with the image?
[in]pLeftAnglecamera FOV left angle in radian
[in]pTopAnglecamera FOV top angle in radian
[in]pRightAnglecamera FOV right angle in radian
[in]pBottomAnglecamera FOV bottom angle in radian
AL::ALImage::~ALImage ( )

Member Function Documentation

void AL::ALImage::addROI ( const ROI rect)
inline

Definition at line 281 of file alimage.h.

bool AL::ALImage::areDataExternal ( void  ) const
inline

Definition at line 258 of file alimage.h.

void AL::ALImage::cleanROIs ( )
inline

Definition at line 285 of file alimage.h.

bool AL::ALImage::computeBGRimageFromYUV422 ( const unsigned char *  _dest)
bool AL::ALImage::computeYUV422imageFromBGR ( int  height,
int  width,
char *  data 
)
bool AL::ALImage::computeYYYUUUVVVimageFromYUV422 ( const unsigned char *  _dest)
bool AL::ALImage::computeYYYYUUVVimageFromYUV422 ( const unsigned char *  _dest)
ALImage AL::ALImage::deepCopy ( )

data-ownership copy creation

deepcopy

Note
Returns an ALImage that has internal data, whether the object has internal or external data. Allocates a new data buffer and performs a copy of the data in the object.
static ALImage* AL::ALImage::fromALValue ( const ALValue &  image)
static

Allocate an ALImage and return a pointer on it using an ALValue to fill it.

Parameters
[in]imageALValue containing: image[0] : [int] with of the image image[1] : [int] height of the image image[2] : [int] number of layers of the image image[3] : [int] colorspace of the image image[4] : [int] time stamp in second image[5] : [int] time stamp in microsecond (and under second) image[6] : [int] data of the image image[7] : [int] camera ID image[8] : [float] camera FOV left angle (radian) image[9] : [float] camera FOV top angle (radian) image[10]: [float] camera FOV right angle (radian) image[11]: [float] camera FOV bottom angle (radian)
Returns
a pointer to ALImage otherwise return a NULL pointer.
Note
This method performs a deep copy, so ALValue can be suppressed.
int AL::ALImage::getAllocatedSize ( ) const
inline

Definition at line 259 of file alimage.h.

void AL::ALImage::getAngles ( float &  leftAngle,
float &  topAngle,
float &  rightAngle,
float &  bottomAngle 
) const
inline

Definition at line 264 of file alimage.h.

float AL::ALImage::getBottomAngle ( void  ) const
inline

Definition at line 263 of file alimage.h.

char AL::ALImage::getCameraId ( ) const
inline

Definition at line 255 of file alimage.h.

int AL::ALImage::getColorSpace ( void  ) const
inline

Definition at line 252 of file alimage.h.

const unsigned char* AL::ALImage::getData ( ) const
inline

return the reference to the image data.

getData

Returns
reference to the image data.

Definition at line 171 of file alimage.h.

unsigned char* AL::ALImage::getData ( )
inline

return the pointer to the image data.

getData

Returns
pointer to the image data.

Definition at line 188 of file alimage.h.

const unsigned char* AL::ALImage::getFrame ( ) const
inline

return the reference to the image data.

getFrame //DEPRECATED

Returns
reference to the image data.

Definition at line 162 of file alimage.h.

unsigned char* AL::ALImage::getFrame ( )
inline

return the pointer to the image data.

getFrame //DEPRECATED

Returns
pointer to the image data.

Definition at line 179 of file alimage.h.

int AL::ALImage::getHeight ( void  ) const
inline

Definition at line 250 of file alimage.h.

float AL::ALImage::getLeftAngle ( void  ) const
inline

Definition at line 260 of file alimage.h.

int AL::ALImage::getMaxResolution ( void  ) const
inline

Definition at line 256 of file alimage.h.

int AL::ALImage::getNbLayers ( void  ) const
inline

Definition at line 253 of file alimage.h.

int AL::ALImage::getNbOfLayersMax ( void  ) const
inline

Definition at line 257 of file alimage.h.

int AL::ALImage::getNumOfROIs ( ) const
inline

Definition at line 273 of file alimage.h.

int AL::ALImage::getResolution ( void  ) const
inline

Definition at line 251 of file alimage.h.

float AL::ALImage::getRightAngle ( void  ) const
inline

Definition at line 262 of file alimage.h.

const ROI* AL::ALImage::getROI ( int  index) const
inline

Definition at line 275 of file alimage.h.

unsigned int AL::ALImage::getSize ( ) const
inline

getSize

Returns
the size of the allocated memory for the image (the size of fData buffer)

Definition at line 244 of file alimage.h.

long long AL::ALImage::getTimeStamp ( void  ) const
inline

Definition at line 254 of file alimage.h.

float AL::ALImage::getTopAngle ( void  ) const
inline

Definition at line 261 of file alimage.h.

int AL::ALImage::getWidth ( void  ) const
inline

Definition at line 249 of file alimage.h.

bool AL::ALImage::isROIEnabled ( ) const
inline

Definition at line 293 of file alimage.h.

int AL::ALImage::readFile ( const char *  _fileNameAndPath)
int AL::ALImage::savePPM ( const char *  _fileNameAndPath)
void AL::ALImage::setAngles ( const float  leftAngle,
const float  topAngle,
const float  rightAngle,
const float  bottomAngle 
)
inline

Definition at line 133 of file alimage.h.

void AL::ALImage::setBottomAngle ( const float  bottomAngle)
inline

Definition at line 132 of file alimage.h.

void AL::ALImage::setCameraId ( char  pCameraId)
inline

set the ID of the camera that shot the picture

setCameraId

Parameters
[in]pCameraIdID of the camera that shot the picture

Definition at line 237 of file alimage.h.

bool AL::ALImage::setColorSpace ( int  pColorSpace)

set the ColorSpace of the image without changing the allocation size.

setColorSpace

Parameters
[in]pColorSpaceColorSpace of the image.
void AL::ALImage::setData ( unsigned char *  pData)
inline

set the image data pointer to point to the specified buffer.

setData

Parameters
[in]pDatapointer to the image data buffer.
Note
makes the object's data external

Definition at line 196 of file alimage.h.

void AL::ALImage::setEnableROIs ( bool  enable)
inline

Definition at line 289 of file alimage.h.

void AL::ALImage::setHeight ( const int  height)
inline

Definition at line 128 of file alimage.h.

void AL::ALImage::setLeftAngle ( const float  leftAngle)
inline

Definition at line 129 of file alimage.h.

bool AL::ALImage::setResolution ( int  pResolution)

set the Resolution of the image without changing the allocation size.

setResolution

Parameters
[in]pResolutionresolution of the image.
void AL::ALImage::setRightAngle ( const float  rightAngle)
inline

Definition at line 131 of file alimage.h.

bool AL::ALImage::setSize ( int  pResolution)
inline

set the Resolution of the image without changing the allocation size.

Parameters
[in]pResolutionresolution of the image
Deprecated:
you should not use this function.

Definition at line 141 of file alimage.h.

void AL::ALImage::setTimeStamp ( const qi::os::timeval  pTimeStamp)
inline

set the image timestamp.

setTimeStamp

Parameters
[in]pTimeStamptimestamp to set.

Definition at line 203 of file alimage.h.

void AL::ALImage::setTimeStamp ( long long  pTimeStamp)
inline

set the image timestamp

setTimeStamp

Parameters
[in]pTimeStamptime in a long long format.

Definition at line 218 of file alimage.h.

void AL::ALImage::setTimeStamp ( int  pSeconds,
int  pMicroSeconds 
)
inline

set the image timestamp

setTimeStamp

Parameters
[in]pSecondstime in seconds
[in]pMicroSecondstime in µseconds

Definition at line 226 of file alimage.h.

void AL::ALImage::setTopAngle ( const float  topAngle)
inline

Definition at line 130 of file alimage.h.

void AL::ALImage::setWidth ( const int  width)
inline

Definition at line 127 of file alimage.h.

ALValue AL::ALImage::toALValue ( )

return an ALValue containing image structure

toALValue

Returns
[0] : [int] with of the image
[1] : [int] height of the image
[2] : [int] number of layers of the image
[3] : [int] colorspace of the image
[4] : [int] time stamp in second
[5] : [int] time stamp in microsecond (and under second)
[6] : [int] data of the image
[7] : [int] camera ID
[8] : [float] camera FOV left angle (radian)
[9] : [float] camera FOV top angle (radian)
[10]: [float] camera FOV right angle (radian)
[11]: [float] camera FOV bottom angle (radian)
std::string AL::ALImage::toString ( void  ) const
int AL::ALImage::writeFile ( const char *  _fileNameAndPath)

Friends And Related Function Documentation

friend class deleter
friend

Definition at line 338 of file alimage.h.


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