SourceXtractorPlusPlus  0.13
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Attributes | List of all members
SourceXtractor::ScaledImageSource< T > Class Template Reference

#include <ScaledImageSource.h>

Inheritance diagram for SourceXtractor::ScaledImageSource< T >:
[legend]
Collaboration diagram for SourceXtractor::ScaledImageSource< T >:
[legend]

Public Types

enum  InterpolationType { InterpolationType::BILINEAR, InterpolationType::BICUBIC }
 Interpolation type: bilinear or bicubic. More...
 

Public Member Functions

 ScaledImageSource (const std::shared_ptr< Image< T >> &image, int width, int height, InterpolationType interp_type=InterpolationType::BICUBIC)
 
virtual ~ScaledImageSource ()=default
 
std::string getRepr () const final
 
std::shared_ptr< ImageTilegetImageTile (int x, int y, int width, int height) const final
 
void saveTile (ImageTile &) final
 
int getWidth () const final
 
int getHeight () const final
 
ImageTile::ImageType getType () const override
 
- Public Member Functions inherited from SourceXtractor::ImageSource
 ImageSource ()
 
virtual ~ImageSource ()=default
 
virtual const std::map
< std::string, MetadataEntry
getMetadata () const
 
virtual void setMetadata (std::string key, MetadataEntry value)
 

Private Attributes

std::shared_ptr< Image< T > > m_image
 
int m_width
 
int m_height
 
Euclid::MathUtils::InterpolationType m_interpolation_type
 
std::vector< std::unique_ptr
< Euclid::MathUtils::Function > > 
m_interpolated_cols
 
std::vector< double > m_x_coords
 
double m_wscale
 
double m_hscale
 

Detailed Description

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

Scales an image to a target width and height. Note that the original image grid is centered on the target one, so values on the edges are actually extrapolated.

Template Parameters
TPixel type

Definition at line 34 of file ScaledImageSource.h.

Member Enumeration Documentation

template<typename T >
enum SourceXtractor::ScaledImageSource::InterpolationType
strong

Interpolation type: bilinear or bicubic.

Enumerator
BILINEAR 
BICUBIC 

Definition at line 37 of file ScaledImageSource.h.

Constructor & Destructor Documentation

template<typename T >
SourceXtractor::ScaledImageSource< T >::ScaledImageSource ( const std::shared_ptr< Image< T >> &  image,
int  width,
int  height,
InterpolationType  interp_type = InterpolationType::BICUBIC 
)
inline
template<typename T >
virtual SourceXtractor::ScaledImageSource< T >::~ScaledImageSource ( )
virtualdefault

Destructor

Member Function Documentation

template<typename T >
int SourceXtractor::ScaledImageSource< T >::getHeight ( ) const
inlinefinalvirtual
Returns
Upscaled height

Implements SourceXtractor::ImageSource.

Definition at line 149 of file ScaledImageSource.h.

References SourceXtractor::ScaledImageSource< T >::m_height.

template<typename T >
std::shared_ptr<ImageTile> SourceXtractor::ScaledImageSource< T >::getImageTile ( int  x,
int  y,
int  width,
int  height 
) const
inlinefinalvirtual

Get a tile from the scaled image

Parameters
xTile offset on the X coordinate
yTile offset on the Y coordinate
widthTile width
heightTile height
Returns
An initialized upscaled tile

Implements SourceXtractor::ImageSource.

Definition at line 115 of file ScaledImageSource.h.

References SourceXtractor::ImageTile::create(), SourceXtractor::ImageTile::getTypeValue(), ModelFitting::height, Euclid::MathUtils::interpolate(), SourceXtractor::ScaledImageSource< T >::m_interpolated_cols, SourceXtractor::ScaledImageSource< T >::m_interpolation_type, SourceXtractor::ScaledImageSource< T >::m_x_coords, std::vector< T >::size(), ModelFitting::width, x, and y.

Here is the call graph for this function:

template<typename T >
std::string SourceXtractor::ScaledImageSource< T >::getRepr ( ) const
inlinefinalvirtual
Returns
Human readable representation of this object

Implements SourceXtractor::ImageSource.

Definition at line 98 of file ScaledImageSource.h.

template<typename T >
ImageTile::ImageType SourceXtractor::ScaledImageSource< T >::getType ( ) const
inlineoverridevirtual

Implements SourceXtractor::ImageSource.

Definition at line 153 of file ScaledImageSource.h.

References SourceXtractor::ImageTile::getTypeValue().

Here is the call graph for this function:

template<typename T >
int SourceXtractor::ScaledImageSource< T >::getWidth ( ) const
inlinefinalvirtual
Returns
Upscaled width

Implements SourceXtractor::ImageSource.

Definition at line 142 of file ScaledImageSource.h.

References SourceXtractor::ScaledImageSource< T >::m_width.

template<typename T >
void SourceXtractor::ScaledImageSource< T >::saveTile ( ImageTile )
inlinefinalvirtual

A tile of this type can not be saved

Implements SourceXtractor::ImageSource.

Definition at line 135 of file ScaledImageSource.h.

Member Data Documentation

template<typename T >
int SourceXtractor::ScaledImageSource< T >::m_height
private
template<typename T >
double SourceXtractor::ScaledImageSource< T >::m_hscale
private
template<typename T >
std::shared_ptr<Image<T> > SourceXtractor::ScaledImageSource< T >::m_image
private

Definition at line 158 of file ScaledImageSource.h.

template<typename T >
std::vector<std::unique_ptr<Euclid::MathUtils::Function> > SourceXtractor::ScaledImageSource< T >::m_interpolated_cols
private
template<typename T >
Euclid::MathUtils::InterpolationType SourceXtractor::ScaledImageSource< T >::m_interpolation_type
private
template<typename T >
int SourceXtractor::ScaledImageSource< T >::m_width
private
template<typename T >
double SourceXtractor::ScaledImageSource< T >::m_wscale
private
template<typename T >
std::vector<double> SourceXtractor::ScaledImageSource< T >::m_x_coords
private

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