Terminal Graphics
Single-file, header-only C++20 functionality for producing graphics on the terminal using the sixel protocol
Loading...
Searching...
No Matches
TG::Rescale< ImageType > Class Template Reference

Adapter class to rescale intensities of image to colourmap indices. More...

Public Member Functions

 Rescale (const ImageType &image, double minval, double maxval, int cmap_size)
 
int width () const
 
int height () const
 
ctype operator() (int x, int y) const
 

Detailed Description

template<class ImageType>
class TG::Rescale< ImageType >

Adapter class to rescale intensities of image to colourmap indices.

Rescale intensities of image from (min, max) to the range of indices in the specified colourmap, rounding to the nearest integer index, and clamping the values to the [ min max ] range.

Constructor & Destructor Documentation

◆ Rescale()

template<class ImageType>
TG::Rescale< ImageType >::Rescale ( const ImageType & image,
double minval,
double maxval,
int cmap_size )
inline

Member Function Documentation

◆ width()

template<class ImageType>
int TG::Rescale< ImageType >::width ( ) const
inline

◆ height()

template<class ImageType>
int TG::Rescale< ImageType >::height ( ) const
inline

◆ operator()()

template<class ImageType>
ctype TG::Rescale< ImageType >::operator() ( int x,
int y ) const
inline