Loading...
Searching...
No Matches
Image.hpp
Go to the documentation of this file.
7// In no event will the authors be held liable for any damages arising from the use of this software.
245 [[nodiscard]] std::optional<std::vector<std::uint8_t>> saveToMemory(std::string_view format) const;
bool loadFromStream(InputStream &stream)
Load the image from a custom stream.
Image(const std::filesystem::path &filename)
Construct the image from a file on disk.
bool saveToFile(const std::filesystem::path &filename) const
Save the image to a file on disk.
Image(Vector2u size, const std::uint8_t *pixels)
Construct the image from an array of pixels.
bool copy(const Image &source, Vector2u dest, const IntRect &sourceRect={}, bool applyAlpha=false)
Copy pixels from another image onto this one.
std::optional< std::vector< std::uint8_t > > saveToMemory(std::string_view format) const
Save the image to a buffer in memory.
void createMaskFromColor(Color color, std::uint8_t alpha=0)
Create a transparency mask from a specified color-key.
const std::uint8_t * getPixelsPtr() const
Get a read-only pointer to the array of pixels.
void resize(Vector2u size, const std::uint8_t *pixels)
Resize the image from an array of pixels.
bool loadFromMemory(const void *data, std::size_t size)
Load the image from a file in memory.
Image(Vector2u size, Color color=Color::Black)
Construct the image and fill it with a unique color.
bool loadFromFile(const std::filesystem::path &filename)
Load the image from a file on disk.
void resize(Vector2u size, Color color=Color::Black)
Resize the image and fill it with a unique color.
Definition AudioResource.hpp:36