Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
readpng2.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------
2 
3  rpng2 - progressive-model PNG display program readpng2.h
4 
5  ---------------------------------------------------------------------------
6 
7  Copyright (c) 1998-2008 Greg Roelofs. All rights reserved.
8 
9  This software is provided "as is," without warranty of any kind,
10  express or implied. In no event shall the author or contributors
11  be held liable for any damages arising in any way from the use of
12  this software.
13 
14  The contents of this file are DUAL-LICENSED. You may modify and/or
15  redistribute this software according to the terms of one of the
16  following two licenses (at your option):
17 
18 
19  LICENSE 1 ("BSD-like with advertising clause"):
20 
21  Permission is granted to anyone to use this software for any purpose,
22  including commercial applications, and to alter it and redistribute
23  it freely, subject to the following restrictions:
24 
25  1. Redistributions of source code must retain the above copyright
26  notice, disclaimer, and this list of conditions.
27  2. Redistributions in binary form must reproduce the above copyright
28  notice, disclaimer, and this list of conditions in the documenta-
29  tion and/or other materials provided with the distribution.
30  3. All advertising materials mentioning features or use of this
31  software must display the following acknowledgment:
32 
33  This product includes software developed by Greg Roelofs
34  and contributors for the book, "PNG: The Definitive Guide,"
35  published by O'Reilly and Associates.
36 
37 
38  LICENSE 2 (GNU GPL v2 or later):
39 
40  This program is free software; you can redistribute it and/or modify
41  it under the terms of the GNU General Public License as published by
42  the Free Software Foundation; either version 2 of the License, or
43  (at your option) any later version.
44 
45  This program is distributed in the hope that it will be useful,
46  but WITHOUT ANY WARRANTY; without even the implied warranty of
47  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48  GNU General Public License for more details.
49 
50  You should have received a copy of the GNU General Public License
51  along with this program; if not, write to the Free Software Foundation,
52  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
53 
54  ---------------------------------------------------------------------------*/
55 
56 #ifndef TRUE
57 # define TRUE 1
58 # define FALSE 0
59 #endif
60 
61 #ifndef MAX
62 # define MAX(a,b) ((a) > (b)? (a) : (b))
63 # define MIN(a,b) ((a) < (b)? (a) : (b))
64 #endif
65 
66 #ifdef DEBUG
67 # define Trace(x) {fprintf x ; fflush(stderr); fflush(stdout);}
68 #else
69 # define Trace(x) ;
70 #endif
71 
73  kPreInit = 0,
76 };
77 
78 typedef unsigned char uch;
79 typedef unsigned short ush;
80 typedef unsigned long ulg;
81 
82 typedef struct _mainprog_info {
86  void *png_ptr;
87  void *info_ptr;
93  jmp_buf jmpbuf;
94  int passes; /* not used */
95  int pass;
96  int rowbytes;
97  int channels;
99 #if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
100  int nommxfilters;
101  int nommxcombine;
102  int nommxinterlace;
103 #endif
104  int state;
108 } mainprog_info;
109 
110 
111 /* prototypes for public functions in readpng2.c */
112 
113 void readpng2_version_info(void);
114 
115 int readpng2_check_sig(uch *sig, int num);
116 
117 int readpng2_init(mainprog_info *mainprog_ptr);
118 
119 int readpng2_decode_data(mainprog_info *mainprog_ptr, uch *rawbuf, ulg length);
120 
121 void readpng2_cleanup(mainprog_info *mainprog_ptr);
GLenum GLuint GLenum GLsizei length
int readpng2_init(mainprog_info *mainprog_ptr)
Definition: readpng2.c:170
void readpng2_version_info(void)
Definition: readpng2.c:74
rpng2_states
Definition: readpng2.h:72
void(* mainprog_init)(void)
Definition: readpng2.h:88
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
unsigned short ush
Definition: readpng2.h:79
unsigned long ulg
Definition: zutil.h:38
void readpng2_cleanup(mainprog_info *mainprog_ptr)
Definition: readpng2.c:607
unsigned char uch
Definition: readpng2.h:78
void(* mainprog_finish_display)(void)
Definition: readpng2.h:90
void * png_ptr
Definition: readpng2.h:86
struct _mainprog_info mainprog_info
int readpng2_check_sig(uch *sig, int num)
Definition: readpng2.c:160
uch * image_data
Definition: readpng2.h:91
GLuint GLuint num
double display_exponent
Definition: readpng2.h:83
Definition: readpng2.h:75
void(* mainprog_display_row)(ulg row_num)
Definition: readpng2.h:89
int need_bgcolor
Definition: readpng2.h:98
void * info_ptr
Definition: readpng2.h:87
uch ** row_pointers
Definition: readpng2.h:92
jmp_buf jmpbuf
Definition: readpng2.h:93
int readpng2_decode_data(mainprog_info *mainprog_ptr, uch *rawbuf, ulg length)
Definition: readpng2.c:351
unsigned char uch
Definition: zutil.h:34
unsigned long ulg
Definition: readpng2.h:80