95 Image(
int width,
int height,
bool smooth_it = false);
142 explicit
Image(const std::filesystem::path& file_path,
bool smooth_it = false);
242 int GetHeight() const noexcept;
247 int GetNumberOfColors() const noexcept;
252 bool IsSmooth() const noexcept;
259 using byte =
unsigned char;
260 byte red = 0, green = 0, blue = 0, alpha = 255;
470 color operator()(
int column,
int row) const;
540 color& operator()(
int column,
int row);
796 std::unique_ptr<ImageImpl> impl;
800 friend
void draw_image(const
Image& image,
double x,
double y,
double width,
double height) noexcept;
801 friend
void draw_image(const
Image& image,
double x,
double y,
double width,
double height) noexcept;
802 friend
void draw_image(const
Image& image,
double x,
double y,
double width,
double height,
int texel_x,
803 int texel_y) noexcept;
804 friend
void draw_image(const
Image& image,
double x,
double y,
double width,
double height,
int texel_x,
805 int texel_y,
int texel_width,
int texel_height) noexcept;
Image class to store a 2D array of RGBA colors. Also manages an image on the Graphics Card.
void SaveToFile(const std::filesystem::path &file_path, FileType file_type=FileType::PNG) const
Save the Image as an image file on disk.
FileType
Lists all of the supported image file formats.
int GetWidth() const noexcept
Return the width of the image.
static int MaxImageSize() noexcept
Get the maximum image size allowed.
void draw_image(const Image &image, double x, double y) noexcept
Draw an entire image to the screen.
Color is a color represented with four unsigned bytes.
struct to represent the colors of the Image.
color()=default
Defaults to black.
color(const doodle::Color &c) noexcept
Can be constructed from a Color object.