Inviwo
0.9.10.1
Inviwo documentation
|
ImageSpatialSampler aids sampling of images using Bi-Linear Interpolation. More...
#include <imagesampler.h>
Public Member Functions | |
ImageSpatialSampler (const LayerRAM *ram) | |
ImageSpatialSampler (const Layer *layer) | |
ImageSpatialSampler (const Image *img) | |
ImageSpatialSampler (std::shared_ptr< const Image > sharedImage) | |
Vector< DataDims, T > | sample (double x, double y, CoordinateSpace space) const |
Vector< DataDims, T > | sample (double x, double y) const |
Public Member Functions inherited from inviwo::SpatialSampler< 2, DataDims, T > | |
SpatialSampler (const SpatialEntity< SpatialDims > &spatialEntity, Space space=Space::Data) | |
virtual Vector< DataDims, T > | sample (const Vector< SpatialDims, double > &pos) const |
virtual Vector< DataDims, T > | sample (const Vector< SpatialDims, float > &pos) const |
virtual Vector< DataDims, T > | sample (const Vector< SpatialDims, double > &pos, Space space) const |
virtual Vector< DataDims, T > | sample (const Vector< SpatialDims, float > &pos, Space space) const |
virtual bool | withinBounds (const Vector< SpatialDims, double > &pos) const |
virtual bool | withinBounds (const Vector< SpatialDims, float > &pos) const |
virtual bool | withinBounds (const Vector< SpatialDims, double > &pos, Space space) const |
virtual bool | withinBounds (const Vector< SpatialDims, float > &pos, Space space) const |
Matrix< SpatialDims, float > | getBasis () const |
Matrix< SpatialDims+1, float > | getModelMatrix () const |
Matrix< SpatialDims+1, float > | getWorldMatrix () const |
const SpatialCoordinateTransformer< SpatialDims > & | getCoordinateTransformer () const |
Protected Member Functions | |
virtual Vector< DataDims, T > | sampleDataSpace (const dvec2 &pos) const |
virtual bool | withinBoundsDataSpace (const dvec2 &pos) const |
Protected Member Functions inherited from inviwo::SpatialSampler< 2, DataDims, T > | |
virtual Vector< DataDims, T > | sampleDataSpace (const Vector< SpatialDims, double > &pos) const=0 |
virtual bool | withinBoundsDataSpace (const Vector< SpatialDims, double > &pos) const=0 |
Additional Inherited Members | |
Public Types inherited from inviwo::SpatialSampler< 2, DataDims, T > | |
using | Space = CoordinateSpace |
using | ReturnType = Vector< DataDims, T > |
Static Public Attributes inherited from inviwo::SpatialSampler< 2, DataDims, T > | |
static const unsigned | SpatialDimensions |
static const unsigned | DataDimensions |
Protected Attributes inherited from inviwo::SpatialSampler< 2, DataDims, T > | |
Space | space_ |
const SpatialEntity< SpatialDims > & | spatialEntity_ |
Matrix< SpatialDims+1, double > | transform_ |
ImageSpatialSampler aids sampling of images using Bi-Linear Interpolation.
A helper class to aid sampling of images. 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.
|
inline |
Creates a ImageSpatialSampler for the given LayerRAM, does not take ownership of ram. Use ImageSpatialSampler(std::shared_ptr<const Image>) to ensure that the LayerRAM is available for the lifetime of the ImageSpatialSampler
|
inline |
Creates a ImageSpatialSampler for the given Layer, does not take ownership of ram. Use ImageSpatialSampler(std::shared_ptr<const Image>) to ensure that the Layer is available for the lifetime of the ImageSpatialSampler
|
inline |
Creates a ImageSpatialSampler for the given Image, does not take ownership of ram. Use ImageSpatialSampler(std::shared_ptr<const Image>) to ensure that the Image is available for the lifetime of the ImageSpatialSampler
|
inline |
Creates a ImageSpatialSampler for the given Image. The shared_ptr will ensure that the Image is available for the lifetime of the ImageSpatialSampler
|
inline |
Samples the image at the given position using bi-linear interpolation.
x | position to sample at |
y | position to sample at |
space | in what CoordinateSpace x and y is defined in |
|
inline |
x | X coordinate of the position to sample at |
y | Y coordinate of the position to sample at |