Implement sf::Image::saveToMemory

https://github.com/SFML/SFML/pull/1669

Co-authored-by: Chris Thrasher <chrisjthrasher@gmail.com>
This commit is contained in:
kimci86andChris Thrasher authored and Lukas Dürrenberger committed 2023-09-09 23:36:24 +02:00
1 parent 39dd578d45
commit 725811baa9
2 files changed
+32

No files matched your search

+22
View File
@@ -32,6 +32,7 @@
#include <SFML/Graphics/Color.h>
#include <SFML/Graphics/Rect.h>
#include <SFML/Graphics/Types.h>
#include <SFML/System/Buffer.h>
#include <SFML/System/InputStream.h>
#include <SFML/System/Vector2.h>
#include <stddef.h>
@@ -156,9 +157,30 @@ CSFML_GRAPHICS_API void sfImage_destroy(sfImage* image);
///
/// \return sfTrue if saving was successful
///
/// \see sfImage_saveToMemory
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfImage_saveToFile(const sfImage* image, const char* filename);
////////////////////////////////////////////////////////////
/// \brief Save the image to a buffer in memory
///
/// The format of the image must be specified.
/// The supported image formats are bmp, png, tga and jpg.
/// This function fails if the image is empty, or if
/// the format was invalid.
///
/// \param image Image object
/// \param output Buffer to fill with encoded data
/// \param format Encoding format to use
///
/// \return sfTrue if saving was successful
///
/// \see sfImage_saveToFile
///
////////////////////////////////////////////////////////////
CSFML_GRAPHICS_API sfBool sfImage_saveToMemory(const sfImage* image, sfBuffer* output, const char* format);
////////////////////////////////////////////////////////////
/// \brief Return the size of an image
///