00001 #ifndef _VU_VOLUME_LIGHTFIELD_UNIMODAL_VUSPHERICFILTER_H_
00002 #define _VU_VOLUME_LIGHTFIELD_UNIMODAL_VUSPHERICFILTER_H_
00003
00004 #include "spheric.h"
00005 #include "General/vuMisc/vuFilter.h"
00006 #include "General/vuLightfield/vuSphericView.h"
00007 #include "General/vuLightfield/vuSphericViewFilter.h"
00008
00009 template <int SIZE, class TYPE> class vu1611;
00010
00011 class vuSphericFilter_ST : public vuFilter
00012 {
00013 public:
00014 vuSphericFilter_ST();
00015 vuSphericFilter_ST(const vuString& filterName);
00016 virtual ~vuSphericFilter_ST();
00017 virtual void preview(int hint=0);
00018 };
00019
00020 template <int SIZE, class TYPE>
00021 class vuSphericFilter : public vuSphericFilter_ST
00022 {
00023
00024 public:
00025 vuSphericFilter();
00026 vuSphericFilter(const vuString &filterName);
00027
00028 vuSphericFilter(const vuSphericFilter<SIZE,TYPE> &other);
00029
00030 virtual ~vuSphericFilter();
00031
00033 void setVolume(vu1611<SIZE,TYPE> *volume);
00034
00036 vu1611<SIZE,TYPE> *getVolume();
00037
00041 virtual
00042 void calcFilteredViews(vuSphericView<SIZE,TYPE>**& views, dword& count) = 0;
00043
00046 void applyFilteredViews(vuSphericViewFilter<SIZE,TYPE> *viewFilter);
00047
00048 bool operator==(const vuSphericFilter<SIZE,TYPE> &other);
00049
00050 bool operator!=(const vuSphericFilter<SIZE,TYPE> &other);
00051
00052 protected:
00054 vu1611<SIZE,TYPE> *m_volume;
00055
00056 void log(const char *msg);
00057
00061 bool getNearestViews(dword* &idxList, dword &count);
00062 bool getNearestViews(dword* &idxList, dword &count, vuVector lookFrom);
00063
00064 public:
00065 static bool getNearestViews(dword* &idxList, dword &count,
00066 vuVector lookFrom, dword numOfViews,
00067 vuSphericView<SIZE,TYPE>* &views);
00068
00069 static bool getNearestViews(dword* &idxList, dword &count,
00070 vuVector lookFrom,dword numOfViews,
00071 vuSphericView<SIZE,TYPE>** views);
00072 };
00073
00074 template class vuSphericFilter<1,byte>;
00075 template class vuSphericFilter<2,byte>;
00076 template class vuSphericFilter<3,byte>;
00077 template class vuSphericFilter<1,float>;
00078 template class vuSphericFilter<2,float>;
00079 template class vuSphericFilter<3,float>;
00080
00081 typedef vuSphericFilter<1,byte> vuSphericFilter1B;
00082 typedef vuSphericFilter<2,byte> vuSphericFilter2B;
00083 typedef vuSphericFilter<3,byte> vuSphericFilter3B;
00084 typedef vuSphericFilter<1,float> vuSphericFilter1F;
00085 typedef vuSphericFilter<2,float> vuSphericFilter2F;
00086 typedef vuSphericFilter<3,float> vuSphericFilter3F;
00087
00088 #endif