readpng.h revision 671242f350d172e106580348e24bab66b0d7e6a5
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync/*---------------------------------------------------------------------------
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync rpng - simple PNG display program readpng.h
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync ---------------------------------------------------------------------------
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync This software is provided "as is," without warranty of any kind,
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync express or implied. In no event shall the author or contributors
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync be held liable for any damages arising in any way from the use of
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync this software.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync Permission is granted to anyone to use this software for any purpose,
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync including commercial applications, and to alter it and redistribute
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync it freely, subject to the following restrictions:
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync 1. Redistributions of source code must retain the above copyright
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync notice, disclaimer, and this list of conditions.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync 2. Redistributions in binary form must reproduce the above copyright
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync notice, disclaimer, and this list of conditions in the documenta-
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync tion and/or other materials provided with the distribution.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync 3. All advertising materials mentioning features or use of this
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync software must display the following acknowledgment:
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync This product includes software developed by Greg Roelofs
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync and contributors for the book, "PNG: The Definitive Guide,"
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync published by O'Reilly and Associates.
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync ---------------------------------------------------------------------------*/
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#ifndef TRUE
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define TRUE 1
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define FALSE 0
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#endif
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#ifndef MAX
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define MAX(a,b) ((a) > (b)? (a) : (b))
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define MIN(a,b) ((a) < (b)? (a) : (b))
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#endif
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#ifdef DEBUG
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);}
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#else
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync# define Trace(x) ;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync#endif
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsynctypedef unsigned char uch;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsynctypedef unsigned short ush;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsynctypedef unsigned long ulg;
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync/* prototypes for public functions in readpng.c */
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsyncvoid readpng_version_info(void);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsyncint readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
e5f6ad85110ebdc7256808a0a3a8ce330370be6avboxsyncint readpng_get_bgcolor(uch *bg_red, uch *bg_green, uch *bg_blue);
e5f6ad85110ebdc7256808a0a3a8ce330370be6avboxsync
e5f6ad85110ebdc7256808a0a3a8ce330370be6avboxsyncuch *readpng_get_image(double display_exponent, int *pChannels,
e5f6ad85110ebdc7256808a0a3a8ce330370be6avboxsync ulg *pRowbytes);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync
d534750e38f9bab40fd4ab06d176fea25ec91c44vboxsyncvoid readpng_cleanup(int free_image_data);
e5bfc5c34142a7550be3564a8e01a037b1db5b31vboxsync