00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "sampling.h"
00025 #include "paramset.h"
00026 #include "film.h"
00027
00028 namespace lux
00029 {
00030
00031 class RandomSampler : public Sampler
00032 {
00033 public:
00034 RandomSampler(int xstart, int xend, int ystart, int yend,
00035 int ps, string pixelsampler);
00036 virtual ~RandomSampler();
00037
00038 virtual u_int GetTotalSamplePos();
00039 virtual bool GetNextSample(Sample *sample, u_int *use_pos);
00040 virtual float *GetLazyValues(Sample *sample, u_int num, u_int pos);
00041 virtual int RoundSize(int sz) const
00042 {
00043 return sz;
00044 }
00045 virtual void GetBufferType(BufferType *type) {*type = BUF_TYPE_PER_PIXEL;}
00046 virtual RandomSampler* clone() const;
00047
00048 static Sampler *CreateSampler(const ParamSet ¶ms, const Film *film);
00049 private:
00050
00051 bool jitterSamples;
00052 int xPos, yPos, pixelSamples;
00053 float *imageSamples, *lensSamples, *timeSamples, *wavelengthsSamples,
00054 *singleWavelengthSamples;
00055 int samplePos;
00056 u_int TotalPixels;
00057 PixelSampler* pixelSampler;
00058 bool init;
00059 };
00060
00061 }