AVIR
High-quality pro image resizing library
 All Classes Files Functions Variables Typedefs Macros
Classes | Public Attributes | Static Public Attributes | List of all members
avir::CImageResizerFilterStep< fptype, fptypeatom > Class Template Reference

#include <avir.h>

Inheritance diagram for avir::CImageResizerFilterStep< fptype, fptypeatom >:
avir::CImageResizerFilterStepINL< fptype, fptypeatom >

Classes

struct  CResizePos
 
class  CRPosBuf
 
class  CRPosBufArray
 

Public Attributes

double DCGain
 
int EdgePixelCount
 
CBuffer< fptype > Flt
 
CDSPFracFilterBankLin< fptype > * FltBank
 
int FltLatency
 
CFltBuffer FltOrig
 
int InBuf
 
int InElIncr
 
int InLen
 
int InPrefix
 
int InSuffix
 
bool IsUpsample
 
int OutBuf
 
int OutElIncr
 
int OutLen
 
int OutPrefix
 
int OutSuffix
 
CBuffer< fptype > PrefixDC
 
int ResampleFactor
 
CRPosBufRPosBuf
 
CBuffer< fptype > SuffixDC
 
const CImageResizerVarsVars
 

Static Public Attributes

static const int EdgePixelCountDef = 3
 

Detailed Description

template<class fptype, class fptypeatom>
class avir::CImageResizerFilterStep< fptype, fptypeatom >

Image resizer's filtering step class.

Class defines data to perform a single filtering step over a whole horizontal or vertical scanline. Resizing consists of 1 or more steps that may be performed before the actual resizing takes place. Filtering may also follow a resizing step. Each step must ensure that scanline data contains enough pixels to perform the next step (which may be resizing) without exceeding scanline's bounds.

A derived class must implement several "const" and "static" functions that are used to perform the actual filtering in interleaved or de-interleaved mode.

Template Parameters
fptypeFloating point type to use for storing pixel elements. SIMD types can be used: in this case each element may hold a whole pixel.
fptypeatomThe atomic type the "fptype" consists of.

Member Data Documentation

template<class fptype, class fptypeatom>
double avir::CImageResizerFilterStep< fptype, fptypeatom >::DCGain

DC gain which was applied to the filter. Not defined if ResampleFactor = 0.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::EdgePixelCount

The number of edge pixels added. Affects the initial position within the input scanline, used to produce edge pixels. This variable is used and should be defined when IsUpsample=false and ResampleFactor>0. When assigning this variable it is also necessary to update InPrefix, OutLen and Vars.o variables.

template<class fptype, class fptypeatom>
const int avir::CImageResizerFilterStep< fptype, fptypeatom >::EdgePixelCountDef = 3
static

The default number of pixels additionally produced at scanline edges during filtering. This is required to reduce edge artifacts.

template<class fptype, class fptypeatom>
CBuffer< fptype > avir::CImageResizerFilterStep< fptype, fptypeatom >::Flt

Filter to use at this step.

template<class fptype, class fptypeatom>
CDSPFracFilterBankLin< fptype >* avir::CImageResizerFilterStep< fptype, fptypeatom >::FltBank

Filter bank in use by *this resizing step.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::FltLatency

Filter's latency (group delay, shift) in pixels.

template<class fptype, class fptypeatom>
CFltBuffer avir::CImageResizerFilterStep< fptype, fptypeatom >::FltOrig

Originally-designed filter. This buffer may not be assigned. Assigned by filters that precede the resizing step if such filter is planned to be embedded into the interpolation filter as "external" filter. If IsUpsample=true and this filter buffer is not empty, the upsampling step will not itself apply any filtering over upsampled input scanline.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::InBuf

Input buffer index, 0 or 1.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::InElIncr

Pixel element increment within the input buffer, used during de-interleaved processing: in this case each image's channel is stored independently, InElIncr elements apart.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::InLen

Input scanline's length in pixels.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::InPrefix

Required input prefix pixels. These prefix pixels will be filled with source scanline's first pixel value. If IsUpsample is "true", this is the additional number of times the first pixel will be filtered before processing scanline, this number is also reflected in the OutPrefix.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::InSuffix

Required input suffix pixels. These suffix pixels will be filled with source scanline's last pixel value. If IsUpsample is "true", this is the additional number of times the last pixel will be filtered before processing scanline, this number is also reflected in the OutSuffix.

template<class fptype, class fptypeatom>
bool avir::CImageResizerFilterStep< fptype, fptypeatom >::IsUpsample

"True" if this step is an upsampling step, "false" if downsampling step. Should be set to "false" if ResampleFactor equals 0.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::OutBuf

Output buffer index. 0 or 1; 2 for the last step.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::OutElIncr

Pixel element increment within the output buffer, used during de-interleaved processing. Equals to the InBufElIncr of the next step.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::OutLen

Length of the resulting scanline.

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::OutPrefix

Required output prefix pixels. These prefix pixels will not be pre-filled with any values. Value is valid only if IsUpsample equals "true".

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::OutSuffix

Required input suffix pixels. These suffix pixels will not be pre-filled with any values. Value is valid only if IsUpsample equals "true".

template<class fptype, class fptypeatom>
CBuffer< fptype > avir::CImageResizerFilterStep< fptype, fptypeatom >::PrefixDC

DC component fluctuations added at the start of the resulting scanline, used when IsUpsample equals "true".

template<class fptype, class fptypeatom>
int avir::CImageResizerFilterStep< fptype, fptypeatom >::ResampleFactor

Resample factor (>=1). If 0, this is a resizing step. This value should be >1 if IsUpsample equals "true".

template<class fptype, class fptypeatom>
CRPosBuf* avir::CImageResizerFilterStep< fptype, fptypeatom >::RPosBuf

Resizing positions buffer. Used when ResampleFactor equals 0 (resizing step).

template<class fptype, class fptypeatom>
CBuffer< fptype > avir::CImageResizerFilterStep< fptype, fptypeatom >::SuffixDC

DC component fluctuations added at the end of the resulting scanline, used when IsUpsample equals "true".

template<class fptype, class fptypeatom>
const CImageResizerVars* avir::CImageResizerFilterStep< fptype, fptypeatom >::Vars

Image resizing-related variables.