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

image.h 1.1KB

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