summaryrefslogtreecommitdiff
path: root/core/image.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/image.cpp')
-rw-r--r--core/image.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp
index ae9fb0adc4..17ee569b6b 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -34,6 +34,7 @@
#include "print_string.h"
#include <stdio.h>
+SavePNGFunc Image::save_png_func = NULL;
void Image::_put_pixel(int p_x,int p_y, const BColor& p_color, unsigned char *p_data) {
@@ -1200,6 +1201,14 @@ Error Image::load(const String& p_path) {
return ImageLoader::load_image(p_path, this);
}
+Error Image::save_png(const String& p_path) {
+
+ if (save_png_func == NULL)
+ return ERR_UNAVAILABLE;
+
+ return save_png_func(p_path, *this);
+};
+
bool Image::operator==(const Image& p_image) const {
if (data.size() == 0 && p_image.data.size() == 0)