#ifndef ARE_INCLUDE_TEXTURE_H #define ARE_INCLUDE_TEXTURE_H #include #include #include namespace are { class Texture { public: // Constructors Texture() = default; // Allow default constructor. Texture(const std::string &image_path); // Initialize the image by loading from file (currently support .ppm format). Texture(int width, int height, const Color3 &fill_color); // Initialize the image by filling with a color. // Destructor ~Texture(); Color3 &pixel(int x, int y); // Paste src_texture into this image with given four corners. void paste(const Texture &src_texture, const std::pair &left_top, const std::pair &right_top, const std::pair &left_bottom, const std::pair &right_bottom); // Save the texture to a file (currently support .ppm format) bool save_texture(const std::string &file_path) const; int width_, height_; // The image width and height. private: Color3 **image_ = nullptr; // The raw pixel data. }; } #endif