SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::MaskedImage< T, M, Operator > Class Template Reference

#include <MaskedImage.h>

Inheritance diagram for SourceXtractor::MaskedImage< T, M, Operator >:
Collaboration diagram for SourceXtractor::MaskedImage< T, M, Operator >:

Public Member Functions

virtual ~MaskedImage ()=default
std::string getRepr () const final
 Get a string identifying this image in a human readable manner.
int getWidth () const final
 Returns the width of the image in pixels.
int getHeight () const final
 Returns the height of the image in pixels.
std::size_t getNMasked () const
std::size_t getNTotal () const
std::shared_ptr< ImageChunk< T > > getChunk (int x, int y, int width, int height) const final
Public Member Functions inherited from SourceXtractor::Image< T >
virtual ~Image ()=default
 Destructor.
std::shared_ptr< ImageChunk< T > > getChunk (const PixelCoordinate &start, const PixelCoordinate &end) const
bool isInside (int x, int y) const
 Returns true if the given coordinates are inside the image bounds.

Static Public Member Functions

static std::shared_ptr< MaskedImage< T, M, Operator > > create (const std::shared_ptr< Image< T > > &image, const std::shared_ptr< Image< M > > &mask, T replacement, M mask_flag=0x01)

Private Member Functions

 MaskedImage (const std::shared_ptr< Image< T > > &image, const std::shared_ptr< Image< M > > &mask, T replacement, M mask_flag)

Private Attributes

std::shared_ptr< Image< T > > m_image
std::shared_ptr< Image< M > > m_mask
m_replacement
m_mask_flag
Operator< M > m_operator
std::size_t m_n_masked
std::size_t m_n_total

Additional Inherited Members

Public Types inherited from SourceXtractor::Image< T >
using PixelType = T

Detailed Description

template<typename T, typename M, template< typename > class Operator = std::bit_and>
class SourceXtractor::MaskedImage< T, M, Operator >

Mask an image, replacing masked values

Template Parameters
TPixel type of the masked image
MPixel type of the mask
OperatorOperator to apply on the mask pixels. Defaults to bitwise and (&)
Note
The image is masked where the operator evaluates to true on the mask image

Definition at line 45 of file MaskedImage.h.

Constructor & Destructor Documentation

◆ MaskedImage()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
SourceXtractor::MaskedImage< T, M, Operator >::MaskedImage ( const std::shared_ptr< Image< T > > & image,
const std::shared_ptr< Image< M > > & mask,
T replacement,
M mask_flag )
inlineprivate

Definition at line 47 of file MaskedImage.h.

References m_image, m_mask, m_mask_flag, m_n_masked, m_n_total, and m_replacement.

Referenced by create().

◆ ~MaskedImage()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
virtual SourceXtractor::MaskedImage< T, M, Operator >::~MaskedImage ( )
virtualdefault

Member Function Documentation

◆ create()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::shared_ptr< MaskedImage< T, M, Operator > > SourceXtractor::MaskedImage< T, M, Operator >::create ( const std::shared_ptr< Image< T > > & image,
const std::shared_ptr< Image< M > > & mask,
T replacement,
M mask_flag = 0x01 )
inlinestatic

Create a masked image

Parameters
imageImage to be masked
maskMask
replacementReplace masked pixels with this value
mask_flagIf Operator(mask pixel, mask_flag) is true, this given pixel is replaced
Returns
A new masked image

Definition at line 78 of file MaskedImage.h.

References MaskedImage().

Referenced by SourceXtractor::SEBackgroundLevelAnalyzer::analyzeBackground(), and SourceXtractor::BgDFTConvolutionImageSource::generateTile().

Here is the call graph for this function:

◆ getChunk()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::shared_ptr< ImageChunk< T > > SourceXtractor::MaskedImage< T, M, Operator >::getChunk ( int x,
int y,
int width,
int height ) const
inlinefinalvirtual

Implements SourceXtractor::Image< T >.

Definition at line 111 of file MaskedImage.h.

References SourceXtractor::UniversalImageChunk< T >::create(), m_image, m_mask, m_mask_flag, m_n_masked, m_n_total, m_operator, m_replacement, and std::move().

Here is the call graph for this function:

◆ getHeight()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
int SourceXtractor::MaskedImage< T, M, Operator >::getHeight ( ) const
inlinefinalvirtual

Returns the height of the image in pixels.

Implements SourceXtractor::Image< T >.

Definition at line 99 of file MaskedImage.h.

References m_image.

◆ getNMasked()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::size_t SourceXtractor::MaskedImage< T, M, Operator >::getNMasked ( ) const
inline

Definition at line 103 of file MaskedImage.h.

References m_n_masked.

Referenced by getRepr().

◆ getNTotal()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::size_t SourceXtractor::MaskedImage< T, M, Operator >::getNTotal ( ) const
inline

Definition at line 107 of file MaskedImage.h.

References m_n_total.

◆ getRepr()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::string SourceXtractor::MaskedImage< T, M, Operator >::getRepr ( ) const
inlinefinalvirtual

Get a string identifying this image in a human readable manner.

Implements SourceXtractor::Image< T >.

Definition at line 84 of file MaskedImage.h.

References getNMasked(), m_image, m_n_total, and std::snprintf().

Here is the call graph for this function:

◆ getWidth()

template<typename T, typename M, template< typename > class Operator = std::bit_and>
int SourceXtractor::MaskedImage< T, M, Operator >::getWidth ( ) const
inlinefinalvirtual

Returns the width of the image in pixels.

Implements SourceXtractor::Image< T >.

Definition at line 95 of file MaskedImage.h.

References m_image.

Member Data Documentation

◆ m_image

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::shared_ptr<Image<T> > SourceXtractor::MaskedImage< T, M, Operator >::m_image
private

Definition at line 52 of file MaskedImage.h.

Referenced by getChunk(), getHeight(), getRepr(), getWidth(), and MaskedImage().

◆ m_mask

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::shared_ptr<Image<M> > SourceXtractor::MaskedImage< T, M, Operator >::m_mask
private

Definition at line 53 of file MaskedImage.h.

Referenced by getChunk(), and MaskedImage().

◆ m_mask_flag

template<typename T, typename M, template< typename > class Operator = std::bit_and>
M SourceXtractor::MaskedImage< T, M, Operator >::m_mask_flag
private

Definition at line 55 of file MaskedImage.h.

Referenced by getChunk(), and MaskedImage().

◆ m_n_masked

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::size_t SourceXtractor::MaskedImage< T, M, Operator >::m_n_masked
mutableprivate

Definition at line 58 of file MaskedImage.h.

Referenced by getChunk(), getNMasked(), and MaskedImage().

◆ m_n_total

template<typename T, typename M, template< typename > class Operator = std::bit_and>
std::size_t SourceXtractor::MaskedImage< T, M, Operator >::m_n_total
mutableprivate

Definition at line 59 of file MaskedImage.h.

Referenced by getChunk(), getNTotal(), getRepr(), and MaskedImage().

◆ m_operator

template<typename T, typename M, template< typename > class Operator = std::bit_and>
Operator<M> SourceXtractor::MaskedImage< T, M, Operator >::m_operator
private

Definition at line 56 of file MaskedImage.h.

Referenced by getChunk().

◆ m_replacement

template<typename T, typename M, template< typename > class Operator = std::bit_and>
T SourceXtractor::MaskedImage< T, M, Operator >::m_replacement
private

Definition at line 54 of file MaskedImage.h.

Referenced by getChunk(), and MaskedImage().


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