00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(_MSC_VER)
00025 #pragma once
00026 #endif
00027
00028 #ifndef PBRT_FILTERS_MITCHELL_H
00029 #define PBRT_FILTERS_MITCHELL_H
00030
00031
00032 #include "filter.h"
00033
00034
00035 class MitchellFilter : public Filter {
00036 public:
00037
00038 MitchellFilter(float b, float c, float xw, float yw)
00039 : Filter(xw, yw), B(b), C(c) {
00040 }
00041 float Evaluate(float x, float y) const;
00042 float Mitchell1D(float x) const {
00043 x = fabsf(2.f * x);
00044 if (x > 1.f)
00045 return ((-B - 6*C) * x*x*x + (6*B + 30*C) * x*x +
00046 (-12*B - 48*C) * x + (8*B + 24*C)) * (1.f/6.f);
00047 else
00048 return ((12 - 9*B - 6*C) * x*x*x +
00049 (-18 + 12*B + 6*C) * x*x +
00050 (6 - 2*B)) * (1.f/6.f);
00051 }
00052 private:
00053 const float B, C;
00054 };
00055
00056
00057 MitchellFilter *CreateMitchellFilter(const ParamSet &ps);
00058
00059 #endif // PBRT_FILTERS_MITCHELL_H