21 std::vector<unsigned char>
data;
44 void set_pixel(
int x,
int y,
int r,
unsigned char g,
unsigned char b,
unsigned char a);
void paste_image(Image *dst, int dst_x, int dst_y, const Image &src)
Copies pixel data from a source image to a destination image at specified coordinates.
A (inclusive) range between two values.
void set_pixel(int x, int y, int r, unsigned char g, unsigned char b, unsigned char a)
Sets the color of a pixel at the specified coordinates in an image buffer.
PixelColor get_pixel(int x, int y) const
Gets the color of a pixel at the specified coordinates.
std::vector< unsigned char > data
The data is stored in row-major order, with 4 bytes per pixel RGB(A)
void setup_with_alpha_support(int w, int h)
Initializes the image with the specified dimensions and alpha support.
bool is_valid() const
Returns true if the image has valid dimensions and data.
void set_pixel(int x, int y, const PixelColor &color)
Overload: Sets the color of a pixel using a PixelColor struct.
Image()
Default constructor initializes an empty (invalid) image.
void make_invalid()
Marks the image as invalid by resetting its dimensions and clearing its data.
A simple integer sRGBA color.