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

SpecFVR/Filter.h

Go to the documentation of this file.
00001 #ifndef _FILTER_H_
00002 #define _FILTER_H_
00003 
00004 #include "vuVector.h"
00005 #include "vuSimpleTypes.h"
00006 
00007 #define FILTER_TABLE_SIZE  20
00008 #define FILTER_TABLE_MAX   19
00009 
00010 namespace SpecFVRNS 
00011 {
00012     
00013 class Filter
00014 {
00015 public:
00016         inline Filter();
00017         inline Filter(Filter& f);
00018         virtual ~Filter();
00019 
00020         inline float* getWeights(vuVector& t);
00021         virtual dword getWidth(void) = 0;
00022 
00023         inline Filter& operator=(Filter& rhs);
00024 
00025 protected:
00026         float* m_Weights;   // A table of weights
00027     dword m_FilterSize;
00028 };
00029 
00030 inline Filter::Filter() : m_Weights(0)
00031 {
00032 }
00033 
00034 inline Filter::Filter(Filter& f)
00035 {
00036 }
00037 
00038 inline Filter::~Filter()
00039 {
00040     if (m_Weights) {
00041         delete [] m_Weights;
00042         m_Weights = NULL;
00043     }
00044 }
00045 
00046 inline Filter& Filter::operator=(Filter& rhs)
00047 {
00048         return *this;
00049 }
00050 
00051 inline float* Filter::getWeights(vuVector& t)
00052 {
00053         int i = (int)((t[0] * FILTER_TABLE_MAX) + 0.5);
00054         int j = (int)((t[1] * FILTER_TABLE_MAX) + 0.5);
00055         int k = (int)((t[2] * FILTER_TABLE_MAX) + 0.5);
00056         return &m_Weights[((k * FILTER_TABLE_SIZE + j) * FILTER_TABLE_SIZE + i) * m_FilterSize];
00057 }
00058  
00059 }
00060 
00061 #endif

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