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

#include <ImageChunk.h>

Inheritance diagram for SourceXtractor::UniversalImageChunk< T >:
Collaboration diagram for SourceXtractor::UniversalImageChunk< T >:

Public Member Functions

virtual ~UniversalImageChunk ()
void setValue (int x, int y, T value)
T & at (int x, int y)
Public Member Functions inherited from SourceXtractor::ImageChunk< T >
virtual ~ImageChunk ()
std::string getRepr () const override
 Get a string identifying this image in a human readable manner.
getValue (int x, int y) const
 Returns the value of the pixel with the coordinates (x,y).
getValue (const PixelCoordinate &coord) const
int getWidth () const final
 Returns the width of the image chunk in pixels.
int getHeight () const final
 Returns the height of the image chunk in pixels.
std::shared_ptr< ImageChunk< T > > getChunk (int x, int y, int width, int height) const override
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< UniversalImageChunk< T > > create (Args &&... args)
Static Public Member Functions inherited from SourceXtractor::ImageChunk< T >
static std::shared_ptr< ImageChunk< T > > create (std::shared_ptr< const std::vector< T > > data, int offset, int width, int height, int stride)

Protected Member Functions

 UniversalImageChunk (ImageChunk< T > &&chunk)
 UniversalImageChunk (const Image< T > *image, int x, int y, int width, int height)
 UniversalImageChunk (std::vector< T > &&data, int width, int height)
 UniversalImageChunk (int width, int height)
Protected Member Functions inherited from SourceXtractor::ImageChunk< T >
 ImageChunk (std::shared_ptr< const std::vector< T > > data, int offset, int width, int height, int stride)

Private Attributes

std::shared_ptr< std::vector< T > > m_chunk_vector

Additional Inherited Members

Public Types inherited from SourceXtractor::Image< T >
using PixelType = T
Protected Attributes inherited from SourceXtractor::ImageChunk< T >
std::shared_ptr< const std::vector< T > > m_data
int m_offset
int m_stride
int m_width
int m_height

Detailed Description

template<typename T>
class SourceXtractor::UniversalImageChunk< T >

Definition at line 89 of file ImageChunk.h.

Constructor & Destructor Documentation

◆ UniversalImageChunk() [1/4]

template<typename T>
SourceXtractor::UniversalImageChunk< T >::UniversalImageChunk ( ImageChunk< T > && chunk)
inlineexplicitprotected

This move constructor from an ImageChunk uses a dynamic cast, so if the chunk is another universal chunk, we can avoid copying data, and we just move-assign the underlying vector

Definition at line 97 of file ImageChunk.h.

References SourceXtractor::ImageChunk< T >::getHeight(), SourceXtractor::ImageChunk< T >::getWidth(), SourceXtractor::ImageChunk< T >::ImageChunk(), m_chunk_vector, SourceXtractor::ImageChunk< T >::m_data, SourceXtractor::ImageChunk< T >::m_height, SourceXtractor::ImageChunk< T >::m_stride, SourceXtractor::ImageChunk< T >::m_width, std::make_shared(), std::move(), and UniversalImageChunk().

Referenced by create(), and UniversalImageChunk().

Here is the call graph for this function:

◆ UniversalImageChunk() [2/4]

template<typename T>
SourceXtractor::UniversalImageChunk< T >::UniversalImageChunk ( const Image< T > * image,
int x,
int y,
int width,
int height )
inlineprotected

Definition at line 114 of file ImageChunk.h.

References SourceXtractor::ImageChunk< T >::ImageChunk(), m_chunk_vector, SourceXtractor::ImageChunk< T >::m_data, and std::make_shared().

Here is the call graph for this function:

◆ UniversalImageChunk() [3/4]

template<typename T>
SourceXtractor::UniversalImageChunk< T >::UniversalImageChunk ( std::vector< T > && data,
int width,
int height )
inlineprotected

Definition at line 127 of file ImageChunk.h.

References SourceXtractor::ImageChunk< T >::ImageChunk(), m_chunk_vector, SourceXtractor::ImageChunk< T >::m_data, std::make_shared(), and std::move().

Here is the call graph for this function:

◆ UniversalImageChunk() [4/4]

template<typename T>
SourceXtractor::UniversalImageChunk< T >::UniversalImageChunk ( int width,
int height )
inlineprotected

Definition at line 135 of file ImageChunk.h.

References SourceXtractor::ImageChunk< T >::ImageChunk(), m_chunk_vector, SourceXtractor::ImageChunk< T >::m_data, and std::make_shared().

Here is the call graph for this function:

◆ ~UniversalImageChunk()

template<typename T>
virtual SourceXtractor::UniversalImageChunk< T >::~UniversalImageChunk ( )
inlinevirtual

Definition at line 148 of file ImageChunk.h.

Member Function Documentation

◆ at()

template<typename T>
T & SourceXtractor::UniversalImageChunk< T >::at ( int x,
int y )
inline

Definition at line 155 of file ImageChunk.h.

References m_chunk_vector, and SourceXtractor::ImageChunk< T >::m_stride.

◆ create()

◆ setValue()

template<typename T>
void SourceXtractor::UniversalImageChunk< T >::setValue ( int x,
int y,
T value )
inline

Definition at line 151 of file ImageChunk.h.

References SourceXtractor::ImageChunk< T >::m_stride.

Member Data Documentation

◆ m_chunk_vector

template<typename T>
std::shared_ptr<std::vector<T> > SourceXtractor::UniversalImageChunk< T >::m_chunk_vector
private

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