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_STRATIFIED_H
00029 #define PBRT_SAMPLERS_STRATIFIED_H
00030
00031
00032 #include "sampler.h"
00033 #include "film.h"
00034
00035
00036 class StratifiedSampler : public Sampler {
00037 public:
00038
00039 StratifiedSampler(int xstart, int xend, int ystart, int yend,
00040 int xs, int ys, bool jitter, float sopen, float sclose);
00041 ~StratifiedSampler();
00042 int RoundSize(int size) const { return size; }
00043 Sampler *GetSubSampler(int num, int count);
00044 int GetMoreSamples(Sample *sample, RNG &rng);
00045 int MaximumSampleCount() { return xPixelSamples * yPixelSamples; }
00046 private:
00047
00048 int xPixelSamples, yPixelSamples;
00049 bool jitterSamples;
00050 int xPos, yPos;
00051 float *sampleBuf;
00052 };
00053
00054
00055 StratifiedSampler *CreateStratifiedSampler(const ParamSet ¶ms, const Film *film,
00056 const Camera *camera);
00057
00058 #endif // PBRT_SAMPLERS_STRATIFIED_H