FreeWRL / FreeX3D 4.3.0
readpng.h
1/*
2
3
4Read PNG images.
5
6*/
7
8/****************************************************************************
9 This file is part of the FreeWRL/FreeX3D Distribution.
10
11 Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12
13 FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14 it under the terms of the GNU Lesser Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25****************************************************************************/
26
27
28#ifndef __FREEWRL_READ_PNG_H__
29#define __FREEWRL_READ_PNG_H__
30
31/*---------------------------------------------------------------------------
32
33 rpng - simple PNG display program readpng.h
34
35 ---------------------------------------------------------------------------
36
37 Copyright (c) 1998-2000 Greg Roelofs. All rights reserved.
38
39 This software is provided "as is," without warranty of any kind,
40 express or implied. In no event shall the author or contributors
41 be held liable for any damages arising in any way from the use of
42 this software.
43
44 Permission is granted to anyone to use this software for any purpose,
45 including commercial applications, and to alter it and redistribute
46 it freely, subject to the following restrictions:
47
48 1. Redistributions of source code must retain the above copyright
49 notice, disclaimer, and this list of conditions.
50 2. Redistributions in binary form must reproduce the above copyright
51 notice, disclaimer, and this list of conditions in the documenta-
52 tion and/or other materials provided with the distribution.
53 3. All advertising materials mentioning features or use of this
54 software must display the following acknowledgment:
55
56 This product includes software developed by Greg Roelofs
57 and contributors for the book, "PNG: The Definitive Guide,"
58 published by O'Reilly and Associates.
59
60 ---------------------------------------------------------------------------*/
61
62#ifndef TRUE
63# define TRUE 1
64# define FALSE 0
65#endif
66
67#ifndef MAX
68# define MAX(a,b) ((a) > (b)? (a) : (b))
69# define MIN(a,b) ((a) < (b)? (a) : (b))
70#endif
71
72#if defined(FW_PNG_DEBUG)
73# define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);}
74#else
75# define Trace(x) ;
76#endif
77
78typedef unsigned char uch;
79typedef unsigned short ush;
80typedef unsigned long ulg;
81
82
83/* prototypes for public functions in readpng.c */
84
85void readpng_version_info(void);
86
87int readpng_init(FILE *infile, ulg *pWidth, ulg *pHeight);
88
89int readpng_get_bgcolor(uch *bg_red, uch *bg_green, uch *bg_blue);
90
91uch *readpng_get_image(double display_exponent, int *pChannels,
92 ulg *pRowbytes);
93
94void readpng_cleanup(int free_image_data);
95
96
97#endif /* __FREEWRL_READ_PNG_H__ */