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

image.h 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 save_as_ppm_file(const char *file_path, bool ascii=false) const;
  15. unsigned int get_width() const;
  16. unsigned int get_height() const;
  17. unsigned int get_components() const;
  18. bool has_equal_dimensions(const Image &other) const;
  19. double get_exposure_time() const;
  20. private:
  21. std::vector<unsigned char> m_image_data;
  22. unsigned int m_width;
  23. unsigned int m_height;
  24. // Number of channels (usually 3 for RGB images)
  25. unsigned int m_components;
  26. // Exposure time in seconds
  27. double m_exposure_time;
  28. };
  29. }
  30. #endif // IMAGE_AF9FV02C