summaryrefslogtreecommitdiffstats
path: root/drivers/png/image_loader_png.h
diff options
context:
space:
mode:
authorIbrahn Sahir <ibrahn.sahir@gmail.com>2019-06-16 20:08:52 +0100
committerIbrahn Sahir <ibrahn.sahir@gmail.com>2019-06-19 11:05:58 +0100
commit5e2461124187550bb847e29361cdb1c358006f5e (patch)
treed874182dfdc45912c5d8bd90c5fb8b68d1f6a951 /drivers/png/image_loader_png.h
parent22afebcad71db07063fa11fd4489b29741f28009 (diff)
downloadredot-engine-5e2461124187550bb847e29361cdb1c358006f5e.tar.gz
Png driver reworked to use libpng 1.6 simplified API
Wrapped libpng usage in a pair of functions under PNGDriverCommon, which convert between Godot Image and png data. Switched to libpng 1.6 simplified API for ease of maintenance. Implemented ImageLoaderPNG and ResourceSaverPNG in terms of PNGDriverCommon functions. Travis, switched to builtin libpng (thus builtin freetype and zlib also) so we can build on Xenial.
Diffstat (limited to 'drivers/png/image_loader_png.h')
-rw-r--r--drivers/png/image_loader_png.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h
index c3951979c3..cc789f95d6 100644
--- a/drivers/png/image_loader_png.h
+++ b/drivers/png/image_loader_png.h
@@ -33,17 +33,16 @@
#include "core/io/image_loader.h"
-#include <png.h>
-
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
class ImageLoaderPNG : public ImageFormatLoader {
-
- static void _read_png_data(png_structp png_ptr, png_bytep data, png_size_t p_length);
+private:
+ static PoolVector<uint8_t> lossless_pack_png(const Ref<Image> &p_image);
+ static Ref<Image> lossless_unpack_png(const PoolVector<uint8_t> &p_data);
+ static Ref<Image> load_mem_png(const uint8_t *p_png, int p_size);
public:
- static Error _load_image(void *rf_up, png_rw_ptr p_func, Ref<Image> p_image);
virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
ImageLoaderPNG();