$search

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 (const sensor_msgs::Image &img_msg, int w, int h, bool withColor=true)
 Set image data position and ensure correct alignment.
void SetDataAlign (T *ptr, int w, int h)
 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 
) [inline]

Constructor.

Parameters:
w image width
h image height
ptr image 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  )  [inline]

Load grey-level image from PGM file.

Parameters:
filename image file name

Definition at line 152 of file tpimage.cpp.

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

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

Parameters:
filename image file name

Definition at line 212 of file tpimage.cpp.

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

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:
ptr image data pointer

Definition at line 71 of file tpimage.h.

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

Set image data position and ensure correct alignment.

Parameters:
image ROS image sensor message
w image width
h image height

Definition at line 102 of file tpimage.cpp.

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

Set image data position and ensure correct alignment.

Parameters:
ptr image data pointer
w image width
h image height

Definition at line 79 of file tpimage.cpp.

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

Set new image size.

Parameters:
w image width
h image 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 [inline]

Store grey-level image as PGM file.

Parameters:
filename image file name
norm whether to normalize image before storage
ascii whether 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 [inline]

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

Parameters:
filename image file name

Definition at line 348 of file tpimage.cpp.

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

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

Parameters:
filename image 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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


active_realtime_segmentation
Author(s): Mårten Björkman. Maintained by Jeannette Bohg
autogenerated on Tue Mar 5 14:01:57 2013