16 int m_width = 0, m_height = 0;
17 std::vector<Color> m_pixels;
41 return m_pixels[y * m_width + x];
47 m_pixels[y * m_width + x] = c;
61 int src_x,
int src_y,
int src_width,
int src_height);
78 FRIEND_TEST(BitmapTests, MemoryManagement);
91 const std::string_view& format_hint =
"png");
99 int src_x,
int src_y,
int src_width,
int src_height);
Bitmap load_image_file(const std::string &filename)
Loads any supported image into a Bitmap.
const Color * data() const
Direct access to the array of color values.
Represents an RGBA color value with 8 bits for each channel.
void set_pixel(int x, int y, Color c)
Sets the pixel at the specified position without any bounds checking.
void insert(int x, int y, const Bitmap &source)
Inserts a bitmap at the given position.
Color * data()
Direct access to the array of color values.
void blend_pixel(int x, int y, Color c)
This updates a pixel using the "over" alpha compositing operator, see: https://en.wikipedia.org/wiki/Alpha_compositing.
Bitmap apply_border_flags(unsigned image_flags, const Bitmap &source, int src_x, int src_y, int src_width, int src_height)
Utility class that points to a specific position in a resource and offers an interface for sequential...
A two-dimensional array area of pixels, each represented by a Color value.
void resize(int width, int height, Color c=Color::NONE)
void save_image_file(const Bitmap &bitmap, const std::string &filename)
Saves a Bitmap to a file.
void apply_color_key(Bitmap &bitmap, Color key)
Set the alpha value of all pixels which are equal to the color key to zero.
Utility class that points to a specific position in a resource and offers an interface for sequential...
Interface of the Color class.
Color get_pixel(int x, int y) const
Returns the color at the specified position without any bounds checking.
Contains everything related to input and output.