2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: ilfile.h /main/4 1995/12/19 16:54:40 cde-dec $ */
24 /**---------------------------------------------------------------------
28 *** description: Public declarations and functions for accessing
29 *** TIFF files with the Image Library (IL).
32 *** (c)Copyright 1991, 1993 Hewlett-Packard Co.
34 *** RESTRICTED RIGHTS LEGEND
35 *** Use, duplication, or disclosure by the U.S. Government is subject to
36 *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
37 *** Technical Data and Computer Software clause in DFARS 252.227-7013.
38 *** Hewlett-Packard Company
39 *** 3000 Hanover Street
40 *** Palo Alto, CA 94304 U.S.A.
41 *** Rights for non-DOD U.S. Government Departments and Agencies are as set
42 *** forth in FAR 52.227-19(c)(1,2).
44 ***-------------------------------------------------------------------*/
58 /* Used when this header is compiled into the DtHelp library */
59 #include "GraphicsP.h"
62 #ifndef NeedFunctionPrototypes
63 #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
64 #define NeedFunctionPrototypes 1
66 #define NeedFunctionPrototypes 0
68 #endif /* NeedFunctionPrototypes */
70 #ifndef NeedWidePrototypes
71 #if defined(NARROWPROTO)
72 #define NeedWidePrototypes 0
74 #define NeedWidePrototypes 1 /* default to make interropt. easier */
78 #ifdef __cplusplus /* do not leave open across includes */
79 extern "C" { /* for C++ V2.0 */
85 #define IL_TAG_ASCII 2
86 #define IL_TAG_SHORT 3
88 #define IL_TAG_RATIONAL 5
89 #define IL_MAX_TAG_TYPE 5
91 /* Tags not read or written by the IL - caller
92 may read them with ilReadFileTags() or write them
93 using ilWriteFileImage().
95 #define IL_TAG_DOCUMENT_NAME 269
96 #define IL_TAG_IMAGE_DESCRIPTION 270
97 #define IL_TAG_MAKE 271
98 #define IL_TAG_MODEL 272
99 #define IL_TAG_PAGE_NAME 285
100 #define IL_TAG_X_POSITION 286
101 #define IL_TAG_Y_POSITION 287
102 #define IL_TAG_TRANSFER_FUNCTION 301
103 #define IL_TAG_DATE_TIME 306
104 #define IL_TAG_ARTIST 315
105 #define IL_TAG_HOST_COMPUTER 316
106 #define IL_TAG_WHITE_POINT 318
107 #define IL_TAG_PRIMARY_CHROMATICITIES 319
108 #define IL_TAG_TRANSFER_RANGE 342
110 /* Tags explicitly read and written (when appropriate)
111 by the IL. These tags cannot be written by the caller
112 using ilWriteFileImage(), because the IL-defined values
113 will override those specified by the caller.
115 #define IL_TAG_NEW_SUBFILE_TYPE 254
116 #define IL_TAG_IMAGE_WIDTH 256
117 #define IL_TAG_IMAGE_LENGTH 257
118 #define IL_TAG_BITS_PER_SAMPLE 258
119 #define IL_TAG_COMPRESSION 259
120 #define IL_TAG_PHOTOMETRIC_INTERPRETATION 262
121 #define IL_TAG_FILL_ORDER 266 /* TIFF class F only */
122 #define IL_TAG_STRIP_OFFSETS 273
123 #define IL_TAG_SAMPLES_PER_PIXEL 277
124 #define IL_TAG_ROWS_PER_STRIP 278
125 #define IL_TAG_STRIP_BYTE_COUNTS 279
126 #define IL_TAG_X_RESOLUTION 282
127 #define IL_TAG_Y_RESOLUTION 283
128 #define IL_TAG_PLANAR_CONFIGURATION 284
129 #define IL_TAG_GROUP_3_OPTIONS 292
130 #define IL_TAG_GROUP_4_OPTIONS 293
131 #define IL_TAG_RESOLUTION_UNIT 296
132 #define IL_TAG_PAGE_NUMBER 297
133 #define IL_TAG_PREDICTOR 317
134 #define IL_TAG_SOFTWARE 305
135 #define IL_TAG_COLOR_MAP 320
136 #define IL_TAG_JPEG_PROC 512
137 #define IL_TAG_JPEG_INTERCHANGE_FORMAT 513
138 #define IL_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH 514
139 #define IL_TAG_JPEG_RESTART_INTERVAL 515
140 #define IL_TAG_JPEG_Q_TABLES 519
141 #define IL_TAG_JPEG_DC_TABLES 520
142 #define IL_TAG_JPEG_AC_TABLES 521
143 #define IL_TAG_YCBCR_COEFFICIENTS 529
144 #define IL_TAG_YCBCR_SUBSAMPLING 530
145 #define IL_TAG_YCBCR_POSITIONING 531
146 #define IL_TAG_REFERENCE_BLACK_WHITE 532
147 #define IL_TAG_PRIVATE_0 34209
149 /* ilWriteFileImage (method) */
150 #define IL_WRITE_MAIN 0
151 #define IL_WRITE_MASK 1
152 #define IL_WRITE_CHILD 2
154 /* ilWriteFileImage (compression) */
155 #define IL_WRITE_CURRENT_COMPRESSION (~0)
157 typedef ilObject ilFile;
159 typedef struct _ilFileImage {
161 struct _ilFileImage *pNext, *pPrev,
168 ilImageFormat format;
170 } ilFileImagePublicRec;
171 typedef ilFileImagePublicRec *ilFileImage;
173 /* TIFF file access types */
175 unsigned short number;
177 unsigned long nItems;
181 extern ilBool ilInitFile (
182 #if NeedFunctionPrototypes
187 unsigned long mustBeZero
191 extern ilFile ilConnectFile (
192 #if NeedFunctionPrototypes
195 /* Used when this header is compiled into the DtHelp library */
201 unsigned long mustBeZero
205 extern ilFileImage ilListFileImages (
206 #if NeedFunctionPrototypes
208 unsigned long mustBeZero
212 extern ilPtr ilReadFileTags (
213 #if NeedFunctionPrototypes
214 ilFileImage fileImage,
216 unsigned short *pTagNumbers,
218 unsigned long mustBeZero
222 extern ilBool ilReadFileImage (
223 #if NeedFunctionPrototypes
225 ilFileImage fileImage,
227 unsigned long mustBeZero
231 extern ilBool ilWriteFileImage (
232 #if NeedFunctionPrototypes
236 ilFileImage fileImage,
237 unsigned int compression,
238 ilPtr pCompressionData,
246 unsigned long mustBeZero