00001 #include "vuTFunc/vuTFDesign.h" 00002 #include "Volume/Fourier/Unimodal/3d/StandardFVR/StandardFVR.h" 00003 #include "vuLightfield/vuSphericView.h" 00004 #include "vuMisc/vuUDSphere.h" 00005 00006 class FourierSlicer_ 00007 { 00008 public: 00009 virtual void lazyCalculateAndDisplay(const char *fileName) = 0; 00010 virtual void lazyCalculateAndLog(const char *fileName) = 0; 00011 virtual dword getImageWidth() = 0; 00012 virtual dword getImageHeight() = 0; 00013 }; 00014 00015 template <int SIZE> 00016 class FourierSlicer : public FourierSlicer_ 00017 { 00018 public: 00019 00020 // file must be an unimodal fourier file (*.vuf), but might have S channels 00021 FourierSlicer(vuString fileName, dword numOfviews, 00022 float scale, float bias, vuString filterName, 00023 vuString timingFileName); 00024 virtual ~FourierSlicer(); 00025 00026 void lazyCalculateAndDisplay(const char *fileName); 00027 void lazyCalculateAndLog(const char *fileName); 00028 00029 dword getImageWidth(); 00030 dword getImageHeight(); 00031 00032 private: 00033 vuUDSphere *m_Sphere ; // Uniform Distribution in Sphere 00034 vu1712_1<SIZE> *m_Fourier; // standard fourier volume renderer 00035 vuTFDesign m_TransFunct; // Transfer function 00036 bool m_isComputed; // is lightfield already computed 00037 dword m_Width; // width of each view 00038 dword m_Height; // height of each view 00039 dword m_NumOfViews; // number of views 00040 dword m_ExternalWidth; // image width for the lightfield 00041 dword m_ExternalHeight; // image height for the lightfield 00042 ostream *m_TimingStream; 00043 00044 void _initTransferFunction(); 00045 void _renderView(dword i, vuSphericView<SIZE,byte> *view, bool verbose=true); 00046 word _numberOfDigits(word number); 00047 void _lazyCalculate(const char *fileName, bool display); 00048 }; 00049 00050 template FourierSlicer<1>; 00051 template FourierSlicer<2>; 00052 template FourierSlicer<3>;