Inviwo
0.9.10.1
Inviwo documentation
|
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) | |
T | sample (const Vector< 2, P > &pos) |
T | sample (P x, P y) |
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.
T inviwo::TemplateImageSampler< T, P >::sample | ( | const Vector< 2, P > & | pos | ) |
Samples the image at the given position using bi-linear interpolation.
pos | Position to sample at, expects range [0 1] |
T inviwo::TemplateImageSampler< T, P >::sample | ( | P | x, |
P | y | ||
) |
x | X coordinate of the position to sample at, expects range [0 1] |
y | Y coordinate of the position to sample at, expects range [0 1] |