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

#include <FunctionalImage.h>

Inheritance diagram for SourceXtractor::FunctionalImage< T, I >:
Collaboration diagram for SourceXtractor::FunctionalImage< T, I >:

Public Types

using FunctorType = std::function<T(int x, int y, I v)>
Public Types inherited from SourceXtractor::Image< T >
using PixelType = T

Public Member Functions

virtual ~FunctionalImage ()=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::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

template<typename ... Args>
static std::shared_ptr< FunctionalImage< T, I > > create (Args &&... args)

Protected Member Functions

 FunctionalImage (std::shared_ptr< const Image< I > > img, FunctorType functor)

Private Attributes

std::shared_ptr< const Image< I > > m_img
FunctorType m_functor

Detailed Description

template<typename T, typename I = T>
class SourceXtractor::FunctionalImage< T, I >

Apply a transformation to each individual pixel

Template Parameters
TPixel type
Pixeltype of the input image
Warning
Make sure the functor does not capture anything that may be outlived by the functional image. This is hardly surprising. Also, make sure that whatever is captured is thread safe!

Definition at line 43 of file FunctionalImage.h.

Member Typedef Documentation

◆ FunctorType

template<typename T, typename I = T>
using SourceXtractor::FunctionalImage< T, I >::FunctorType = std::function<T(int x, int y, I v)>

Definition at line 45 of file FunctionalImage.h.

Constructor & Destructor Documentation

◆ FunctionalImage()

template<typename T, typename I = T>
SourceXtractor::FunctionalImage< T, I >::FunctionalImage ( std::shared_ptr< const Image< I > > img,
FunctorType functor )
inlineprotected

Definition at line 48 of file FunctionalImage.h.

References m_functor, m_img, and std::move().

Referenced by create().

Here is the call graph for this function:

◆ ~FunctionalImage()

template<typename T, typename I = T>
virtual SourceXtractor::FunctionalImage< T, I >::~FunctionalImage ( )
virtualdefault

Member Function Documentation

◆ create()

template<typename T, typename I = T>
template<typename ... Args>
std::shared_ptr< FunctionalImage< T, I > > SourceXtractor::FunctionalImage< T, I >::create ( Args &&... args)
inlinestatic

Definition at line 56 of file FunctionalImage.h.

References std::forward(), and FunctionalImage().

Referenced by SourceXtractor::Frame< T >::applyFilter(), and SourceXtractor::BgDFTConvolutionImageSource::generateTile().

Here is the call graph for this function:

◆ getChunk()

template<typename T, typename I = T>
std::shared_ptr< ImageChunk< T > > SourceXtractor::FunctionalImage< T, I >::getChunk ( int x,
int y,
int width,
int height ) const
inlinefinalvirtual

Implements SourceXtractor::Image< T >.

Definition at line 72 of file FunctionalImage.h.

References SourceXtractor::UniversalImageChunk< T >::create(), m_functor, and m_img.

Here is the call graph for this function:

◆ getHeight()

template<typename T, typename I = T>
int SourceXtractor::FunctionalImage< T, I >::getHeight ( ) const
inlinefinalvirtual

Returns the height of the image in pixels.

Implements SourceXtractor::Image< T >.

Definition at line 68 of file FunctionalImage.h.

References m_img.

◆ getRepr()

template<typename T, typename I = T>
std::string SourceXtractor::FunctionalImage< T, I >::getRepr ( ) const
inlinefinalvirtual

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

Implements SourceXtractor::Image< T >.

Definition at line 60 of file FunctionalImage.h.

References m_functor.

◆ getWidth()

template<typename T, typename I = T>
int SourceXtractor::FunctionalImage< T, I >::getWidth ( ) const
inlinefinalvirtual

Returns the width of the image in pixels.

Implements SourceXtractor::Image< T >.

Definition at line 64 of file FunctionalImage.h.

References m_img.

Member Data Documentation

◆ m_functor

template<typename T, typename I = T>
FunctorType SourceXtractor::FunctionalImage< T, I >::m_functor
private

Definition at line 85 of file FunctionalImage.h.

Referenced by FunctionalImage(), getChunk(), and getRepr().

◆ m_img

template<typename T, typename I = T>
std::shared_ptr<const Image<I> > SourceXtractor::FunctionalImage< T, I >::m_img
private

Definition at line 84 of file FunctionalImage.h.

Referenced by FunctionalImage(), getChunk(), getHeight(), and getWidth().


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