Public Member Functions | Private Attributes
Image< T > Class Template Reference

Templated image class. More...

#include <tpimage.h>

List of all members.

Public Member Functions

T * GetData () const
 Get image data position.
int GetHeight () const
 Get image height.
int GetWidth () const
 Get image width.
 Image (int w, int h, T *ptr=NULL)
 Constructor.
bool Load (const char *filename)
 Load grey-level image from PGM file.
bool LoadRGB (const char *filename)
 Load RGB image (three values per pixel) from PPM file.
void operator= (Image< T > &src)
 Copy image data.
T * operator[] (int i)
 Get pointer to pixel row i.
void SetData (T *ptr)
 Set image data position.
void SetDataAlign (T *ptr, int w, int h)
 Set image data position and ensure correct alignment.
void SetDataAlign (const sensor_msgs::Image &img_msg, int w, int h, bool withColor=true)
 Set image data position and ensure correct alignment.
void SetSize (int w, int h)
 Set new image size.
void Store (const char *filename, bool norm=false, bool ascii=false) const
 Store grey-level image as PGM file.
void StoreRGB (const char *filename) const
 Store RGB image (three values per pixel) as PPM file.
void StoreYUV (const char *filename) const
 Convert from UYVY (two values per pixel) to RGB and store as PPM file.
 ~Image ()

Private Attributes

int height
T * image
T * img
bool localalloc
int width

Detailed Description

template<class T>
class Image< T >

Templated image class.

Definition at line 53 of file tpimage.h.


Constructor & Destructor Documentation

template<class T>
Image< T >::Image ( int  w,
int  h,
T *  ptr = NULL 
)

Constructor.

Parameters:
wimage width
himage height
ptrimage data pointer (if NULL, allocated internally)

Definition at line 36 of file tpimage.cpp.

template<class T>
Image< T >::~Image ( ) [inline]

Definition at line 64 of file tpimage.h.


Member Function Documentation

template<class T>
T* Image< T >::GetData ( ) const [inline]

Get image data position.

Definition at line 100 of file tpimage.h.

template<class T>
int Image< T >::GetHeight ( ) const [inline]

Get image height.

Definition at line 104 of file tpimage.h.

template<class T>
int Image< T >::GetWidth ( ) const [inline]

Get image width.

Definition at line 102 of file tpimage.h.

template<class T >
bool Image< T >::Load ( const char *  filename)

Load grey-level image from PGM file.

Parameters:
filenameimage file name

Definition at line 152 of file tpimage.cpp.

template<class T >
bool Image< T >::LoadRGB ( const char *  filename)

Load RGB image (three values per pixel) from PPM file.

Parameters:
filenameimage file name

Definition at line 212 of file tpimage.cpp.

template<class T>
void Image< T >::operator= ( Image< T > &  src)

Copy image data.

Definition at line 409 of file tpimage.cpp.

template<class T>
T* Image< T >::operator[] ( int  i) [inline]

Get pointer to pixel row i.

Definition at line 106 of file tpimage.h.

template<class T>
void Image< T >::SetData ( T *  ptr) [inline]

Set image data position.

Parameters:
ptrimage data pointer

Definition at line 71 of file tpimage.h.

template<class T>
void Image< T >::SetDataAlign ( T *  ptr,
int  w,
int  h 
)

Set image data position and ensure correct alignment.

Parameters:
ptrimage data pointer
wimage width
himage height

Definition at line 79 of file tpimage.cpp.

template<class T>
void Image< T >::SetDataAlign ( const sensor_msgs::Image< T > &  img_msg,
int  w,
int  h,
bool  withColor = true 
)

Set image data position and ensure correct alignment.

Parameters:
imageROS image sensor message
wimage width
himage height

Definition at line 102 of file tpimage.cpp.

template<class T >
void Image< T >::SetSize ( int  w,
int  h 
)

Set new image size.

Parameters:
wimage width
himage height

Definition at line 58 of file tpimage.cpp.

template<class T >
void Image< T >::Store ( const char *  filename,
bool  norm = false,
bool  ascii = false 
) const

Store grey-level image as PGM file.

Parameters:
filenameimage file name
normwhether to normalize image before storage
asciiwhether to store in ASCII or binary format

Definition at line 281 of file tpimage.cpp.

template<class T >
void Image< T >::StoreRGB ( const char *  filename) const

Store RGB image (three values per pixel) as PPM file.

Parameters:
filenameimage file name

Definition at line 348 of file tpimage.cpp.

template<class T >
void Image< T >::StoreYUV ( const char *  filename) const

Convert from UYVY (two values per pixel) to RGB and store as PPM file.

Parameters:
filenameimage file name

Definition at line 373 of file tpimage.cpp.


Member Data Documentation

template<class T>
int Image< T >::height [private]

Definition at line 54 of file tpimage.h.

template<class T>
T* Image< T >::image [private]

Definition at line 55 of file tpimage.h.

template<class T>
T * Image< T >::img [private]

Definition at line 55 of file tpimage.h.

template<class T>
bool Image< T >::localalloc [private]

Definition at line 56 of file tpimage.h.

template<class T>
int Image< T >::width [private]

Definition at line 54 of file tpimage.h.


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


active_realtime_segmentation
Author(s): Mårten Björkman. Maintained by Jeannette Bohg
autogenerated on Fri Jan 3 2014 12:02:50