Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Resampler< Scalar > Struct Template Reference

Utility class for efficiently resampling discrete datasets to different resolutions. More...

#include <mitsuba/core/rfilter.h>

Public Member Functions

 Resampler (const ReconstructionFilter *rfilter, ReconstructionFilter::EBoundaryCondition bc, int sourceRes, int targetRes)
 Create a new Resampler object that transforms between the specified resolutions. More...
 
 ~Resampler ()
 Release all memory. More...
 
void resampleAndClamp (const Scalar *source, size_t sourceStride, Scalar *target, size_t targetStride, int channels, Scalar min=(Scalar) 0, Scalar max=(Scalar) 1)
 Resample a multi-channel array and clamp the results to a specified valid range. More...
 
void resample (const Scalar *source, size_t sourceStride, Scalar *target, size_t targetStride, int channels)
 Resample a multi-channel array. More...
 

Detailed Description

template<typename Scalar>
struct mitsuba::Resampler< Scalar >

Utility class for efficiently resampling discrete datasets to different resolutions.

Template Parameters
ScalarDenotes the underlying floating point data type (i.e. half, float, or double)

Constructor & Destructor Documentation

template<typename Scalar >
mitsuba::Resampler< Scalar >::Resampler ( const ReconstructionFilter rfilter,
ReconstructionFilter::EBoundaryCondition  bc,
int  sourceRes,
int  targetRes 
)
inline

Create a new Resampler object that transforms between the specified resolutions.

This constructor precomputes all information needed to efficiently perform the desired resampling operation. For that reason, it is most efficient if it can be used over and over again (e.g. to resample the equal-sized rows of a bitmap)

Parameters
sourceResSource resolution
targetResDesired target resolution
bcBoundary conditions that should be observed when looking up samples outside of the defined input domain.
template<typename Scalar >
mitsuba::Resampler< Scalar >::~Resampler ( )
inline

Release all memory.

Member Function Documentation

template<typename Scalar >
void mitsuba::Resampler< Scalar >::resample ( const Scalar *  source,
size_t  sourceStride,
Scalar *  target,
size_t  targetStride,
int  channels 
)
inline

Resample a multi-channel array.

Parameters
sourceSource array of samples
targetTarget array of samples
sourceStrideStride of samples in the source array. A value of '1' implies that they are densely packed.
targetStrideStride of samples in the source array. A value of '1' implies that they are densely packed.
channelsNumber of channels to be resampled
template<typename Scalar >
void mitsuba::Resampler< Scalar >::resampleAndClamp ( const Scalar *  source,
size_t  sourceStride,
Scalar *  target,
size_t  targetStride,
int  channels,
Scalar  min = (Scalar) 0,
Scalar  max = (Scalar) 1 
)
inline

Resample a multi-channel array and clamp the results to a specified valid range.

This function is preferred if too large positive/negative values due to ringing are unacceptable.

Parameters
sourceSource array of samples
targetTarget array of samples
sourceStrideStride of samples in the source array. A value of '1' implies that they are densely packed.
targetStrideStride of samples in the source array. A value of '1' implies that they are densely packed.
channelsNumber of channels to be resampled
minMinumum sample value after resampling
maxMaximum sample value after resampling

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