OSDN Git Service

[DTXV] #26010 #PAN EL (WAV番号=ELの#PAN)を#PANELと誤認識しないよう修正。
[dtxmania/dtxmania.git] / @libpngソリューション / lpng157 / contrib / gregbook / writepng.h
1 /*---------------------------------------------------------------------------\r
2 \r
3    wpng - simple PNG-writing program                             writepng.h\r
4 \r
5   ---------------------------------------------------------------------------\r
6 \r
7       Copyright (c) 1998-2007 Greg Roelofs.  All rights reserved.\r
8 \r
9       This software is provided "as is," without warranty of any kind,\r
10       express or implied.  In no event shall the author or contributors\r
11       be held liable for any damages arising in any way from the use of\r
12       this software.\r
13 \r
14       The contents of this file are DUAL-LICENSED.  You may modify and/or\r
15       redistribute this software according to the terms of one of the\r
16       following two licenses (at your option):\r
17 \r
18 \r
19       LICENSE 1 ("BSD-like with advertising clause"):\r
20 \r
21       Permission is granted to anyone to use this software for any purpose,\r
22       including commercial applications, and to alter it and redistribute\r
23       it freely, subject to the following restrictions:\r
24 \r
25       1. Redistributions of source code must retain the above copyright\r
26          notice, disclaimer, and this list of conditions.\r
27       2. Redistributions in binary form must reproduce the above copyright\r
28          notice, disclaimer, and this list of conditions in the documenta-\r
29          tion and/or other materials provided with the distribution.\r
30       3. All advertising materials mentioning features or use of this\r
31          software must display the following acknowledgment:\r
32 \r
33             This product includes software developed by Greg Roelofs\r
34             and contributors for the book, "PNG: The Definitive Guide,"\r
35             published by O'Reilly and Associates.\r
36 \r
37 \r
38       LICENSE 2 (GNU GPL v2 or later):\r
39 \r
40       This program is free software; you can redistribute it and/or modify\r
41       it under the terms of the GNU General Public License as published by\r
42       the Free Software Foundation; either version 2 of the License, or\r
43       (at your option) any later version.\r
44 \r
45       This program is distributed in the hope that it will be useful,\r
46       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
47       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
48       GNU General Public License for more details.\r
49 \r
50       You should have received a copy of the GNU General Public License\r
51       along with this program; if not, write to the Free Software Foundation,\r
52       Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
53 \r
54   ---------------------------------------------------------------------------*/\r
55 \r
56 #ifndef TRUE\r
57 #  define TRUE 1\r
58 #  define FALSE 0\r
59 #endif\r
60 \r
61 #ifndef MAX\r
62 #  define MAX(a,b)  ((a) > (b)? (a) : (b))\r
63 #  define MIN(a,b)  ((a) < (b)? (a) : (b))\r
64 #endif\r
65 \r
66 #ifdef DEBUG\r
67 #  define Trace(x)  {fprintf x ; fflush(stderr); fflush(stdout);}\r
68 #else\r
69 #  define Trace(x)  ;\r
70 #endif\r
71 \r
72 #define TEXT_TITLE    0x01\r
73 #define TEXT_AUTHOR   0x02\r
74 #define TEXT_DESC     0x04\r
75 #define TEXT_COPY     0x08\r
76 #define TEXT_EMAIL    0x10\r
77 #define TEXT_URL      0x20\r
78 \r
79 #define TEXT_TITLE_OFFSET        0\r
80 #define TEXT_AUTHOR_OFFSET      72\r
81 #define TEXT_COPY_OFFSET     (2*72)\r
82 #define TEXT_EMAIL_OFFSET    (3*72)\r
83 #define TEXT_URL_OFFSET      (4*72)\r
84 #define TEXT_DESC_OFFSET     (5*72)\r
85 \r
86 typedef unsigned char   uch;\r
87 typedef unsigned short  ush;\r
88 typedef unsigned long   ulg;\r
89 \r
90 typedef struct _mainprog_info {\r
91     double gamma;\r
92     long width;\r
93     long height;\r
94     time_t modtime;\r
95     FILE *infile;\r
96     FILE *outfile;\r
97     void *png_ptr;\r
98     void *info_ptr;\r
99     uch *image_data;\r
100     uch **row_pointers;\r
101     char *title;\r
102     char *author;\r
103     char *desc;\r
104     char *copyright;\r
105     char *email;\r
106     char *url;\r
107     int filter;    /* command-line-filter flag, not PNG row filter! */\r
108     int pnmtype;\r
109     int sample_depth;\r
110     int interlaced;\r
111     int have_bg;\r
112     int have_time;\r
113     int have_text;\r
114     jmp_buf jmpbuf;\r
115     uch bg_red;\r
116     uch bg_green;\r
117     uch bg_blue;\r
118 } mainprog_info;\r
119 \r
120 \r
121 /* prototypes for public functions in writepng.c */\r
122 \r
123 void writepng_version_info(void);\r
124 \r
125 int writepng_init(mainprog_info *mainprog_ptr);\r
126 \r
127 int writepng_encode_image(mainprog_info *mainprog_ptr);\r
128 \r
129 int writepng_encode_row(mainprog_info *mainprog_ptr);\r
130 \r
131 int writepng_encode_finish(mainprog_info *mainprog_ptr);\r
132 \r
133 void writepng_cleanup(mainprog_info *mainprog_ptr);\r