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

This class is C++ wrapper for a CPL mask object. It provides a simplified interface that allows to call CPL routines from INS applications. More...

#include <mask.hpp>

Inheritance diagram for odp::Mask:
odp::Error

Public Member Functions

 Mask ()
 Class constructor. More...
 
 Mask (cpl_size width, cpl_size height)
 Class constructor. More...
 
 Mask (const Mask &mask)
 Copy constructor. More...
 
 Mask (const Mask &mask, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor. More...
 
 Mask (const Image &image)
 Copy constructor. More...
 
 Mask (const Image &image, double lo_cut, double hi_cut)
 Copy constructor. More...
 
virtual ~Mask ()
 Class destructor. More...
 
bool IsMask () const
 Check is CPL mask is not null. More...
 
void GetMaskPtr (void **data_ptr) const
 Get pointer to CPL mask data. More...
 
void * GetMaskPtr () const
 Get pointer to mask data. More...
 
cpl_mask * GetCplMask () const
 Get CPL mask pointer. More...
 
void SetCplMask (cpl_mask *mask)
 Set CPL mask. More...
 
cpl_size GetWidth () const
 Get mask width. More...
 
cpl_size GetHeight () const
 Get mask height. More...
 
void Get (cpl_size width, cpl_size height, bool *value) const
 Get value of an element in the mask. More...
 
bool Get (cpl_size width, cpl_size height) const
 Get value of an element in the mask. More...
 
void Set (cpl_size row, cpl_size col, bool value)
 Set an element value in the mask. More...
 
Maskoperator= (const Mask &)
 Overload operator=. More...
 
bool operator== (const Mask &) const
 Overload operator==. More...
 
bool operator!= (const Mask &) 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

cpl_mask * m_cpl_mask
 

Friends

std::ostream & operator<< (std::ostream &os, const Mask &mask)
 

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

This class is C++ wrapper for a CPL mask object. It provides a simplified interface that allows to call CPL routines from INS applications.

Mask - CPL mask wrapper class

See Also
CPL Reference: http://www.eso.org/observing/cpl/reference_3.0/ or above

Constructor & Destructor Documentation

odp::Mask::Mask ( )

Class constructor.

Returns
none
odp::Mask::Mask ( cpl_size  width,
cpl_size  height 
)
explicit

Class constructor.

Parameters
[in]widthNumber of mask rows
[in]heightNumber of mask columns
Returns
none
See Also
CPL function: cpl_mask_new
odp::Mask::Mask ( const Mask mask)
explicit

Copy constructor.

Parameters
[in]maskReference to the mask to be copied
Returns
none
See Also
CPL function: cpl_mask_duplicate
odp::Mask::Mask ( const Mask mask,
const cpl_size  llx,
const cpl_size  lly,
const cpl_size  urx,
const cpl_size  ury 
)
explicit

Copy constructor.

Parameters
[in]maskReference to the mask 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
See Also
CPL function: cpl_mask_extract
odp::Mask::Mask ( const Image image)
explicit

Copy constructor.

Parameters
[in]imageReference to the image that will copied into the mask
Returns
none

This constructor can be used to load a mask from a cpl_image object. It goes through each value of the image and set mask value to CPL_BINARY_1 if the image pixel value at that position is different from zero.

See Also
CPL function: cpl_mask_new
odp::Mask::Mask ( const Image image,
double  lo_cut,
double  hi_cut 
)
explicit

Copy constructor.

Parameters
[in]imageReference to the image that will copied into the mask
[in]lo_cutLower bound for threshold
[in]hi_cutHigher bound for threshold
Returns
none
See Also
CPL function: cpl_mask_threshold_image_create
odp::Mask::~Mask ( )
virtual

Class destructor.

Returns
none

Member Function Documentation

void odp::Mask::Get ( cpl_size  width,
cpl_size  height,
bool *  value 
) const

Get value of an element in the mask.

Parameters
[in]widthRow identifier.
[in]heightColumn identifier.
[out]valueValue of the element.
Returns
none
See Also
CPL function: cpl_mask_get
bool odp::Mask::Get ( cpl_size  width,
cpl_size  height 
) const

Get value of an element in the mask.

Parameters
[in]widthRow identifier.
[in]heightColumn identifier.
Returns
value of an element in the mask.
See Also
CPL function: cpl_mask_get
cpl_mask* odp::Mask::GetCplMask ( ) const
inline

Get CPL mask pointer.

Returns
CPL mask pointer
cpl_size odp::Mask::GetHeight ( ) const
inline

Get mask height.

Returns
Image height
void odp::Mask::GetMaskPtr ( void **  data_ptr) const

Get pointer to CPL mask data.

Parameters
[out]data_ptrPointer to the mask data.
Returns
none
See Also
CPL function: cpl_mask_get_data
void* odp::Mask::GetMaskPtr ( ) const
inline

Get pointer to mask data.

Returns
Pointer to the mask data
cpl_size odp::Mask::GetWidth ( ) const
inline

Get mask width.

Returns
Image width
bool odp::Mask::IsMask ( ) const
inline

Check is CPL mask is not null.

Returns
TRUE is CPL mask is not null, FALSE otherwise.
bool odp::Mask::operator!= ( const Mask mask) const

Overload operator !=.

Parameters
[in]maskInput mask to be compared
Returns
True or false depending of the operator result.
Mask & odp::Mask::operator= ( const Mask mask)

Overload operator=.

Parameters
[in]maskInput mask to be compared
Returns
Reference to the object
bool odp::Mask::operator== ( const Mask mask) const

Overload operator==.

Parameters
[in]maskInput mask to be compared
Returns
True or false depending of the operator result.
void odp::Mask::Set ( cpl_size  row,
cpl_size  col,
bool  value 
)

Set an element value in the mask.

Parameters
[in]rowRow identifier.
[in]colColumn identifier.
[in]valueValue of the element.
Returns
none
See Also
CPL function: cpl_mask_set
void odp::Mask::SetCplMask ( cpl_mask *  mask)
inline

Set CPL mask.

Parameters
[in]maskCPL mask
Returns
none

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Mask mask 
)
friend

Member Data Documentation

cpl_mask* odp::Mask::m_cpl_mask
protected

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