Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuSliceFilter.h

Go to the documentation of this file.
00001 #ifndef __GENERAL_LIGHTFIELD_VU_SLICE_FILTER_H__
00002 #define __GENERAL_LIGHTFIELD_VU_SLICE_FILTER_H__
00003 
00004 #include "vuSimpleTypes.h"
00005 #include "vuMisc/vuFilter.h"
00006 #include <math.h>
00007 
00008 
00009 typedef float (*vuSliceFilterCB)(float);
00010 
00011 class vuSliceFilter : public vuFilter
00012 {
00013  public:
00014   vuSliceFilter();
00015   vuSliceFilter(vuSliceFilterCB cb, const vuString& filterName);
00016   ~vuSliceFilter();
00017 
00018   void setWidth(dword width);
00019   dword getWidth();
00020 
00021   void setKind(byte kind);
00022   byte getKind();
00023 
00024   // 1.0 -> no filtering (100%), 0.01 -> strong filtering (1%)
00025   void setLowPassFactor(float lowPass);
00026   float getLowPassFactor();
00027 
00028   inline float vuSliceFilter::getWeight(float x)
00029   { 
00030     return (fabs(x) > 1.0f) ? 0.0f : m_Callback(x);
00031   };
00032 
00033   inline float vuSliceFilter::getTransformedWeight(float x) 
00034   {
00035       if (x == 0)
00036         return m_FilterWidth;
00037       else {
00038         float xx = (m_FilterWidth * x) / (2 * M_PI);
00039         return m_FilterWidth * (sin(xx)/xx);
00040       }
00041   }
00042 
00043   static void getFilterNames(vuString* &filterNames, dword& numOfNames);
00044   static vuSliceFilter *getFilter(const vuString& filterName);
00045 
00046  private:
00047   vuSliceFilterCB m_Callback;
00048   vuSliceFilterCB m_TransformedCallback;
00049   dword           m_FilterWidth;
00050   byte            m_FilterKind;
00051   float           m_LowPassFactor;
00052 };
00053 
00054 float vuSliceFilter_box(float x);
00055 float vuSliceFilter_linear(float x);
00056 float vuSliceFilter_quadratic(float x);
00057 float vuSliceFilter_cubic(float x);
00058 float vuSliceFilter_gaussian(float x);
00059 
00060 #endif /* __GENERAL_LIGHTFIELD_VU_SLICE_FILTER_H__ */

Generated on Wed Dec 15 21:20:36 2004 for vuVolume by  doxygen 1.3.9.1