SourceXtractorPlusPlus  0.16
Please provide a description of the project.
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
SourceXtractor::FunctionalImage< T, I > Class Template Reference

#include <FunctionalImage.h>

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

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. More...
 
int getWidth () const final
 Returns the width of the image in pixels. More...
 
int getHeight () const final
 Returns the height of the image in pixels. More...
 
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. More...
 
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. More...
 

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 std::move().

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>
static std::shared_ptr<FunctionalImage<T, I> > SourceXtractor::FunctionalImage< T, I >::create ( Args &&...  args)
inlinestatic

◆ 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(), SourceXtractor::FunctionalImage< T, I >::m_functor, SourceXtractor::FunctionalImage< T, I >::m_img, x, and y.

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 SourceXtractor::FunctionalImage< T, I >::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 SourceXtractor::FunctionalImage< T, I >::m_functor, and std::function::target_type().

Here is the call graph for this function:

◆ 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 SourceXtractor::FunctionalImage< T, I >::m_img.

Member Data Documentation

◆ m_functor

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

◆ m_img

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

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