A simple sRGB(A) image.
More...
A simple sRGB(A) image.
Definition at line 17 of file image.h.
◆ Image()
| eu::core::Image::Image |
( |
| ) |
|
Default constructor initializes an empty (invalid) image.
◆ get_pixel()
Gets the color of a pixel at the specified coordinates.
- Parameters
-
| x | The x-coordinate of the pixel. |
| y | The y-coordinate of the pixel. |
- Returns
- The color at the pixel as a PixelColor struct. If out of bounds, returns {0,0,0,0}.
◆ is_valid()
| bool eu::core::Image::is_valid |
( |
| ) |
const |
Returns true if the image has valid dimensions and data.
◆ make_invalid()
| void eu::core::Image::make_invalid |
( |
| ) |
|
Marks the image as invalid by resetting its dimensions and clearing its data.
◆ set_pixel() [1/2]
Overload: Sets the color of a pixel using a PixelColor struct.
◆ set_pixel() [2/2]
Sets the color of a pixel at the specified coordinates in an image buffer.
- Parameters
-
| x | The x-coordinate of the pixel. |
| y | The y-coordinate of the pixel. |
| r | The red color component (0-255). |
| g | The green color component (0-255). |
| b | The blue color component (0-255). |
| a | The alpha (transparency) component (0-255). |
◆ setup_with_alpha_support()
| void eu::core::Image::setup_with_alpha_support |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
Initializes the image with the specified dimensions and alpha support.
- Parameters
-
| w | The width of the image. |
| h | The height of the image. |
◆ data
The data is stored in row-major order, with 4 bytes per pixel RGB(A)
Definition at line 21 of file image.h.
◆ height
| int eu::core::Image::height = 0 |
◆ width
| int eu::core::Image::width = 0 |
The documentation for this struct was generated from the following file: