A tool to construct HDR-images from a series of exposures.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef IMAGE_AF9FV02C
  2. #define IMAGE_AF9FV02C
  3. #include <vector>
  4. #include <string>
  5. namespace haader {
  6. class LdrHistogram {
  7. public:
  8. std::vector<unsigned int> m_bins;
  9. unsigned int m_max_freq;
  10. };
  11. // A low dynamic range image/photograph with an associated exposure time.
  12. class Image {
  13. friend class HdrImageStack;
  14. friend class HdrImage;
  15. public:
  16. Image();
  17. void to_string(std::string &s) const;
  18. bool read_from_file(const char *file_path);
  19. bool save_as_ppm_file(const char *file_path, bool ascii=false) const;
  20. LdrHistogram histogram() const;
  21. unsigned int get_width() const;
  22. unsigned int get_height() const;
  23. unsigned int get_components() const;
  24. bool has_equal_dimensions(const Image &other) const;
  25. double get_exposure_time() const;
  26. const unsigned char* get_const_image_data() const;
  27. unsigned char* get_image_data();
  28. private:
  29. std::vector<unsigned char> m_image_data;
  30. unsigned int m_width;
  31. unsigned int m_height;
  32. // Number of channels (usually 3 for RGB images)
  33. unsigned int m_components;
  34. // Exposure time in seconds
  35. double m_exposure_time;
  36. };
  37. }
  38. #endif // IMAGE_AF9FV02C