AVIR
High-quality pro image resizing library
 All Classes Files Functions Variables Typedefs Macros
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
avir::CLancIR::CResizeFilters Class Reference

#include <lancir.h>

Classes

class  CSinGen
 

Public Member Functions

float * getFilter (const double x)
 
bool update (const double la, const double k)
 

Public Attributes

int KernelLen
 

Protected Member Functions

template<class T >
void makeFilter (const double FracDelay, T *op) const
 
template<class T >
void normalizeFilter (T *const p) const
 

Protected Attributes

float * FilterBuf
 
int FilterBufLen
 
float ** Filters
 
int FiltersLen
 
int fl2
 
int FracCount
 
int FracFill
 
double Freq
 
double FreqA
 
double Len2
 
double NormFreq
 
double Prevk
 
double Prevla
 

Friends

class CResizeScanline
 

Detailed Description

Class implements fractional delay filter bank calculation.

Member Function Documentation

float* avir::CLancIR::CResizeFilters::getFilter ( const double  x)

Function returns filter at the specified fractional offset. This function can only be called before the prior update() function call.

Parameters
xFractional offset, [0; 1).
template<class T >
void avir::CLancIR::CResizeFilters::makeFilter ( const double  FracDelay,
T *  op 
) const
protected

Function creates filter for the specified fractional delay. The update() function should be called prior to calling this function. The created filter is not normalized, so it should be normalized afterwards.

Parameters
FracDelayFractional delay, 0 to 1, inclusive.
[out]Outputfilter buffer.
Template Parameters
TOutput buffer type.
template<class T >
void avir::CLancIR::CResizeFilters::normalizeFilter ( T *const  p) const
protected

Function normalizes the specified filter so that it has unity gain at DC.

Parameters
pFilter buffer pointer.
Template Parameters
TFilter buffer type.
bool avir::CLancIR::CResizeFilters::update ( const double  la,
const double  k 
)

Function updates the resizing filter bank.

Parameters
laLanczos "a" parameter value.
kResizing step.
Returns
"True" if update occured and resizing positions should be updated unconditionally.

Member Data Documentation

float* avir::CLancIR::CResizeFilters::FilterBuf
protected

Buffer that holds all filters.

int avir::CLancIR::CResizeFilters::FilterBufLen
protected

Allocated length of FilterBuf in elements.

float** avir::CLancIR::CResizeFilters::Filters
protected

Fractional delay filters for all positions. Filter pointers equal NULL if filter was not yet created.

int avir::CLancIR::CResizeFilters::FiltersLen
protected

Allocated length of Filters in elements.

int avir::CLancIR::CResizeFilters::fl2
protected

Half resampling length, integer.

int avir::CLancIR::CResizeFilters::FracCount
protected

The number of fractional positions for which filters are created.

int avir::CLancIR::CResizeFilters::FracFill
protected

The number of fractional positions filled in the filter buffer.

double avir::CLancIR::CResizeFilters::Freq
protected

Circular frequency of the filter.

double avir::CLancIR::CResizeFilters::FreqA
protected

Circular frequency of the window function.

int avir::CLancIR::CResizeFilters::KernelLen

Resampling filter kernel length, taps. Available after the update() function call.

double avir::CLancIR::CResizeFilters::Len2
protected

Half resampling filter length, unrounded.

double avir::CLancIR::CResizeFilters::NormFreq
protected

Normalized frequency of the filter.

double avir::CLancIR::CResizeFilters::Prevk
protected

Previous "k".

double avir::CLancIR::CResizeFilters::Prevla
protected

Previous "la".