ReconstructionRenderOutput.h

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @class  ReconstructionRenderOutput
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Records point samples from a renderer and attempts to reconstruct the 
00009    underlying image by filtering samples with a reconstruction filter
00010    <!-------------------------------------------------------------------->**/
00011 
00012 #ifndef RECONSTRUCTION_RENDER_OUTPUT_H_
00013 #define RECONSTRUCTION_RENDER_OUTPUT_H_
00014 
00015 #include <renderers/RenderOutput.h>
00016 #include <filters/KernelFilter.h>
00017 #include <filters/ProgressiveFilterValue.h>
00018 #include <common/image/Image.h>
00019 
00020 class ReconstructionRenderOutput : public RenderOutput {
00021    
00022    public:
00023       ///@name Constructors
00024       //@{-----------------------------------------------------------------
00025       
00026       explicit ReconstructionRenderOutput(Image *output = NULL, 
00027                                           KernelFilter *filter = NULL);
00028       
00029       virtual ~ReconstructionRenderOutput();
00030       
00031       
00032       //@}-----------------------------------------------------------------
00033       ///@name Initialization
00034       //@{-----------------------------------------------------------------
00035       
00036       virtual void init();
00037       
00038       
00039       //@}-----------------------------------------------------------------
00040       ///@name Main usage interface
00041       //@{-----------------------------------------------------------------
00042       
00043       virtual void addSample(const PointSample &sample);
00044       
00045       
00046       //@}-----------------------------------------------------------------
00047       ///@name Accessors / Mutators
00048       //@{-----------------------------------------------------------------
00049       
00050       inline Image *getImage() {
00051          return m_output;
00052       }
00053       
00054       inline void setImage(Image *image) {
00055          ASSERT(image);
00056          if (image == m_output)
00057             return;
00058          
00059          //safeDelete(m_output); // TODO: who 'owns' m_output?
00060          
00061          // TODO: possibly synchronization issue -- ensure it doesn't happen
00062          m_output = image;
00063          m_viewport.setSize(m_output->getWidth(), m_output->getHeight());
00064          
00065          safeDeleteArray(m_progressiveValues);
00066          m_progressiveValues = new ProgressiveFilterValue<SpectralSampleSet>
00067             [m_output->getWidth() * m_output->getHeight()];
00068       }
00069       
00070       inline KernelFilter *getFilter() {
00071          return m_filter;
00072       }
00073       
00074       inline void setFilter(KernelFilter *filter) {
00075          if (m_filter != filter) {
00076             KernelFilter *oldFilter = m_filter;
00077             
00078             // TODO: possibly synchronization issue -- ensure it doesn't happen
00079             m_filter = filter;
00080             safeDelete(oldFilter);
00081          }
00082       }
00083       
00084       //@}-----------------------------------------------------------------
00085       
00086    protected:
00087       Image        *m_output;
00088       KernelFilter *m_filter;
00089       
00090       ProgressiveFilterValue<SpectralSampleSet> *m_progressiveValues;
00091 };
00092 
00093 #endif // RECONSTRUCTION_RENDER_OUTPUT_H_
00094 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6