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

image.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. const unsigned char* get_const_image_data() const;
  21. unsigned char* get_image_data();
  22. private:
  23. std::vector<unsigned char> m_image_data;
  24. unsigned int m_width;
  25. unsigned int m_height;
  26. // Number of channels (usually 3 for RGB images)
  27. unsigned int m_components;
  28. // Exposure time in seconds
  29. double m_exposure_time;
  30. };
  31. }
  32. #endif // IMAGE_AF9FV02C