00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef LUX_METROSAMPLER_H
00026 #define LUX_METROSAMPLER_H
00027
00028 #include "sampling.h"
00029 #include "paramset.h"
00030 #include "film.h"
00031
00032 namespace lux
00033 {
00034
00035 class MetropolisSampler : public Sampler {
00036 public:
00037 MetropolisSampler(int xStart, int xEnd, int yStart, int yEnd,
00038 int maxRej, float largeProb, float rng, int sw, bool useV);
00039 ~MetropolisSampler();
00040
00041 virtual MetropolisSampler* clone() const;
00042 u_int GetTotalSamplePos() { return 0; }
00043 int RoundSize(int size) const { return size; }
00044 bool GetNextSample(Sample *sample, u_int *use_pos);
00045 float *GetLazyValues(Sample *sample, u_int num, u_int pos);
00046 void AddSample(float imageX, float imageY, const Sample &sample, const Ray &ray, const XYZColor &L, float alpha, int id=0);
00047 void AddSample(const Sample &sample);
00048 static Sampler *CreateSampler(const ParamSet ¶ms, const Film *film);
00049 void GetBufferType(BufferType *t) { *t = BUF_TYPE_PER_SCREEN; }
00050
00051 bool large;
00052 float LY, V;
00053 int normalSamples, totalSamples, totalTimes, maxRejects, consecRejects, stamp;
00054 float pLarge, range, weight, alpha;
00055 float *sampleImage;
00056 int *timeImage, *offset;
00057 static int initCount, initSamples;
00058 static float meanIntensity;
00059 vector <Sample::Contribution> oldContributions;
00060 float *strataSamples;
00061 int strataWidth, strataSqr, currentStrata;
00062 bool useVariance;
00063 };
00064
00065 }
00066
00067 #endif // LUX_METROSAMPLER_H
00068