| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef IMAGE_AF9FV02C
- #define IMAGE_AF9FV02C
-
- #include <vector>
- #include <string>
-
- namespace haader {
-
- // A low dynamic range image/photograph with an associated exposure time.
- class Image {
- friend class HdrImageStack;
- friend class HdrImage;
-
- public:
- Image();
-
- void to_string(std::string &s) const;
-
- bool read_from_file(const char *file_path);
- bool save_as_ppm_file(const char *file_path, bool ascii=false) const;
-
- unsigned int get_width() const;
- unsigned int get_height() const;
- unsigned int get_components() const;
- bool has_equal_dimensions(const Image &other) const;
- double get_exposure_time() const;
- const unsigned char* get_const_image_data() const;
- unsigned char* get_image_data();
-
- private:
- std::vector<unsigned char> m_image_data;
- unsigned int m_width;
- unsigned int m_height;
-
- // Number of channels (usually 3 for RGB images)
- unsigned int m_components;
-
- // Exposure time in seconds
- double m_exposure_time;
- };
-
- }
-
- #endif // IMAGE_AF9FV02C
|