Nori
|
00001 /* 00002 This file is part of Nori, a simple educational ray tracer 00003 00004 Copyright (c) 2012 by Wenzel Jakob and Steve Marschner. 00005 00006 Nori is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License Version 3 00008 as published by the Free Software Foundation. 00009 00010 Nori is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License 00016 along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #if !defined(__RFILTER_H) 00020 #define __RFILTER_H 00021 00022 #include <nori/object.h> 00023 00024 /// Reconstruction filters will be tabulated at this resolution 00025 #define NORI_FILTER_RESOLUTION 32 00026 00027 NORI_NAMESPACE_BEGIN 00028 00029 /** 00030 * \brief Generic radially symmetric image reconstruction filter 00031 * 00032 * When adding radiance-valued samples to the rendered image, Nori 00033 * first convolves them with a so-called image reconstruction filter. 00034 * 00035 * To learn more about reconstruction filters and sampling theory 00036 * in general, take a look at the excellenent chapter 7 of PBRT, 00037 * which is freely available at: 00038 * 00039 * http://graphics.stanford.edu/~mmp/chapters/pbrt_chapter7.pdf 00040 */ 00041 class ReconstructionFilter : public NoriObject { 00042 public: 00043 /// Return the filter radius in fractional pixels 00044 inline float getRadius() const { return m_radius; } 00045 00046 /// Evaluate the filter function 00047 virtual float eval(float x) const = 0; 00048 00049 /** 00050 * \brief Return the type of object (i.e. Mesh/Camera/etc.) 00051 * provided by this instance 00052 * */ 00053 EClassType getClassType() const { return EReconstructionFilter; } 00054 protected: 00055 float m_radius; 00056 }; 00057 00058 NORI_NAMESPACE_END 00059 00060 #endif /* __RFILTER_H */