36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
127 void create(Vector2u size,
const Color4u& color = Color4u
{0x00
, 0x00
, 0x00
, 0xFF
});
139 void create(Vector2u size,
const uint8_t* pixels);
151 void createRGB(Vector2u size,
const uint8_t* pixels);
249 void setPixel(Vector2u pos,
const Color4u& color);
264 Color4u
getPixel(Vector2u pos)
const;
289 std::vector<uint8_t> m_pixels;
293 #ifndef DOXYGEN_SHOULD_SKIP_THIS
Image & operator=(Image &&)=default
Default move assignment.
Image()
Default constructor.
void create(Vector2u size, const uint8_t *pixels)
Create the image from an array of pixels.
bool loadFromStream(InputStream &stream)
Load the image from a custom stream.
Vector2u getSize() const
Return the size (width and height) of the image.
void flipHorizontally()
Flip the pixels horizontally.
Color4u getPixel(Vector2u pos) const
Get the color of a pixel.
bool saveToFile(const Path &filename) const
Save the image to a file on disk.
constexpr Vector(T x, T y, T z, T w)
Constructor that takes 4 components.
Definition: Vector.h:837
Image & operator=(const Image &)=default
Default copy assignment.
Class for loading, manipulating and saving images.
Definition: Image.h:92
Image(const Image &)=default
Default copy constructor.
void createMaskFromColor(const Color4u &color, uint8_t alpha=0)
Create a transparency mask from a specified color-key.
const uint8_t * getPixelsPtr() const
Get a read-only pointer to the array of pixels.
void createRGB(Vector2u size, const uint8_t *pixels)
Create the image from an array of pixels.
Image(Image &&)=default
Default move constructor.
void create(Vector2u size, const Color4u &color=Color4u{0x00, 0x00, 0x00, 0xFF})
Create the image and fill it with a unique color.
#define GF_API
Definition: Portability.h:35
bool loadFromFile(const Path &filename)
Load the image from a file on disk.
void setPixel(Vector2u pos, const Color4u &color)
Change the color of a pixel.
bool loadFromMemory(const uint8_t *data, std::size_t length)
Load the image from a file in memory.