aseprite/third_party/loadpng
David Capello 36ca165328 Update zlib to 1.2.5 and libpng 1.5.7.
Fix loadpng library and png_format.cpp to support the new libpng version.
2012-01-07 21:11:19 -03:00
..
CHANGES.txt Update zlib to 1.2.5 and libpng 1.5.7. 2012-01-07 21:11:19 -03:00
CMakeLists.txt Replace Allegro Sprite Editor or ASE with ASEPRITE in all files. 2012-01-06 01:12:57 -03:00
loadpng.c Update zlib to 1.2.5 and libpng 1.5.7. 2012-01-07 21:11:19 -03:00
loadpng.h Convert all newline to LF style and remove all tabs. 2012-01-05 19:45:03 -03:00
README.txt Convert all newline to LF style and remove all tabs. 2012-01-05 19:45:03 -03:00
regpng.c Convert all newline to LF style and remove all tabs. 2012-01-05 19:45:03 -03:00
savepng.c Update zlib to 1.2.5 and libpng 1.5.7. 2012-01-07 21:11:19 -03:00
THANKS.txt Added support to load png files through Allegro library (now you can save/load palettes in PNG files) 2009-11-19 00:34:07 +00:00

        loadpng: glue for Allegro and libpng


This wrapper is mostly a copy and paste job from example.c in the
libpng docs, stripping out the useless transformations and making it
use Allegro BITMAP and PALETTE structures.  It is placed in the public
domain.


Requirements:

        Allegro         http://alleg.sourceforge.net/
        libpng          http://www.libpng.org/pub/png/
        zlib            http://www.gzip.org/zlib/


Usage:

See loadpng.h for functions and their descriptions.  There is a
simple example program called example.c, a program demonstrating
alpha translucency in exalpha.c, and a program demonstrating how to
load a PNG object from a datafile in exdata.c.

To compile, just run "make" (or perhaps "mingw32-make").  To use
loadpng, you need to link with libpng, zlib in addition to loadpng
itself, e.g.

        gcc mygame.c -lldpng -lpng -lz -lalleg

I recommend you copy loadpng's files into your own project's directory
and compile loadpng as part of your project.


Notes:

- Grayscale images will be loaded in as 24 bit images, or 32 bit
  images if they contain an alpha channel.  These will then be
  converted as usual, according to Allegro's conversion semantics.  Be
  aware of this if you have disabled automatic colour depth
  conversion.

- save_png() doesn't save any gamma chunk.  I'm thinking of making it
  write an sRGB chunk by default.  If you want tight control of how
  your images are saved, I recommend hacking save_png() to suit your
  needs.  There's simply too many options.


Enjoy!

Peter Wang (tjaden@users.sf.net)
http://members.ozadsl.com.au/~tjaden/
http://tjaden.strangesoft.net/