#ifndef __HALTON_SAMPLER_H__
#define __HALTON_SAMPLER_H__

#include "AbstractSampler.h"
#include <chrono>
#include <random>
using namespace std;

//int sizes[] = {64, 128, 256, 576};
#define uint unsigned int
	
namespace VRUT
{
	class HaltonSampler : public AbstractSampler
	{
	protected:
		HaltonSampler(void);
		virtual void GenerateSamples(const std::vector<unsigned int> & samplesCounts, bool subSampling, bool sort);

	public:
		HaltonSampler(const std::vector<unsigned int> & samplesCounts, const std::vector<unsigned int> & subSamplesCounts, bool sort = true);
		virtual ~HaltonSampler(void);
		virtual bool SamplePixels(Vector2 pixels[], Tile & tile);
        bool GenPixMapIsNecessary(std::map<uint64_t, unsigned int>& m, const Tile* tile, int numPixels) override;
	};

	class InfiniteHaltonSampler : public HaltonSampler {
	protected:
		//int lastk,k;
	public:
		InfiniteHaltonSampler(const std::vector<unsigned int> & samplesCounts);

		virtual bool SamplePixels(Vector2 pixels[], Tile & tile);
		virtual unsigned int SamplesLODs(void) { return 1024 * 1024; }
		virtual unsigned int SubSamplesLODs(void) { return 1024 * 1024; }
		virtual unsigned int LODForSamples(int samplesPerPixel) { return 1024*1024; }
	};
}

#endif /* __HALTON_SAMPLER_H__ */
