Guest User

Untitled

a guest
May 10th, 2011
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1.  
  2. #ifndef __SAMPLER__
  3. #define __SAMPLER__
  4.  
  5. #include <vector>
  6. #include "Point2D.h"
  7. #include "Point3D.h"
  8.  
  9. class Sampler {
  10. protected:
  11. int num_samples;
  12. int num_sets;
  13. std::vector<Point2D> samples;
  14. std::vector<int> shuffled_indices;
  15. std::vector<Point2D> disk_samples;
  16. std::vector<Point3D> hemisphere_samples;
  17. unsigned long count;
  18. int jump;
  19.  
  20. public:
  21. Sampler(void);
  22. Sampler(int ns);
  23. Sampler(const Sampler& s);
  24. virtual ~Sampler(void);
  25.  
  26. virtual void generate_samples(void) = 0;
  27. void setup_shuffled_indices(void);
  28. void shuffle_samples(void);
  29. Point2D sample_unit_square(void);
  30. int get_num_samples(void);
  31. void map_samples_to_unit_disk(void);
  32. void map_samples_to_hemisphere(const float e);
  33. };
  34.  
  35. #endif
  36.  
  37.  
  38.  
  39.  
  40. #ifndef __JITTERED__
  41. #define __JITTERED__
  42.  
  43. #include "Sampler.h"
  44.  
  45. class Jittered : public Sampler {
  46. public:
  47. Jittered(void);
  48. Jittered(int ns);
  49. virtual ~Jittered(void);
  50.  
  51. virtual void generate_samples(void);
  52. };
  53.  
  54. #endif
Advertisement
Add Comment
Please, Sign In to add comment