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_SAMPLERS_RANDOM_H
00029 #define PBRT_SAMPLERS_RANDOM_H
00030
00031
00032 #include "sampler.h"
00033 #include "paramset.h"
00034 #include "film.h"
00035 class RandomSampler : public Sampler {
00036 public:
00037 RandomSampler(int xstart, int xend, int ystart,
00038 int yend, int ns, float sopen, float sclose);
00039 ~RandomSampler() {
00040 FreeAligned(imageSamples);
00041 }
00042 int MaximumSampleCount() { return 1; }
00043 int GetMoreSamples(Sample *sample, RNG &rng);
00044 int RoundSize(int sz) const { return sz; }
00045 Sampler *GetSubSampler(int num, int count);
00046 private:
00047
00048 bool jitterSamples;
00049 int xPos, yPos, nSamples;
00050 float *imageSamples, *lensSamples, *timeSamples;
00051 int samplePos;
00052 };
00053
00054
00055 Sampler *CreateRandomSampler(const ParamSet ¶ms, const Film *film,
00056 const Camera *camera);
00057
00058 #endif // PBRT_SAMPLERS_RANDOM_H