From 5e2461124187550bb847e29361cdb1c358006f5e Mon Sep 17 00:00:00 2001 From: Ibrahn Sahir Date: Sun, 16 Jun 2019 20:08:52 +0100 Subject: 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. --- drivers/png/image_loader_png.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/png/image_loader_png.h') 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 - /** @author Juan Linietsky */ class ImageLoaderPNG : public ImageFormatLoader { - - static void _read_png_data(png_structp png_ptr, png_bytep data, png_size_t p_length); +private: + static PoolVector lossless_pack_png(const Ref &p_image); + static Ref lossless_unpack_png(const PoolVector &p_data); + static Ref 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 p_image); virtual Error load_image(Ref p_image, FileAccess *f, bool p_force_linear, float p_scale); virtual void get_recognized_extensions(List *p_extensions) const; ImageLoaderPNG(); -- cgit v1.2.3