SourceXtractorPlusPlus  0.11
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Protected Member Functions | Protected Attributes | List of all members
SourceXtractor::PaddedImage< T, nullptr > Class Template Reference

#include <PaddedImage.h>

Inheritance diagram for SourceXtractor::PaddedImage< T, nullptr >:
[legend]
Collaboration diagram for SourceXtractor::PaddedImage< T, nullptr >:
[legend]

Protected Member Functions

 PaddedImage (std::shared_ptr< const Image< T >> img, int width, int height, T default_value)
 
 PaddedImage (std::shared_ptr< const Image< T >> img, int width, int height)
 

Protected Attributes

int m_width
 
int m_height
 
int m_lpad
 
int m_tpad
 
m_default
 

Additional Inherited Members

- Public Types inherited from SourceXtractor::Image< T >
using PixelType = T
 
- Public Member Functions inherited from SourceXtractor::ImageBase< T >
virtual ~ImageBase ()
 
virtual 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. More...
 
virtual std::string getRepr () const =0
 Get a string identifying this image in a human readable manner. More...
 
virtual T getValue (int x, int y) const =0
 Returns the value of the pixel with the coordinates (x,y) More...
 
getValue (PixelCoordinate pc) const
 
virtual int getWidth () const =0
 Returns the width of the image in pixels. More...
 
virtual int getHeight () const =0
 Returns the height of the image in pixels. More...
 
- Public Member Functions inherited from std::enable_shared_from_this< ImageBase< T > >
enable_shared_from_this (T...args)
 
operator= (T...args)
 
shared_from_this (T...args)
 
~enable_shared_from_this (T...args)
 

Detailed Description

template<typename T>
class SourceXtractor::PaddedImage< T, nullptr >

Definition at line 117 of file PaddedImage.h.

Constructor & Destructor Documentation

template<typename T >
SourceXtractor::PaddedImage< T, nullptr >::PaddedImage ( std::shared_ptr< const Image< T >>  img,
int  width,
int  height,
default_value 
)
inlineprotected

Definition at line 119 of file PaddedImage.h.

template<typename T >
SourceXtractor::PaddedImage< T, nullptr >::PaddedImage ( std::shared_ptr< const Image< T >>  img,
int  width,
int  height 
)
inlineprotected

Definition at line 128 of file PaddedImage.h.

Member Data Documentation

template<typename T >
T SourceXtractor::PaddedImage< T, nullptr >::m_default
protected

Definition at line 160 of file PaddedImage.h.

template<typename T >
int SourceXtractor::PaddedImage< T, nullptr >::m_height
protected

Definition at line 128 of file PaddedImage.h.

template<typename T >
int SourceXtractor::PaddedImage< T, nullptr >::m_lpad
protected

Definition at line 159 of file PaddedImage.h.

template<typename T >
int SourceXtractor::PaddedImage< T, nullptr >::m_tpad
protected

Definition at line 159 of file PaddedImage.h.

template<typename T >
int SourceXtractor::PaddedImage< T, nullptr >::m_width
protected
Initial value:
{
}
public:
template<typename... Args>
static std::shared_ptr<PaddedImage<T, nullptr>> create(Args &&... args) {
return std::shared_ptr<PaddedImage<T, nullptr>>(new PaddedImage{std::forward<Args>(args)...});
}
std::string getRepr() const override {
return "PaddedImage(" + m_img->getRepr() + ")";
}
T getValue(int x, int y) const override {
if (x < m_lpad || y < m_tpad || x >= m_img->getWidth() + m_lpad || y >= m_img->getHeight() + m_tpad) {
return m_default;
}
return m_img->getValue(x - m_lpad, y - m_tpad);
}
int getWidth() const override {
return m_width;
}
int getHeight() const override {
return m_height;
}
private:

Definition at line 128 of file PaddedImage.h.


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