ReactOS  0.4.15-dev-1201-gb2cf5a4
tif_open.c File Reference
#include <precomp.h>
Include dependency graph for tif_open.c:

Go to the source code of this file.

Functions

static int _tiffDummyMapProc (thandle_t fd, void **pbase, toff_t *psize)
 
static void _tiffDummyUnmapProc (thandle_t fd, void *base, toff_t size)
 
int _TIFFgetMode (const char *mode, const char *module)
 
TIFFTIFFClientOpen (const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
 
const charTIFFFileName (TIFF *tif)
 
const charTIFFSetFileName (TIFF *tif, const char *name)
 
int TIFFFileno (TIFF *tif)
 
int TIFFSetFileno (TIFF *tif, int fd)
 
thandle_t TIFFClientdata (TIFF *tif)
 
thandle_t TIFFSetClientdata (TIFF *tif, thandle_t newvalue)
 
int TIFFGetMode (TIFF *tif)
 
int TIFFSetMode (TIFF *tif, int mode)
 
int TIFFIsTiled (TIFF *tif)
 
uint32 TIFFCurrentRow (TIFF *tif)
 
uint16 TIFFCurrentDirectory (TIFF *tif)
 
uint32 TIFFCurrentStrip (TIFF *tif)
 
uint32 TIFFCurrentTile (TIFF *tif)
 
int TIFFIsByteSwapped (TIFF *tif)
 
int TIFFIsUpSampled (TIFF *tif)
 
int TIFFIsMSB2LSB (TIFF *tif)
 
int TIFFIsBigEndian (TIFF *tif)
 
TIFFReadWriteProc TIFFGetReadProc (TIFF *tif)
 
TIFFReadWriteProc TIFFGetWriteProc (TIFF *tif)
 
TIFFSeekProc TIFFGetSeekProc (TIFF *tif)
 
TIFFCloseProc TIFFGetCloseProc (TIFF *tif)
 
TIFFSizeProc TIFFGetSizeProc (TIFF *tif)
 
TIFFMapFileProc TIFFGetMapFileProc (TIFF *tif)
 
TIFFUnmapFileProc TIFFGetUnmapFileProc (TIFF *tif)
 

Function Documentation

◆ _tiffDummyMapProc()

static int _tiffDummyMapProc ( thandle_t  fd,
void **  pbase,
toff_t psize 
)
static

Definition at line 34 of file tif_open.c.

35 {
36  (void) fd; (void) pbase; (void) psize;
37  return (0);
38 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
static int fd
Definition: io.c:51

Referenced by TIFFClientOpen().

◆ _tiffDummyUnmapProc()

static void _tiffDummyUnmapProc ( thandle_t  fd,
void base,
toff_t  size 
)
static

Definition at line 41 of file tif_open.c.

42 {
43  (void) fd; (void) base; (void) size;
44 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static int fd
Definition: io.c:51
GLsizeiptr size
Definition: glext.h:5919

Referenced by TIFFClientOpen().

◆ _TIFFgetMode()

int _TIFFgetMode ( const char mode,
const char module 
)

Definition at line 47 of file tif_open.c.

48 {
49  int m = -1;
50 
51  switch (mode[0]) {
52  case 'r':
53  m = O_RDONLY;
54  if (mode[1] == '+')
55  m = O_RDWR;
56  break;
57  case 'w':
58  case 'a':
59  m = O_RDWR|O_CREAT;
60  if (mode[0] == 'w')
61  m |= O_TRUNC;
62  break;
63  default:
64  TIFFErrorExt(0, module, "\"%s\": Bad mode", mode);
65  break;
66  }
67  return (m);
68 }
const GLfloat * m
Definition: glext.h:10848
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define O_TRUNC
Definition: acwin.h:112
GLenum mode
Definition: glext.h:6217
#define O_RDWR
Definition: fcntl.h:36
#define O_CREAT
Definition: acwin.h:110
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFClientOpen(), TIFFOpen(), and TIFFOpenW().

◆ TIFFClientdata()

thandle_t TIFFClientdata ( TIFF tif)

Definition at line 553 of file tif_open.c.

554 {
555  return (tif->tif_clientdata);
556 }
thandle_t tif_clientdata
Definition: tiffiop.h:207

◆ TIFFClientOpen()

TIFF* TIFFClientOpen ( const char name,
const char mode,
thandle_t  clientdata,
TIFFReadWriteProc  readproc,
TIFFReadWriteProc  writeproc,
TIFFSeekProc  seekproc,
TIFFCloseProc  closeproc,
TIFFSizeProc  sizeproc,
TIFFMapFileProc  mapproc,
TIFFUnmapFileProc  unmapproc 
)

Definition at line 71 of file tif_open.c.

82 {
83  static const char module[] = "TIFFClientOpen";
84  TIFF *tif;
85  int m;
86  const char* cp;
87 
88  /* The following are configuration checks. They should be redundant, but should not
89  * compile to any actual code in an optimised release build anyway. If any of them
90  * fail, (makefile-based or other) configuration is not correct */
91  assert(sizeof(uint8)==1);
92  assert(sizeof(int8)==1);
93  assert(sizeof(uint16)==2);
94  assert(sizeof(int16)==2);
95  assert(sizeof(uint32)==4);
96  assert(sizeof(int32)==4);
97  assert(sizeof(uint64)==8);
98  assert(sizeof(int64)==8);
99  assert(sizeof(tmsize_t)==sizeof(void*));
100  {
101  union{
102  uint8 a8[2];
103  uint16 a16;
104  } n;
105  n.a8[0]=1;
106  n.a8[1]=0;
107  #ifdef WORDS_BIGENDIAN
108  assert(n.a16==256);
109  #else
110  assert(n.a16==1);
111  #endif
112  }
113 
115  if (m == -1)
116  goto bad2;
117  tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof (TIFF) + strlen(name) + 1));
118  if (tif == NULL) {
119  TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
120  goto bad2;
121  }
122  _TIFFmemset(tif, 0, sizeof (*tif));
123  tif->tif_name = (char *)tif + sizeof (TIFF);
124  strcpy(tif->tif_name, name);
125  tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
126  tif->tif_curdir = (uint16) -1; /* non-existent directory */
127  tif->tif_curoff = 0;
128  tif->tif_curstrip = (uint32) -1; /* invalid strip */
129  tif->tif_row = (uint32) -1; /* read/write pre-increment */
130  tif->tif_clientdata = clientdata;
131  if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
132  TIFFErrorExt(clientdata, module,
133  "One of the client procedures is NULL pointer.");
134  _TIFFfree(tif);
135  goto bad2;
136  }
137  tif->tif_readproc = readproc;
138  tif->tif_writeproc = writeproc;
139  tif->tif_seekproc = seekproc;
140  tif->tif_closeproc = closeproc;
141  tif->tif_sizeproc = sizeproc;
142  if (mapproc)
143  tif->tif_mapproc = mapproc;
144  else
146  if (unmapproc)
147  tif->tif_unmapproc = unmapproc;
148  else
150  _TIFFSetDefaultCompressionState(tif); /* setup default state */
151  /*
152  * Default is to return data MSB2LSB and enable the
153  * use of memory-mapped files and strip chopping when
154  * a file is opened read-only.
155  */
157  if (m == O_RDONLY )
158  tif->tif_flags |= TIFF_MAPPED;
159 
160  #ifdef STRIPCHOP_DEFAULT
161  if (m == O_RDONLY || m == O_RDWR)
163  #endif
164 
165  /*
166  * Process library-specific flags in the open mode string.
167  * The following flags may be used to control intrinsic library
168  * behaviour that may or may not be desirable (usually for
169  * compatibility with some application that claims to support
170  * TIFF but only supports some brain dead idea of what the
171  * vendor thinks TIFF is):
172  *
173  * 'l' use little-endian byte order for creating a file
174  * 'b' use big-endian byte order for creating a file
175  * 'L' read/write information using LSB2MSB bit order
176  * 'B' read/write information using MSB2LSB bit order
177  * 'H' read/write information using host bit order
178  * 'M' enable use of memory-mapped files when supported
179  * 'm' disable use of memory-mapped files
180  * 'C' enable strip chopping support when reading
181  * 'c' disable strip chopping support
182  * 'h' read TIFF header only, do not load the first IFD
183  * '4' ClassicTIFF for creating a file (default)
184  * '8' BigTIFF for creating a file
185  * 'D' enable use of deferred strip/tile offset/bytecount array loading.
186  * 'O' on-demand loading of values instead of whole array loading (implies D)
187  *
188  * The use of the 'l' and 'b' flags is strongly discouraged.
189  * These flags are provided solely because numerous vendors,
190  * typically on the PC, do not correctly support TIFF; they
191  * only support the Intel little-endian byte order. This
192  * support is not configured by default because it supports
193  * the violation of the TIFF spec that says that readers *MUST*
194  * support both byte orders. It is strongly recommended that
195  * you not use this feature except to deal with busted apps
196  * that write invalid TIFF. And even in those cases you should
197  * bang on the vendors to fix their software.
198  *
199  * The 'L', 'B', and 'H' flags are intended for applications
200  * that can optimize operations on data by using a particular
201  * bit order. By default the library returns data in MSB2LSB
202  * bit order for compatibility with older versions of this
203  * library. Returning data in the bit order of the native CPU
204  * makes the most sense but also requires applications to check
205  * the value of the FillOrder tag; something they probably do
206  * not do right now.
207  *
208  * The 'M' and 'm' flags are provided because some virtual memory
209  * systems exhibit poor behaviour when large images are mapped.
210  * These options permit clients to control the use of memory-mapped
211  * files on a per-file basis.
212  *
213  * The 'C' and 'c' flags are provided because the library support
214  * for chopping up large strips into multiple smaller strips is not
215  * application-transparent and as such can cause problems. The 'c'
216  * option permits applications that only want to look at the tags,
217  * for example, to get the unadulterated TIFF tag information.
218  */
219  for (cp = mode; *cp; cp++)
220  switch (*cp) {
221  case 'b':
222  #ifndef WORDS_BIGENDIAN
223  if (m&O_CREAT)
224  tif->tif_flags |= TIFF_SWAB;
225  #endif
226  break;
227  case 'l':
228  #ifdef WORDS_BIGENDIAN
229  if ((m&O_CREAT))
230  tif->tif_flags |= TIFF_SWAB;
231  #endif
232  break;
233  case 'B':
234  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
236  break;
237  case 'L':
238  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
240  break;
241  case 'H':
242  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
244  break;
245  case 'M':
246  if (m == O_RDONLY)
247  tif->tif_flags |= TIFF_MAPPED;
248  break;
249  case 'm':
250  if (m == O_RDONLY)
251  tif->tif_flags &= ~TIFF_MAPPED;
252  break;
253  case 'C':
254  if (m == O_RDONLY)
255  tif->tif_flags |= TIFF_STRIPCHOP;
256  break;
257  case 'c':
258  if (m == O_RDONLY)
259  tif->tif_flags &= ~TIFF_STRIPCHOP;
260  break;
261  case 'h':
262  tif->tif_flags |= TIFF_HEADERONLY;
263  break;
264  case '8':
265  if (m&O_CREAT)
266  tif->tif_flags |= TIFF_BIGTIFF;
267  break;
268  case 'D':
270  break;
271  case 'O':
272  if( m == O_RDONLY )
274  break;
275  }
276 
277 #ifdef DEFER_STRILE_LOAD
278  /* Compatibility with old DEFER_STRILE_LOAD compilation flag */
279  /* Probably unneeded, since to the best of my knowledge (E. Rouault) */
280  /* GDAL was the only user of this, and will now use the new 'D' flag */
282 #endif
283 
284  /*
285  * Read in TIFF header.
286  */
287  if ((m & O_TRUNC) ||
288  !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) {
289  if (tif->tif_mode == O_RDONLY) {
291  "Cannot read TIFF header");
292  goto bad;
293  }
294  /*
295  * Setup header and write.
296  */
297  #ifdef WORDS_BIGENDIAN
300  #else
303  #endif
304  if (!(tif->tif_flags&TIFF_BIGTIFF))
305  {
307  tif->tif_header.classic.tiff_diroff = 0;
308  if (tif->tif_flags & TIFF_SWAB)
310  tif->tif_header_size = sizeof(TIFFHeaderClassic);
311  }
312  else
313  {
315  tif->tif_header.big.tiff_offsetsize = 8;
316  tif->tif_header.big.tiff_unused = 0;
317  tif->tif_header.big.tiff_diroff = 0;
318  if (tif->tif_flags & TIFF_SWAB)
319  {
322  }
323  tif->tif_header_size = sizeof (TIFFHeaderBig);
324  }
325  /*
326  * The doc for "fopen" for some STD_C_LIBs says that if you
327  * open a file for modify ("+"), then you must fseek (or
328  * fflush?) between any freads and fwrites. This is not
329  * necessary on most systems, but has been shown to be needed
330  * on Solaris.
331  */
332  TIFFSeekFile( tif, 0, SEEK_SET );
333  if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size))) {
335  "Error writing TIFF header");
336  goto bad;
337  }
338  /*
339  * Setup the byte order handling.
340  */
342  #ifndef WORDS_BIGENDIAN
343  tif->tif_flags |= TIFF_SWAB;
344  #endif
345  } else {
346  #ifdef WORDS_BIGENDIAN
347  tif->tif_flags |= TIFF_SWAB;
348  #endif
349  }
350  /*
351  * Setup default directory.
352  */
353  if (!TIFFDefaultDirectory(tif))
354  goto bad;
355  tif->tif_diroff = 0;
356  tif->tif_dirlist = NULL;
357  tif->tif_dirlistsize = 0;
358  tif->tif_dirnumber = 0;
359  return (tif);
360  }
361  /*
362  * Setup the byte order handling.
363  */
366  #if MDI_SUPPORT
367  &&
368  #if HOST_BIGENDIAN
370  #else
372  #endif
373  ) {
375  "Not a TIFF or MDI file, bad magic number %d (0x%x)",
376  #else
377  ) {
379  "Not a TIFF file, bad magic number %d (0x%x)",
380  #endif
383  goto bad;
384  }
386  #ifndef WORDS_BIGENDIAN
387  tif->tif_flags |= TIFF_SWAB;
388  #endif
389  } else {
390  #ifdef WORDS_BIGENDIAN
391  tif->tif_flags |= TIFF_SWAB;
392  #endif
393  }
394  if (tif->tif_flags & TIFF_SWAB)
399  "Not a TIFF file, bad version number %d (0x%x)",
402  goto bad;
403  }
405  {
406  if (tif->tif_flags & TIFF_SWAB)
408  tif->tif_header_size = sizeof(TIFFHeaderClassic);
409  }
410  else
411  {
412  if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic))))
413  {
415  "Cannot read TIFF header");
416  goto bad;
417  }
418  if (tif->tif_flags & TIFF_SWAB)
419  {
422  }
423  if (tif->tif_header.big.tiff_offsetsize != 8)
424  {
426  "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)",
429  goto bad;
430  }
431  if (tif->tif_header.big.tiff_unused != 0)
432  {
434  "Not a TIFF file, bad BigTIFF unused %d (0x%x)",
436  tif->tif_header.big.tiff_unused);
437  goto bad;
438  }
439  tif->tif_header_size = sizeof(TIFFHeaderBig);
440  tif->tif_flags |= TIFF_BIGTIFF;
441  }
442  tif->tif_flags |= TIFF_MYBUFFER;
443  tif->tif_rawcp = tif->tif_rawdata = 0;
444  tif->tif_rawdatasize = 0;
445  tif->tif_rawdataoff = 0;
446  tif->tif_rawdataloaded = 0;
447 
448  switch (mode[0]) {
449  case 'r':
450  if (!(tif->tif_flags&TIFF_BIGTIFF))
452  else
454  /*
455  * Try to use a memory-mapped file if the client
456  * has not explicitly suppressed usage with the
457  * 'm' flag in the open mode (see above).
458  */
459  if (tif->tif_flags & TIFF_MAPPED)
460  {
461  toff_t n;
462  if (TIFFMapFileContents(tif,(void**)(&tif->tif_base),&n))
463  {
464  tif->tif_size=(tmsize_t)n;
465  assert((toff_t)tif->tif_size==n);
466  }
467  else
468  tif->tif_flags &= ~TIFF_MAPPED;
469  }
470  /*
471  * Sometimes we do not want to read the first directory (for example,
472  * it may be broken) and want to proceed to other directories. I this
473  * case we use the TIFF_HEADERONLY flag to open file and return
474  * immediately after reading TIFF header.
475  */
476  if (tif->tif_flags & TIFF_HEADERONLY)
477  return (tif);
478 
479  /*
480  * Setup initial directory.
481  */
482  if (TIFFReadDirectory(tif)) {
483  tif->tif_rawcc = (tmsize_t)-1;
484  tif->tif_flags |= TIFF_BUFFERSETUP;
485  return (tif);
486  }
487  break;
488  case 'a':
489  /*
490  * New directories are automatically append
491  * to the end of the directory chain when they
492  * are written out (see TIFFWriteDirectory).
493  */
494  if (!TIFFDefaultDirectory(tif))
495  goto bad;
496  return (tif);
497  }
498 bad:
499  tif->tif_mode = O_RDONLY; /* XXX avoid flush */
500  TIFFCleanup(tif);
501 bad2:
502  return ((TIFF*)0);
503 }
unsigned long long uint64
Definition: platform.h:18
static int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_open.c:34
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:210
uint8 * tif_rawcp
Definition: tiffiop.h:199
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
uint16 tif_header_size
Definition: tiffiop.h:158
int TIFFReadDirectory(TIFF *tif)
Definition: tif_dirread.c:3574
uint8 * tif_base
Definition: tiffiop.h:202
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
union tiff::@3427 tif_header
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TIFF_STRIPCHOP
Definition: tiffiop.h:134
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:205
#define WriteOK(tif, buf, size)
Definition: tiffiop.h:259
unsigned int uint32
Definition: types.h:32
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:237
uint64 toff_t
Definition: tiffio.h:66
uint32 tif_curstrip
Definition: tiffiop.h:161
#define FILLORDER_LSB2MSB
Definition: tiff.h:217
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
struct tiff TIFF
Definition: tiffio.h:38
uint8 * tif_rawdata
Definition: tiffiop.h:195
uint64 tif_curoff
Definition: tiffiop.h:162
thandle_t tif_clientdata
Definition: tiffiop.h:207
tmsize_t tif_rawdataoff
Definition: tiffiop.h:197
#define STRIPCHOP_DEFAULT
Definition: tiffconf.h:124
long long int64
Definition: platform.h:13
tmsize_t tif_rawcc
Definition: tiffiop.h:200
uint16 tif_curdir
Definition: tiffiop.h:160
char * tif_name
Definition: tiffiop.h:116
const GLfloat * m
Definition: glext.h:10848
Definition: tiffiop.h:115
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
#define TIFF_HEADERONLY
Definition: tiffiop.h:135
TIFFHeaderCommon common
Definition: tiffiop.h:154
#define TIFF_BIGTIFF
Definition: tiffiop.h:138
#define TIFF_SWAB
Definition: tiffiop.h:126
static BOOL readproc(HANDLE proc, LPVOID address, PVOID target, DWORD size)
Definition: env.c:189
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
#define TIFF_LAZYSTRILELOAD
Definition: tiffiop.h:144
int tif_mode
Definition: tiffiop.h:118
uint32 tif_flags
Definition: tiffiop.h:119
smooth NULL
Definition: ftsmooth.c:416
uint64 tif_nextdiroff
Definition: tiffiop.h:147
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
#define TIFFMapFileContents(tif, paddr, psize)
Definition: tiffiop.h:243
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:204
#define MDI_BIGENDIAN
Definition: tiff.h:54
#define SEEK_SET
Definition: jmemansi.c:26
#define TIFF_FILLORDER
Definition: tiffiop.h:120
void TIFFSwabShort(uint16 *wp)
Definition: tif_swab.c:34
#define TIFF_BIGENDIAN
Definition: tiff.h:51
uint32 tiff_diroff
Definition: tiff.h:98
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned char uint8
Definition: types.h:28
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static void _tiffDummyUnmapProc(thandle_t fd, void *base, toff_t size)
Definition: tif_open.c:41
tmsize_t tif_rawdatasize
Definition: tiffiop.h:196
tmsize_t tif_rawdataloaded
Definition: tiffiop.h:198
#define HOST_BIGENDIAN
Definition: tiffconf.h:86
uint64 * tif_dirlist
Definition: tiffiop.h:148
uint16 tif_dirnumber
Definition: tiffiop.h:150
uint64 tif_diroff
Definition: tiffiop.h:146
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:208
tmsize_t tif_size
Definition: tiffiop.h:203
#define TIFF_DEFERSTRILELOAD
Definition: tiffiop.h:143
#define O_TRUNC
Definition: acwin.h:112
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:212
void _TIFFSetDefaultCompressionState(TIFF *tif)
Definition: tif_compress.c:135
GLenum mode
Definition: glext.h:6217
#define MDI_SUPPORT
Definition: tiffconf.h:139
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:211
#define TIFF_BUFFERSETUP
Definition: tiffiop.h:123
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:209
TIFFHeaderBig big
Definition: tiffiop.h:156
#define HOST_FILLORDER
Definition: tif_config.h:113
uint16 tiff_version
Definition: tiff.h:93
uint16 tiff_magic
Definition: tiff.h:92
#define TIFF_MAPPED
Definition: tiffiop.h:130
uint32 tif_row
Definition: tiffiop.h:159
void TIFFSwabLong(uint32 *lp)
Definition: tif_swab.c:45
#define TIFF_LITTLEENDIAN
Definition: tiff.h:52
int _TIFFgetMode(const char *mode, const char *module)
Definition: tif_open.c:47
unsigned short uint16
Definition: types.h:30
short int16
Definition: platform.h:11
#define O_RDWR
Definition: fcntl.h:36
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1372
POINT cp
Definition: magnifier.c:59
Definition: name.c:38
long int32
Definition: platform.h:12
#define ReadOK(tif, buf, size)
Definition: tiffiop.h:252
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define TIFF_VERSION_CLASSIC
Definition: tiff.h:48
uint64 tiff_diroff
Definition: tiff.h:105
TIFFHeaderClassic classic
Definition: tiffiop.h:155
#define MDI_LITTLEENDIAN
Definition: tiff.h:53
void _TIFFfree(void *p)
Definition: tif_unix.c:326
uint16 tiff_offsetsize
Definition: tiff.h:103
uint16 tiff_unused
Definition: tiff.h:104
#define O_CREAT
Definition: acwin.h:110
#define TIFF_VERSION_BIG
Definition: tiff.h:49
uint16 tif_dirlistsize
Definition: tiffiop.h:149
#define FILLORDER_MSB2LSB
Definition: tiff.h:216
#define TIFF_MYBUFFER
Definition: tiffiop.h:128
void TIFFSwabLong8(uint64 *lp)
Definition: tif_swab.c:57
char int8
Definition: platform.h:10
#define O_RDONLY
Definition: acwin.h:108

Referenced by _tiffStreamOpen(), and TIFFFdOpen().

◆ TIFFCurrentDirectory()

uint16 TIFFCurrentDirectory ( TIFF tif)

Definition at line 612 of file tif_open.c.

613 {
614  return (tif->tif_curdir);
615 }
uint16 tif_curdir
Definition: tiffiop.h:160

◆ TIFFCurrentRow()

uint32 TIFFCurrentRow ( TIFF tif)

Definition at line 603 of file tif_open.c.

604 {
605  return (tif->tif_row);
606 }
uint32 tif_row
Definition: tiffiop.h:159

◆ TIFFCurrentStrip()

uint32 TIFFCurrentStrip ( TIFF tif)

Definition at line 621 of file tif_open.c.

622 {
623  return (tif->tif_curstrip);
624 }
uint32 tif_curstrip
Definition: tiffiop.h:161

◆ TIFFCurrentTile()

uint32 TIFFCurrentTile ( TIFF tif)

Definition at line 630 of file tif_open.c.

631 {
632  return (tif->tif_curtile);
633 }
uint32 tif_curtile
Definition: tiffiop.h:169

◆ TIFFFileName()

◆ TIFFFileno()

int TIFFFileno ( TIFF tif)

Definition at line 533 of file tif_open.c.

534 {
535  return (tif->tif_fd);
536 }
int tif_fd
Definition: tiffiop.h:117

◆ TIFFGetCloseProc()

TIFFCloseProc TIFFGetCloseProc ( TIFF tif)

Definition at line 702 of file tif_open.c.

703 {
704  return (tif->tif_closeproc);
705 }
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:211

◆ TIFFGetMapFileProc()

TIFFMapFileProc TIFFGetMapFileProc ( TIFF tif)

Definition at line 720 of file tif_open.c.

721 {
722  return (tif->tif_mapproc);
723 }
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:204

◆ TIFFGetMode()

int TIFFGetMode ( TIFF tif)

Definition at line 573 of file tif_open.c.

574 {
575  return (tif->tif_mode);
576 }
int tif_mode
Definition: tiffiop.h:118

◆ TIFFGetReadProc()

TIFFReadWriteProc TIFFGetReadProc ( TIFF tif)

Definition at line 675 of file tif_open.c.

676 {
677  return (tif->tif_readproc);
678 }
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:208

◆ TIFFGetSeekProc()

TIFFSeekProc TIFFGetSeekProc ( TIFF tif)

Definition at line 693 of file tif_open.c.

694 {
695  return (tif->tif_seekproc);
696 }
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:210

◆ TIFFGetSizeProc()

TIFFSizeProc TIFFGetSizeProc ( TIFF tif)

Definition at line 711 of file tif_open.c.

712 {
713  return (tif->tif_sizeproc);
714 }
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:212

◆ TIFFGetUnmapFileProc()

TIFFUnmapFileProc TIFFGetUnmapFileProc ( TIFF tif)

Definition at line 729 of file tif_open.c.

730 {
731  return (tif->tif_unmapproc);
732 }
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:205

◆ TIFFGetWriteProc()

TIFFReadWriteProc TIFFGetWriteProc ( TIFF tif)

Definition at line 684 of file tif_open.c.

685 {
686  return (tif->tif_writeproc);
687 }
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:209

◆ TIFFIsBigEndian()

int TIFFIsBigEndian ( TIFF tif)

Definition at line 666 of file tif_open.c.

667 {
668  return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN);
669 }
union tiff::@3427 tif_header
TIFFHeaderCommon common
Definition: tiffiop.h:154
#define TIFF_BIGENDIAN
Definition: tiff.h:51
uint16 tiff_magic
Definition: tiff.h:92

◆ TIFFIsByteSwapped()

int TIFFIsByteSwapped ( TIFF tif)

Definition at line 639 of file tif_open.c.

640 {
641  return ((tif->tif_flags & TIFF_SWAB) != 0);
642 }
#define TIFF_SWAB
Definition: tiffiop.h:126
uint32 tif_flags
Definition: tiffiop.h:119

◆ TIFFIsMSB2LSB()

int TIFFIsMSB2LSB ( TIFF tif)

Definition at line 657 of file tif_open.c.

658 {
659  return (isFillOrder(tif, FILLORDER_MSB2LSB));
660 }
#define isFillOrder(tif, o)
Definition: tiffiop.h:231
#define FILLORDER_MSB2LSB
Definition: tiff.h:216

◆ TIFFIsTiled()

int TIFFIsTiled ( TIFF tif)

Definition at line 594 of file tif_open.c.

595 {
596  return (isTiled(tif));
597 }
#define isTiled(tif)
Definition: tiffiop.h:229

Referenced by PickContigCase(), PickSeparateCase(), TIFFForceStrileArrayWriting(), TIFFReadFromUserBuffer(), TIFFReadRGBAStripExt(), and TIFFReadRGBATileExt().

◆ TIFFIsUpSampled()

int TIFFIsUpSampled ( TIFF tif)

Definition at line 648 of file tif_open.c.

649 {
650  return (isUpSampled(tif));
651 }
#define isUpSampled(tif)
Definition: tiffiop.h:232

◆ TIFFSetClientdata()

thandle_t TIFFSetClientdata ( TIFF tif,
thandle_t  newvalue 
)

Definition at line 562 of file tif_open.c.

563 {
564  thandle_t m = tif->tif_clientdata;
565  tif->tif_clientdata = newvalue;
566  return m;
567 }
thandle_t tif_clientdata
Definition: tiffiop.h:207
const GLfloat * m
Definition: glext.h:10848

◆ TIFFSetFileName()

const char* TIFFSetFileName ( TIFF tif,
const char name 
)

Definition at line 522 of file tif_open.c.

523 {
524  const char* old_name = tif->tif_name;
525  tif->tif_name = (char *)name;
526  return (old_name);
527 }
char * tif_name
Definition: tiffiop.h:116
Definition: name.c:38

◆ TIFFSetFileno()

int TIFFSetFileno ( TIFF tif,
int  fd 
)

Definition at line 542 of file tif_open.c.

543 {
544  int old_fd = tif->tif_fd;
545  tif->tif_fd = fd;
546  return old_fd;
547 }
static int fd
Definition: io.c:51
int tif_fd
Definition: tiffiop.h:117

◆ TIFFSetMode()

int TIFFSetMode ( TIFF tif,
int  mode 
)

Definition at line 582 of file tif_open.c.

583 {
584  int old_mode = tif->tif_mode;
585  tif->tif_mode = mode;
586  return (old_mode);
587 }
int tif_mode
Definition: tiffiop.h:118
GLenum mode
Definition: glext.h:6217