ifw-odp  2.0.0-alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
odp::ImageWrapper< T > Class Template Reference

This is the base class that provides the interface to wrap images from shared memory areas. Currently it provides the only method which is common for its children classes. More...

#include <imageWrapper.hpp>

Inheritance diagram for odp::ImageWrapper< T >:
odp::Image odp::Error

Public Member Functions

 ImageWrapper ()
 Class constructor. More...
 
 ImageWrapper (const ImageWrapper &image)
 Copy constructor. More...
 
 ImageWrapper (const cpl_size xsize, const cpl_size ysize)
 Class constructor. More...
 
 ImageWrapper (const ImageWrapper &image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor. More...
 
virtual ~ImageWrapper ()
 Class destructor. More...
 
virtual void Unload ()
 Unwrap CPL image. More...
 
virtual bool IsWrapped () const
 Check if image was created around a pixel buffer. More...
 
virtual void SetWrap (bool status)
 Set wrapped flag. More...
 
virtual void Save (const char *filename)
 Saves image into a FITS file. More...
 
virtual void Save (const char *filename, cpl_type_bpp type_bpp)
 Saves image into a FITS file of a specific data type. More...
 
virtual void Read (T *data_ptr, cpl_size width, cpl_size height)
 Wrap data from a data buffer. More...
 
- Public Member Functions inherited from odp::Image
 Image ()
 Class constructor. More...
 
 Image (const cpl_size size_x, const cpl_size size_y, const cpl_type type)
 Class constructor. More...
 
 Image (const Image &image)
 Copy constructor. More...
 
 Image (const Mask &mask)
 Copy constructor. More...
 
 Image (const Image &image, cpl_type type)
 Copy constructor. More...
 
 Image (const Image &image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor. More...
 
 Image (const Mask &mask, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor. More...
 
 Image (const Image *image, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor. More...
 
 Image (const Image *image, const cpl_size startx, const cpl_size starty, const cpl_size size_single_det_x, const cpl_size size_single_det_y, const cpl_size size_gap_x, const cpl_size size_gap_y)
 Copy constructor. More...
 
virtual ~Image ()
 Class destructor. More...
 
void GetImagePtr (void **data_ptr) const
 Get pointer to image data. More...
 
cpl_size GetTypeSize () const
 Get size of the image built-in type. More...
 
void * GetImagePtr () const
 Get pointer to image data. More...
 
cpl_size GetWidth () const
 Get image width. More...
 
cpl_size GetHeight () const
 Get image height. More...
 
cpl_size GetSize () const
 Get image size. More...
 
bool IsImage () const
 Check is CPL image is valid. More...
 
bool Status () const
 Get image status. More...
 
cpl_type GetCplType () const
 Get CPL image type. More...
 
cpl_image * GetCplImage () const
 Get CPL image. More...
 
void SetCplImage (cpl_image *image)
 Set CPL image. More...
 
void Copy (const Image &, const cpl_size pos_x, const cpl_size pos_y)
 Copy input image object in the coordinates specified. More...
 
void Save (const std::string filename, cpl_type type=CPL_TYPE_FLOAT)
 Save CPL image into a FITS file. More...
 
void Load (const std::string filename, const cpl_size plane=0, const cpl_size extension=0, cpl_type type=CPL_TYPE_FLOAT)
 Load CPL image from a FITS file. More...
 
void Load (const std::string filename, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury, const cpl_size plane=0, const cpl_size extension=0, cpl_type type=CPL_TYPE_FLOAT)
 Load CPL image from a FITS file subwindow. More...
 
void Unload ()
 Release CPL image. More...
 
double Get (cpl_size xpos, cpl_size ypos) const
 Get the value of a pixel at a given position. More...
 
void Get (cpl_size xpos, cpl_size ypos, double *value)
 Get the value of a pixel at a given position. More...
 
void Set (cpl_size xpos, cpl_size ypos, double value)
 Set the value of a pixel at a given position. More...
 
void SetBadPixelMap (const Mask &mask)
 Set the bad pixel map. More...
 
cpl_size CountBadPixelMap ()
 Count the bad pixels. More...
 
void Exponential (const double base)
 Computes the image exponential. More...
 
void Logarithm (const double base)
 Computes the image logarithm. More...
 
void Power (const double exponent)
 Computes the image power. More...
 
void Absolute ()
 Computes the image absolute. More...
 
void Normalise (cpl_norm norm=CPL_NORM_SCALE)
 Normalize the CPL image. More...
 
void Turn (int rotation=-1)
 Rotate CPL image. More...
 
void FFT (Image *imaginary, unsigned mode=CPL_FFT_DEFAULT)
 Fast Fourier Transfor of a CPL image. More...
 
void Threshold (double lo_cut, double hi_cut, double assign_lo_cut, double assign_hi_cut)
 Threshold a CPL image to a given interval. More...
 
void Rebin (cpl_size xstart, cpl_size ystart, cpl_size xstep, cpl_size ystep, Image &new_image)
 Image rebin. More...
 
void FillNoise (const double min_pix, const double max_pix)
 It generates a CPL image with uniform random noise distribution. More...
 
void FillGaussian (const double cen_x, const double cen_y, const double norm, const double sigma_x, const double sigma_y)
 It generates an image from a 2d gaussian function. More...
 
Imageoperator+ (const double)
 Overload operator+. More...
 
Imageoperator+ (const Image &)
 Overload operator+. More...
 
Imageoperator- (const double)
 Overload operator-. More...
 
Imageoperator- (const Image &)
 Overload operator-. More...
 
Imageoperator/ (const double)
 Overload operator/. More...
 
Imageoperator/ (const Image &)
 Overload operator/. More...
 
Imageoperator* (const double)
 Overload operator*. More...
 
Imageoperator* (const Image &)
 Overload operator*. More...
 
Imageoperator+= (const double)
 Overload operator+=. More...
 
Imageoperator+= (const Image &)
 Overload operator+=. More...
 
Imageoperator-= (const double)
 Overload operator-=. More...
 
Imageoperator-= (const Image &)
 Overload operator-=. More...
 
Imageoperator/= (const double)
 Overload operator/=. More...
 
Imageoperator/= (const Image &)
 Overload operator/=. More...
 
Imageoperator*= (const double)
 Overload operator*=. More...
 
Imageoperator*= (const Image &)
 Overload operator*=. More...
 
Imageoperator= (const Image &)
 Overload operator=. More...
 
bool operator== (const Image &) const
 Overload operator==. More...
 
bool operator!= (const Image &) const
 Overload operator!=. More...
 
- Public Member Functions inherited from odp::Error
 Error ()
 Class constructor. More...
 
virtual ~Error ()
 Class destructor. More...
 
void ResetCplError ()
 Reset CPL error and internal error flag. More...
 
bool CheckCplError () const
 Check if there is an error in CPL. More...
 

Protected Attributes

T * m_data
 Object buffer to store copied or casted shared memory areas. More...
 
- Protected Attributes inherited from odp::Image
cpl_type m_cpl_type
 
cpl_image * m_cpl_image
 

Additional Inherited Members

- Protected Member Functions inherited from odp::Error
void AddCplError () const
 Add CPL error to the error stack. More...
 
std::string GetErrorMsg () const
 Get CPL error message. More...
 
- Static Protected Member Functions inherited from odp::Error
static void DumpError (unsigned self, unsigned first, unsigned last)
 Dump current CPL error. More...
 

Detailed Description

template<typename T>
class odp::ImageWrapper< T >

This is the base class that provides the interface to wrap images from shared memory areas. Currently it provides the only method which is common for its children classes.

ImageWrapper - Template class for wrapping images from memory.

See Also
odp::Image

Constructor & Destructor Documentation

template<typename T >
odp::ImageWrapper< T >::ImageWrapper ( )

Class constructor.

Returns
none
template<typename T >
odp::ImageWrapper< T >::ImageWrapper ( const ImageWrapper< T > &  image)

Copy constructor.

Parameters
[in]imageReference to the image to be copied
Returns
none
template<typename T >
odp::ImageWrapper< T >::ImageWrapper ( const cpl_size  xsize,
const cpl_size  ysize 
)

Class constructor.

Parameters
[in]xsizeSize in x (the number of columns)
[in]ysizeSize in y (the number of rows)
Returns
none
template<typename T >
odp::ImageWrapper< T >::ImageWrapper ( const ImageWrapper< T > &  image,
const cpl_size  llx,
const cpl_size  lly,
const cpl_size  urx,
const cpl_size  ury 
)

Copy constructor.

Parameters
[in]imageReference to the object to be copied.
[in]llxLower left X coordinate.
[in]llyLower left Y coordinate.
[in]urxUpper right X coordinate.
[in]uryUpper right Y coordinate.
Returns
none
template<typename T >
virtual odp::ImageWrapper< T >::~ImageWrapper ( )
virtual

Class destructor.

Returns
none

Delete memory

Member Function Documentation

template<typename T >
virtual bool odp::ImageWrapper< T >::IsWrapped ( ) const
virtual

Check if image was created around a pixel buffer.

Returns
TRUE or FALSE
template<typename T >
virtual void odp::ImageWrapper< T >::Read ( T *  data_ptr,
cpl_size  width,
cpl_size  height 
)
virtual

Wrap data from a data buffer.

Parameters
[in]data_ptrPointer to the data buffer.
[in]widthWidth of the image.
[in]heightHeigth of the image.

It wrap the data directly from a data pointer.

See Also
CPL function: cpl_image_wrap_int, cpl_image_wrap_float, cpl_image_wrap_double
template<typename T >
virtual void odp::ImageWrapper< T >::Save ( const char *  filename)
virtual

Saves image into a FITS file.

Parameters
[in]filenameName of the FITS file to be saved.
template<typename T >
virtual void odp::ImageWrapper< T >::Save ( const char *  filename,
cpl_type_bpp  type_bpp 
)
virtual

Saves image into a FITS file of a specific data type.

Parameters
[in]filenameName of the FITS file to be saved.
[in]type_bppType of the CPL image.
template<typename T >
virtual void odp::ImageWrapper< T >::SetWrap ( bool  status)
virtual

Set wrapped flag.

template<typename T >
virtual void odp::ImageWrapper< T >::Unload ( )
virtual

Unwrap CPL image.

Member Data Documentation

template<typename T >
T* odp::ImageWrapper< T >::m_data
protected

Object buffer to store copied or casted shared memory areas.


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