ifw-odp 4.0.1
Loading...
Searching...
No Matches
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.
 
 Mask (cpl_size width, cpl_size height)
 Class constructor.
 
 Mask (const Mask &mask)
 Copy constructor.
 
 Mask (const Mask &mask, const cpl_size llx, const cpl_size lly, const cpl_size urx, const cpl_size ury)
 Copy constructor.
 
 Mask (const Image &image)
 Copy constructor.
 
 Mask (const Image &image, double lo_cut, double hi_cut)
 Copy constructor.
 
virtual ~Mask ()
 Class destructor.
 
bool IsMask () const
 Check is CPL mask is not null.
 
void GetMaskPtr (void **data_ptr) const
 Get pointer to CPL mask data.
 
void * GetMaskPtr () const
 Get pointer to mask data.
 
cpl_mask * GetCplMask () const
 Get CPL mask pointer.
 
void SetCplMask (cpl_mask *mask)
 Set CPL mask.
 
cpl_size GetWidth () const
 Get mask width.
 
cpl_size GetHeight () const
 Get mask height.
 
void Get (cpl_size width, cpl_size height, bool *value) const
 Get value of an element in the mask.
 
bool Get (cpl_size width, cpl_size height) const
 Get value of an element in the mask.
 
void Set (cpl_size row, cpl_size col, bool value)
 Set an element value in the mask.
 
Maskoperator= (const Mask &)
 Overload operator=.
 
bool operator== (const Mask &) const
 Overload operator==.
 
bool operator!= (const Mask &) const
 Overload operator !=.
 
- Public Member Functions inherited from odp::Error
 Error ()
 Class constructor.
 
virtual ~Error ()
 Class destructor.
 
void ResetCplError ()
 Reset CPL error and internal error flag.
 
bool CheckCplError () const
 Check if there is an error in CPL.
 

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
std::string GetErrorMsg () const
 Get CPL error message.
 

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

◆ Mask() [1/6]

odp::Mask::Mask ( )

Class constructor.

Returns
none

◆ Mask() [2/6]

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

◆ Mask() [3/6]

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

◆ Mask() [4/6]

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

◆ Mask() [5/6]

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

◆ Mask() [6/6]

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

◆ ~Mask()

odp::Mask::~Mask ( )
virtual

Class destructor.

Returns
none

Member Function Documentation

◆ Get() [1/2]

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

◆ Get() [2/2]

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

◆ GetCplMask()

cpl_mask * odp::Mask::GetCplMask ( ) const
inline

Get CPL mask pointer.

Returns
CPL mask pointer

◆ GetHeight()

cpl_size odp::Mask::GetHeight ( ) const
inline

Get mask height.

Returns
Image height

◆ GetMaskPtr() [1/2]

void * odp::Mask::GetMaskPtr ( ) const
inline

Get pointer to mask data.

Returns
Pointer to the mask data

◆ GetMaskPtr() [2/2]

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

◆ GetWidth()

cpl_size odp::Mask::GetWidth ( ) const
inline

Get mask width.

Returns
Image width

◆ IsMask()

bool odp::Mask::IsMask ( ) const
inline

Check is CPL mask is not null.

Returns
TRUE is CPL mask is not null, FALSE otherwise.

◆ operator!=()

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.

◆ operator=()

Mask & odp::Mask::operator= ( const Mask mask)

Overload operator=.

Parameters
[in]maskInput mask to be compared
Returns
Reference to the object

◆ operator==()

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.

◆ Set()

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

◆ SetCplMask()

void odp::Mask::SetCplMask ( cpl_mask *  mask)
inline

Set CPL mask.

Parameters
[in]maskCPL mask
Returns
none

Friends And Related Function Documentation

◆ operator<<

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

Member Data Documentation

◆ m_cpl_mask

cpl_mask* odp::Mask::m_cpl_mask
protected

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