include/sampler.h
branchpyrit
changeset 78 9569e9f35374
parent 53 228cb8bfdd54
child 82 930a2d3ecaed
equal deleted inserted replaced
77:dbe8438d5dca 78:9569e9f35374
    73  * Implements basic adaptive subsampling and oversampling.
    73  * Implements basic adaptive subsampling and oversampling.
    74  */
    74  */
    75 class DefaultSampler: public Sampler
    75 class DefaultSampler: public Sampler
    76 {
    76 {
    77 	int phase;
    77 	int phase;
    78 	int subsample;
    78 	int subsample;  // 0,1 = no, 1+ = size of sampling grid
    79 	int oversample; // 0 = no, 1 = 5x, 2 = 9x, 3 = 16x
    79 	int oversample; // 0 = no, 1 = 5x, 2 = 9x, 3 = 16x
    80 	int sx,sy,osa_samp; // current sample properties
    80 	int sx,sy,osa_samp; // current sample properties
    81 public:
    81 public:
    82 	DefaultSampler(Float *abuffer, int &aw, int &ah):
    82 	DefaultSampler(Float *abuffer, int &aw, int &ah):
    83 		Sampler(abuffer, aw, ah), phase(-1), subsample(8), oversample(0) {};
    83 		Sampler(abuffer, aw, ah), phase(-1), subsample(4), oversample(0) {};
    84 	void init();
    84 	void init();
    85 	int initSampleSet();
    85 	int initSampleSet();
    86 	bool nextSample(Sample *s);
    86 	bool nextSample(Sample *s);
    87 	void saveSample(Sample &samp, Colour &col);
    87 	void saveSample(Sample &samp, Colour &col);
    88 
    88