SourceXtractorPlusPlus  0.16
Please provide a description of the project.
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 class  InterpolationType { BILINEAR , 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, MetadataEntrygetMetadata () const
 
virtual void setMetadata (std::string, MetadataEntry)
 

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 35 of file ScaledImageSource.h.

Member Enumeration Documentation

◆ InterpolationType

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

Interpolation type: bilinear or bicubic.

Enumerator
BILINEAR 
BICUBIC 

Definition at line 38 of file ScaledImageSource.h.

Constructor & Destructor Documentation

◆ ScaledImageSource()

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

◆ ~ScaledImageSource()

template<typename T >
virtual SourceXtractor::ScaledImageSource< T >::~ScaledImageSource ( )
virtualdefault

Destructor

Member Function Documentation

◆ getHeight()

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

Implements SourceXtractor::ImageSource.

Definition at line 152 of file ScaledImageSource.h.

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

◆ getImageTile()

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 118 of file ScaledImageSource.h.

References SourceXtractor::ImageTile::create(), SourceXtractor::ImageTile::getTypeValue(), 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(), x, and y.

Here is the call graph for this function:

◆ getRepr()

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

Implements SourceXtractor::ImageSource.

Definition at line 101 of file ScaledImageSource.h.

◆ getType()

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

Implements SourceXtractor::ImageSource.

Definition at line 156 of file ScaledImageSource.h.

References SourceXtractor::ImageTile::getTypeValue().

Here is the call graph for this function:

◆ getWidth()

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

Implements SourceXtractor::ImageSource.

Definition at line 145 of file ScaledImageSource.h.

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

◆ saveTile()

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 138 of file ScaledImageSource.h.

Member Data Documentation

◆ m_height

template<typename T >
int SourceXtractor::ScaledImageSource< T >::m_height
private

◆ m_hscale

template<typename T >
double SourceXtractor::ScaledImageSource< T >::m_hscale
private

◆ m_image

template<typename T >
std::shared_ptr<Image<T> > SourceXtractor::ScaledImageSource< T >::m_image
private

Definition at line 161 of file ScaledImageSource.h.

◆ m_interpolated_cols

template<typename T >
std::vector<std::unique_ptr<Euclid::MathUtils::Function> > SourceXtractor::ScaledImageSource< T >::m_interpolated_cols
private

◆ m_interpolation_type

template<typename T >
Euclid::MathUtils::InterpolationType SourceXtractor::ScaledImageSource< T >::m_interpolation_type
private

◆ m_width

template<typename T >
int SourceXtractor::ScaledImageSource< T >::m_width
private

◆ m_wscale

template<typename T >
double SourceXtractor::ScaledImageSource< T >::m_wscale
private

◆ m_x_coords

template<typename T >
std::vector<double> SourceXtractor::ScaledImageSource< T >::m_x_coords
private

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