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

FVR/Filter.h

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

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