Inviwo  0.9.10.1
Inviwo documentation
inviwo::TemplateImageSampler< T, P > Class Template Reference

TemplateImageSampler<T,P> aids sampling of images of a given type (T) using Bi-Linear Interpolation with precision (P). More...

#include <imagesampler.h>

Public Member Functions

 TemplateImageSampler (const LayerRAM *ram)
 
 TemplateImageSampler (const Layer *layer)
 
 TemplateImageSampler (const Image *img)
 
 TemplateImageSampler (std::shared_ptr< const Image > sharedImage)
 
sample (const Vector< 2, P > &pos)
 
sample (P x, P y)
 

Detailed Description

template<typename T, typename P>
class inviwo::TemplateImageSampler< T, P >

TemplateImageSampler<T,P> aids sampling of images of a given type (T) using Bi-Linear Interpolation with precision (P).

A helper class to aid sampling of images of a given type (T). Expects the input to be on the range [0 1]. Eg., input of (0,0) will return the color of the bottom left pixel and (1,1) will return then top right pixel. Output values are bi-linear interpolated between the 4 nearest neighbors.

The template parameter P should be either double or float. When T is either float our double P should be the same.

Member Function Documentation

◆ sample() [1/2]

template<typename T , typename P >
T inviwo::TemplateImageSampler< T, P >::sample ( const Vector< 2, P > &  pos)

Samples the image at the given position using bi-linear interpolation.

Parameters
posPosition to sample at, expects range [0 1]

◆ sample() [2/2]

template<typename T , typename P >
T inviwo::TemplateImageSampler< T, P >::sample ( x,
y 
)
See also
sample()
Parameters
xX coordinate of the position to sample at, expects range [0 1]
yY coordinate of the position to sample at, expects range [0 1]

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