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]
tif_dirinfo.c
Go to the documentation of this file.
1 /* $Id: tif_dirinfo.c,v 1.62 2006/02/07 10:45:38 dron Exp $ */
2 
3 /*
4  * Copyright (c) 1988-1997 Sam Leffler
5  * Copyright (c) 1991-1997 Silicon Graphics, Inc.
6  *
7  * Permission to use, copy, modify, distribute, and sell this software and
8  * its documentation for any purpose is hereby granted without fee, provided
9  * that (i) the above copyright notices and this permission notice appear in
10  * all copies of the software and related documentation, and (ii) the names of
11  * Sam Leffler and Silicon Graphics may not be used in any advertising or
12  * publicity relating to the software without the specific, prior written
13  * permission of Sam Leffler and Silicon Graphics.
14  *
15  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
17  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
20  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
21  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
22  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
24  * OF THIS SOFTWARE.
25  */
26 
27 /*
28  * TIFF Library.
29  *
30  * Core Directory Tag Support.
31  */
32 #include "tiffiop.h"
33 #include <stdlib.h>
34 
35 /*
36  * NB: NB: THIS ARRAY IS ASSUMED TO BE SORTED BY TAG.
37  * If a tag can have both LONG and SHORT types then the LONG must be
38  * placed before the SHORT for writing to work properly.
39  *
40  * NOTE: The second field (field_readcount) and third field (field_writecount)
41  * sometimes use the values TIFF_VARIABLE (-1), TIFF_VARIABLE2 (-3)
42  * and TIFFTAG_SPP (-2). The macros should be used but would throw off
43  * the formatting of the code, so please interprete the -1, -2 and -3
44  * values accordingly.
45  */
46 static const TIFFFieldInfo
47 tiffFieldInfo[] = {
49  1, 0, "SubfileType" },
50 /* XXX SHORT for compatibility w/ old versions of the library */
52  1, 0, "SubfileType" },
54  1, 0, "OldSubfileType" },
56  0, 0, "ImageWidth" },
58  0, 0, "ImageWidth" },
60  1, 0, "ImageLength" },
62  1, 0, "ImageLength" },
64  0, 0, "BitsPerSample" },
65 /* XXX LONG for compatibility with some broken TIFF writers */
67  0, 0, "BitsPerSample" },
69  0, 0, "Compression" },
70 /* XXX LONG for compatibility with some broken TIFF writers */
72  0, 0, "Compression" },
74  0, 0, "PhotometricInterpretation" },
75 /* XXX LONG for compatibility with some broken TIFF writers */
77  0, 0, "PhotometricInterpretation" },
79  1, 0, "Threshholding" },
81  1, 0, "CellWidth" },
83  1, 0, "CellLength" },
85  0, 0, "FillOrder" },
87  1, 0, "DocumentName" },
89  1, 0, "ImageDescription" },
91  1, 0, "Make" },
93  1, 0, "Model" },
95  0, 0, "StripOffsets" },
97  0, 0, "StripOffsets" },
99  0, 0, "Orientation" },
101  0, 0, "SamplesPerPixel" },
103  0, 0, "RowsPerStrip" },
105  0, 0, "RowsPerStrip" },
107  0, 0, "StripByteCounts" },
109  0, 0, "StripByteCounts" },
111  1, 0, "MinSampleValue" },
113  1, 0, "MaxSampleValue" },
115  1, 0, "XResolution" },
117  1, 0, "YResolution" },
119  0, 0, "PlanarConfiguration" },
121  1, 0, "PageName" },
123  1, 0, "XPosition" },
125  1, 0, "YPosition" },
127  0, 0, "FreeOffsets" },
129  0, 0, "FreeByteCounts" },
131  1, 0, "GrayResponseUnit" },
133  1, 0, "GrayResponseCurve" },
135  1, 0, "ResolutionUnit" },
137  1, 0, "PageNumber" },
139  1, 0, "ColorResponseUnit" },
141  1, 0, "TransferFunction" },
143  1, 0, "Software" },
145  1, 0, "DateTime" },
147  1, 0, "Artist" },
149  1, 0, "HostComputer" },
151  1, 0, "WhitePoint" },
153  1, 0, "PrimaryChromaticities" },
155  1, 0, "ColorMap" },
157  1, 0, "HalftoneHints" },
159  0, 0, "TileWidth" },
161  0, 0, "TileWidth" },
163  0, 0, "TileLength" },
165  0, 0, "TileLength" },
167  0, 0, "TileOffsets" },
169  0, 0, "TileByteCounts" },
171  0, 0, "TileByteCounts" },
173  1, 1, "SubIFD" },
175  1, 1, "SubIFD" },
177  0, 0, "InkSet" },
179  1, 1, "InkNames" },
181  1, 0, "NumberOfInks" },
183  0, 0, "DotRange" },
185  0, 0, "DotRange" },
187  1, 0, "TargetPrinter" },
189  0, 1, "ExtraSamples" },
190 /* XXX for bogus Adobe Photoshop v2.5 files */
192  0, 1, "ExtraSamples" },
194  0, 0, "SampleFormat" },
196  1, 0, "SMinSampleValue" },
198  1, 0, "SMaxSampleValue" },
200  0, 1, "ClipPath" },
202  0, 0, "XClipPathUnits" },
204  0, 0, "XClipPathUnits" },
206  0, 0, "XClipPathUnits" },
208  0, 0, "YClipPathUnits" },
210  0, 0, "YClipPathUnits" },
212  0, 0, "YClipPathUnits" },
214  0, 0, "YCbCrCoefficients" },
216  0, 0, "YCbCrSubsampling" },
218  0, 0, "YCbCrPositioning" },
220  1, 0, "ReferenceBlackWhite" },
221 /* XXX temporarily accept LONG for backwards compatibility */
223  1, 0, "ReferenceBlackWhite" },
225  0, 1, "XMLPacket" },
226 /* begin SGI tags */
228  0, 0, "Matteing" },
230  0, 0, "DataType" },
232  0, 0, "ImageDepth" },
234  0, 0, "ImageDepth" },
236  0, 0, "TileDepth" },
238  0, 0, "TileDepth" },
239 /* end SGI tags */
240 /* begin Pixar tags */
242  1, 0, "ImageFullWidth" },
244  1, 0, "ImageFullLength" },
246  1, 0, "TextureFormat" },
248  1, 0, "TextureWrapModes" },
250  1, 0, "FieldOfViewCotangent" },
252  FIELD_CUSTOM, 1, 0, "MatrixWorldToScreen" },
254  FIELD_CUSTOM, 1, 0, "MatrixWorldToCamera" },
256  1, 0, "Copyright" },
257 /* end Pixar tags */
259  0, 1, "RichTIFFIPTC" },
261  0, 1, "Photoshop" },
263  0, 0, "EXIFIFDOffset" },
265  0, 1, "ICC Profile" },
267  0, 0, "GPSIFDOffset" },
269  0, 0, "StoNits" },
271  0, 0, "InteroperabilityIFDOffset" },
272 /* begin DNG tags */
274  0, 0, "DNGVersion" },
276  0, 0, "DNGBackwardVersion" },
278  1, 0, "UniqueCameraModel" },
280  1, 0, "LocalizedCameraModel" },
282  1, 1, "LocalizedCameraModel" },
284  0, 1, "CFAPlaneColor" },
286  0, 0, "CFALayout" },
288  0, 1, "LinearizationTable" },
290  0, 0, "BlackLevelRepeatDim" },
292  0, 1, "BlackLevel" },
294  0, 1, "BlackLevel" },
296  0, 1, "BlackLevel" },
298  0, 1, "BlackLevelDeltaH" },
300  0, 1, "BlackLevelDeltaV" },
302  0, 0, "WhiteLevel" },
304  0, 0, "WhiteLevel" },
306  0, 0, "DefaultScale" },
308  0, 0, "BestQualityScale" },
310  0, 0, "DefaultCropOrigin" },
312  0, 0, "DefaultCropOrigin" },
314  0, 0, "DefaultCropOrigin" },
316  0, 0, "DefaultCropSize" },
318  0, 0, "DefaultCropSize" },
320  0, 0, "DefaultCropSize" },
322  0, 1, "ColorMatrix1" },
324  0, 1, "ColorMatrix2" },
326  0, 1, "CameraCalibration1" },
328  0, 1, "CameraCalibration2" },
330  0, 1, "ReductionMatrix1" },
332  0, 1, "ReductionMatrix2" },
334  0, 1, "AnalogBalance" },
336  0, 1, "AsShotNeutral" },
338  0, 1, "AsShotNeutral" },
340  0, 0, "AsShotWhiteXY" },
342  0, 0, "BaselineExposure" },
344  0, 0, "BaselineNoise" },
346  0, 0, "BaselineSharpness" },
348  0, 0, "BayerGreenSplit" },
350  0, 0, "LinearResponseLimit" },
352  1, 0, "CameraSerialNumber" },
354  0, 0, "LensInfo" },
356  0, 0, "ChromaBlurRadius" },
358  0, 0, "AntiAliasStrength" },
360  0, 0, "ShadowScale" },
362  0, 1, "DNGPrivateData" },
364  0, 0, "MakerNoteSafety" },
366  0, 0, "CalibrationIlluminant1" },
368  0, 0, "CalibrationIlluminant2" },
370  0, 0, "RawDataUniqueID" },
372  1, 0, "OriginalRawFileName" },
374  1, 1, "OriginalRawFileName" },
376  0, 1, "OriginalRawFileData" },
378  0, 0, "ActiveArea" },
380  0, 0, "ActiveArea" },
382  0, 1, "MaskedAreas" },
384  0, 1, "AsShotICCProfile" },
386  0, 1, "AsShotPreProfileMatrix" },
388  0, 1, "CurrentICCProfile" },
390  0, 1, "CurrentPreProfileMatrix" },
391 /* end DNG tags */
392 };
393 
394 static const TIFFFieldInfo
395 exifFieldInfo[] = {
397  1, 0, "ExposureTime" },
399  1, 0, "FNumber" },
401  1, 0, "ExposureProgram" },
403  1, 0, "SpectralSensitivity" },
405  1, 1, "ISOSpeedRatings" },
407  1, 1, "OptoelectricConversionFactor" },
409  1, 0, "ExifVersion" },
411  1, 0, "DateTimeOriginal" },
413  1, 0, "DateTimeDigitized" },
415  1, 0, "ComponentsConfiguration" },
417  1, 0, "CompressedBitsPerPixel" },
419  1, 0, "ShutterSpeedValue" },
421  1, 0, "ApertureValue" },
423  1, 0, "BrightnessValue" },
425  1, 0, "ExposureBiasValue" },
427  1, 0, "MaxApertureValue" },
429  1, 0, "SubjectDistance" },
431  1, 0, "MeteringMode" },
433  1, 0, "LightSource" },
435  1, 0, "Flash" },
437  1, 0, "FocalLength" },
439  1, 1, "SubjectArea" },
441  1, 1, "MakerNote" },
443  1, 1, "UserComment" },
445  1, 0, "SubSecTime" },
447  1, 0, "SubSecTimeOriginal" },
449  1, 0, "SubSecTimeDigitized" },
451  1, 0, "FlashpixVersion" },
453  1, 0, "PixelXDimension" },
455  1, 0, "PixelXDimension" },
457  1, 0, "PixelYDimension" },
459  1, 0, "PixelYDimension" },
461  1, 0, "RelatedSoundFile" },
463  1, 0, "FlashEnergy" },
465  1, 1, "SpatialFrequencyResponse" },
467  1, 0, "FocalPlaneXResolution" },
469  1, 0, "FocalPlaneYResolution" },
471  1, 0, "FocalPlaneResolutionUnit" },
473  1, 0, "SubjectLocation" },
475  1, 0, "ExposureIndex" },
477  1, 0, "SensingMethod" },
479  1, 0, "FileSource" },
481  1, 0, "SceneType" },
483  1, 1, "CFAPattern" },
485  1, 0, "CustomRendered" },
487  1, 0, "ExposureMode" },
489  1, 0, "WhiteBalance" },
491  1, 0, "DigitalZoomRatio" },
493  1, 0, "FocalLengthIn35mmFilm" },
495  1, 0, "SceneCaptureType" },
497  1, 0, "GainControl" },
499  1, 0, "Contrast" },
501  1, 0, "Saturation" },
503  1, 0, "Sharpness" },
505  1, 1, "DeviceSettingDescription" },
507  1, 0, "SubjectDistanceRange" },
509  1, 0, "ImageUniqueID" }
510 };
511 
512 const TIFFFieldInfo *
514 {
515  *size = TIFFArrayCount(tiffFieldInfo);
516  return tiffFieldInfo;
517 }
518 
519 const TIFFFieldInfo *
521 {
522  *size = TIFFArrayCount(exifFieldInfo);
523  return exifFieldInfo;
524 }
525 
526 void
528 {
529  if (tif->tif_fieldinfo) {
530  size_t i;
531 
532  for (i = 0; i < tif->tif_nfields; i++)
533  {
534  TIFFFieldInfo *fld = tif->tif_fieldinfo[i];
535  if (fld->field_bit == FIELD_CUSTOM &&
536  strncmp("Tag ", fld->field_name, 4) == 0) {
537  _TIFFfree(fld->field_name);
538  _TIFFfree(fld);
539  }
540  }
541 
542  _TIFFfree(tif->tif_fieldinfo);
543  tif->tif_nfields = 0;
544  }
545  _TIFFMergeFieldInfo(tif, info, n);
546 }
547 
548 static int
549 tagCompare(const void* a, const void* b)
550 {
551  const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a;
552  const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b;
553  /* NB: be careful of return values for 16-bit platforms */
554  if (ta->field_tag != tb->field_tag)
555  return (ta->field_tag < tb->field_tag ? -1 : 1);
556  else
557  return ((int)tb->field_type - (int)ta->field_type);
558 }
559 
560 static int
561 tagNameCompare(const void* a, const void* b)
562 {
563  const TIFFFieldInfo* ta = *(const TIFFFieldInfo**) a;
564  const TIFFFieldInfo* tb = *(const TIFFFieldInfo**) b;
565 
566  return strcmp(ta->field_name, tb->field_name);
567 }
568 
569 void
571 {
572  TIFFFieldInfo** tp;
573  int i;
574 
575  tif->tif_foundfield = NULL;
576 
577  if (tif->tif_nfields > 0) {
578  tif->tif_fieldinfo = (TIFFFieldInfo**)
580  (tif->tif_nfields+n) * sizeof (TIFFFieldInfo*));
581  } else {
582  tif->tif_fieldinfo = (TIFFFieldInfo**)
583  _TIFFmalloc(n * sizeof (TIFFFieldInfo*));
584  }
585  assert(tif->tif_fieldinfo != NULL);
586  tp = tif->tif_fieldinfo + tif->tif_nfields;
587  for (i = 0; i < n; i++)
588  *tp++ = (TIFFFieldInfo*) (info + i); /* XXX */
589 
590  /* Sort the field info by tag number */
591  qsort(tif->tif_fieldinfo, tif->tif_nfields += n,
592  sizeof (TIFFFieldInfo*), tagCompare);
593 }
594 
595 void
596 _TIFFPrintFieldInfo(TIFF* tif, FILE* fd)
597 {
598  size_t i;
599 
600  fprintf(fd, "%s: \n", tif->tif_name);
601  for (i = 0; i < tif->tif_nfields; i++) {
602  const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
603  fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n"
604  , (int)i
605  , (unsigned long) fip->field_tag
606  , fip->field_readcount, fip->field_writecount
607  , fip->field_type
608  , fip->field_bit
609  , fip->field_oktochange ? "TRUE" : "FALSE"
610  , fip->field_passcount ? "TRUE" : "FALSE"
611  , fip->field_name
612  );
613  }
614 }
615 
616 /*
617  * Return size of TIFFDataType in bytes
618  */
619 int
621 {
622  switch(type)
623  {
624  case 0: /* nothing */
625  case 1: /* TIFF_BYTE */
626  case 2: /* TIFF_ASCII */
627  case 6: /* TIFF_SBYTE */
628  case 7: /* TIFF_UNDEFINED */
629  return 1;
630  case 3: /* TIFF_SHORT */
631  case 8: /* TIFF_SSHORT */
632  return 2;
633  case 4: /* TIFF_LONG */
634  case 9: /* TIFF_SLONG */
635  case 11: /* TIFF_FLOAT */
636  case 13: /* TIFF_IFD */
637  return 4;
638  case 5: /* TIFF_RATIONAL */
639  case 10: /* TIFF_SRATIONAL */
640  case 12: /* TIFF_DOUBLE */
641  return 8;
642  default:
643  return 0; /* will return 0 for unknown types */
644  }
645 }
646 
647 /*
648  * Return size of TIFFDataType in bytes.
649  *
650  * XXX: We need a separate function to determine the space needed
651  * to store the value. For TIFF_RATIONAL values TIFFDataWidth() returns 8,
652  * but we use 4-byte float to represent rationals.
653  */
654 int
656 {
657  switch (type) {
658  case TIFF_BYTE:
659  case TIFF_SBYTE:
660  case TIFF_ASCII:
661  case TIFF_UNDEFINED:
662  return 1;
663  case TIFF_SHORT:
664  case TIFF_SSHORT:
665  return 2;
666  case TIFF_LONG:
667  case TIFF_SLONG:
668  case TIFF_FLOAT:
669  case TIFF_IFD:
670  case TIFF_RATIONAL:
671  case TIFF_SRATIONAL:
672  return 4;
673  case TIFF_DOUBLE:
674  return 8;
675  default:
676  return 0;
677  }
678 }
679 
680 /*
681  * Return nearest TIFFDataType to the sample type of an image.
682  */
685 {
687 
688  switch (tif->tif_dir.td_sampleformat) {
689  case SAMPLEFORMAT_IEEEFP:
690  return (bps == 4 ? TIFF_FLOAT : TIFF_DOUBLE);
691  case SAMPLEFORMAT_INT:
692  return (bps <= 1 ? TIFF_SBYTE :
693  bps <= 2 ? TIFF_SSHORT : TIFF_SLONG);
694  case SAMPLEFORMAT_UINT:
695  return (bps <= 1 ? TIFF_BYTE :
696  bps <= 2 ? TIFF_SHORT : TIFF_LONG);
697  case SAMPLEFORMAT_VOID:
698  return (TIFF_UNDEFINED);
699  }
700  /*NOTREACHED*/
701  return (TIFF_UNDEFINED);
702 }
703 
704 const TIFFFieldInfo*
706 {
707  int i, n;
708 
709  if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
710  (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
711  return (tif->tif_foundfield);
712  /* NB: use sorted search (e.g. binary search) */
713  if(dt != TIFF_ANY) {
714  TIFFFieldInfo key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0};
715  TIFFFieldInfo* pkey = &key;
716  const TIFFFieldInfo **ret;
717 
718  key.field_tag = tag;
719  key.field_type = dt;
720 
721  ret = (const TIFFFieldInfo **) bsearch(&pkey,
722  tif->tif_fieldinfo,
723  tif->tif_nfields,
724  sizeof(TIFFFieldInfo *),
725  tagCompare);
726  return (ret) ? (*ret) : NULL;
727  } else for (i = 0, n = tif->tif_nfields; i < n; i++) {
728  const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
729  if (fip->field_tag == tag &&
730  (dt == TIFF_ANY || fip->field_type == dt))
731  return (tif->tif_foundfield = fip);
732  }
733  return ((const TIFFFieldInfo *)0);
734 }
735 
736 const TIFFFieldInfo*
737 _TIFFFindFieldInfoByName(TIFF* tif, const char *field_name, TIFFDataType dt)
738 {
739  int i, n;
740 
741  if (tif->tif_foundfield
742  && streq(tif->tif_foundfield->field_name, field_name)
743  && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
744  return (tif->tif_foundfield);
745  /* NB: use sorted search (e.g. binary search) */
746  if(dt != TIFF_ANY) {
747  TIFFFieldInfo key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0};
748  TIFFFieldInfo* pkey = &key;
749  const TIFFFieldInfo **ret;
750 
751  key.field_name = (char *)field_name;
752  key.field_type = dt;
753 
754  ret = (const TIFFFieldInfo **) lfind(&pkey,
755  tif->tif_fieldinfo,
756  &tif->tif_nfields,
757  sizeof(TIFFFieldInfo *),
758  tagNameCompare);
759  return (ret) ? (*ret) : NULL;
760  } else
761  for (i = 0, n = tif->tif_nfields; i < n; i++) {
762  const TIFFFieldInfo* fip = tif->tif_fieldinfo[i];
763  if (streq(fip->field_name, field_name) &&
764  (dt == TIFF_ANY || fip->field_type == dt))
765  return (tif->tif_foundfield = fip);
766  }
767  return ((const TIFFFieldInfo *)0);
768 }
769 
770 const TIFFFieldInfo*
772 {
773  const TIFFFieldInfo* fip = _TIFFFindFieldInfo(tif, tag, TIFF_ANY);
774  if (!fip) {
775  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
776  "Internal error, unknown tag 0x%x",
777  (unsigned int) tag);
778  assert(fip != NULL);
779  /*NOTREACHED*/
780  }
781  return (fip);
782 }
783 
784 const TIFFFieldInfo*
785 _TIFFFieldWithName(TIFF* tif, const char *field_name)
786 {
787  const TIFFFieldInfo* fip =
788  _TIFFFindFieldInfoByName(tif, field_name, TIFF_ANY);
789  if (!fip) {
790  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
791  "Internal error, unknown tag %s", field_name);
792  assert(fip != NULL);
793  /*NOTREACHED*/
794  }
795  return (fip);
796 }
797 
798 const TIFFFieldInfo*
800 
801 {
802  const TIFFFieldInfo *fld;
803 
804  fld = _TIFFFindFieldInfo( tif, tag, dt );
805  if( fld == NULL )
806  {
807  fld = _TIFFCreateAnonFieldInfo( tif, tag, dt );
808  _TIFFMergeFieldInfo( tif, fld, 1 );
809  }
810 
811  return fld;
812 }
813 
816 {
817  TIFFFieldInfo *fld;
818  (void) tif;
819 
820  fld = (TIFFFieldInfo *) _TIFFmalloc(sizeof (TIFFFieldInfo));
821  if (fld == NULL)
822  return NULL;
823  _TIFFmemset( fld, 0, sizeof(TIFFFieldInfo) );
824 
825  fld->field_tag = tag;
828  fld->field_type = field_type;
829  fld->field_bit = FIELD_CUSTOM;
830  fld->field_oktochange = TRUE;
831  fld->field_passcount = TRUE;
832  fld->field_name = (char *) _TIFFmalloc(32);
833  if (fld->field_name == NULL) {
834  _TIFFfree(fld);
835  return NULL;
836  }
837 
838  /* note that this name is a special sign to TIFFClose() and
839  * _TIFFSetupFieldInfo() to free the field
840  */
841  sprintf(fld->field_name, "Tag %d", (int) tag);
842 
843  return fld;
844 }
845 
846 /* vim: set ts=8 sts=8 sw=8 noet: */
#define TIFFTAG_REDUCTIONMATRIX2
Definition: tiff.h:462
#define TIFFTAG_FREEBYTECOUNTS
Definition: tiff.h:249
#define TIFFTAG_SUBFILETYPE
Definition: tiff.h:157
uint32 ttag_t
Definition: tiffio.h:61
#define FIELD_IGNORE
Definition: tif_dir.h:98
#define TIFFTAG_ORIGINALRAWFILENAME
Definition: tiff.h:498
#define TIFF_VARIABLE
Definition: tiffio.h:295
#define TIFFTAG_CELLWIDTH
Definition: tiff.h:216
#define FIELD_CUSTOM
Definition: tiffio.h:299
#define TIFFTAG_INTEROPERABILITYIFD
Definition: tiff.h:429
#define TIFFTAG_LINEARIZATIONTABLE
Definition: tiff.h:439
#define EXIFTAG_DEVICESETTINGDESCRIPTION
Definition: tiff.h:639
#define EXIFTAG_FLASHENERGY
Definition: tiff.h:618
#define TIFFTAG_COPYRIGHT
Definition: tiff.h:387
GLboolean GLboolean GLboolean GLboolean a
#define FIELD_MINSAMPLEVALUE
Definition: tif_dir.h:116
#define FIELD_RESOLUTION
Definition: tif_dir.h:103
#define TIFFTAG_BITSPERSAMPLE
Definition: tiff.h:167
#define TIFFTAG_ROWSPERSTRIP
Definition: tiff.h:236
#define TIFFTAG_DNGVERSION
Definition: tiff.h:431
#define TIFF_ANY
Definition: tiffio.h:294
uint16 td_bitspersample
Definition: tif_dir.h:44
#define TIFFTAG_ICCPROFILE
Definition: tiff.h:416
#define FIELD_STRIPOFFSETS
Definition: tif_dir.h:122
#define TIFFTAG_STRIPBYTECOUNTS
Definition: tiff.h:237
#define TIFFTAG_COLORMAP
Definition: tiff.h:287
const TIFFFieldInfo * _TIFFGetFieldInfo(size_t *size)
Definition: tif_dirinfo.c:513
#define TIFFTAG_PIXAR_MATRIX_WORLDTOSCREEN
Definition: tiff.h:382
#define NULL
Definition: ftobjs.h:61
#define EXIFTAG_SUBJECTAREA
Definition: tiff.h:607
#define TIFFTAG_EXTRASAMPLES
Definition: tiff.h:307
#define TIFFTAG_ORIENTATION
Definition: tiff.h:226
#define FIELD_IMAGEDIMENSIONS
Definition: tif_dir.h:101
#define TIFFTAG_ORIGINALRAWFILEDATA
Definition: tiff.h:500
#define TIFFTAG_IMAGEWIDTH
Definition: tiff.h:165
#define TIFFTAG_YRESOLUTION
Definition: tiff.h:241
#define FIELD_THRESHHOLDING
Definition: tif_dir.h:111
sizeof(AF_ModuleRec)
#define EXIFTAG_EXPOSUREINDEX
Definition: tiff.h:624
#define TIFFTAG_CALIBRATIONILLUMINANT2
Definition: tiff.h:494
#define TIFFTAG_DATATYPE
Definition: tiff.h:363
#define TIFFTAG_MINSAMPLEVALUE
Definition: tiff.h:238
#define TIFFTAG_BLACKLEVELREPEATDIM
Definition: tiff.h:440
#define EXIFTAG_IMAGEUNIQUEID
Definition: tiff.h:643
#define TIFFTAG_INKNAMES
Definition: tiff.h:303
#define TIFFTAG_FILLORDER
Definition: tiff.h:218
const TIFFFieldInfo * _TIFFGetExifFieldInfo(size_t *size)
Definition: tif_dirinfo.c:520
#define TIFFTAG_BASELINEEXPOSURE
Definition: tiff.h:471
#define TIFFTAG_COLORMATRIX2
Definition: tiff.h:456
#define EXIFTAG_FOCALPLANEXRESOLUTION
Definition: tiff.h:620
#define EXIFTAG_FOCALPLANERESOLUTIONUNIT
Definition: tiff.h:622
#define FIELD_HALFTONEHINTS
Definition: tif_dir.h:130
#define EXIFTAG_MAKERNOTE
Definition: tiff.h:608
#define TIFFTAG_DOTRANGE
Definition: tiff.h:305
#define TIFFTAG_STRIPOFFSETS
Definition: tiff.h:225
#define TIFFTAG_SUBIFD
Definition: tiff.h:299
#define TIFFTAG_PIXAR_FOVCOT
Definition: tiff.h:381
#define TIFFTAG_THRESHHOLDING
Definition: tiff.h:212
#define EXIFTAG_PIXELYDIMENSION
Definition: tiff.h:616
#define TIFFTAG_GPSIFD
Definition: tiff.h:419
const TIFFFieldInfo * _TIFFFindOrRegisterFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType dt)
Definition: tif_dirinfo.c:799
#define TIFFTAG_PIXAR_IMAGEFULLWIDTH
Definition: tiff.h:374
#define TIFFTAG_YCBCRSUBSAMPLING
Definition: tiff.h:346
#define TIFFTAG_SOFTWARE
Definition: tiff.h:277
thandle_t tif_clientdata
Definition: tiffiop.h:171
#define FIELD_RESOLUTIONUNIT
Definition: tif_dir.h:119
#define TIFFTAG_YPOSITION
Definition: tiff.h:247
#define TIFFTAG_SMINSAMPLEVALUE
Definition: tiff.h:318
#define TIFFTAG_REFERENCEBLACKWHITE
Definition: tiff.h:350
#define TIFFTAG_PLANARCONFIG
Definition: tiff.h:242
#define TIFFTAG_EXIFIFD
Definition: tiff.h:414
#define EXIFTAG_ISOSPEEDRATINGS
Definition: tiff.h:587
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
#define TIFFTAG_MATTEING
Definition: tiff.h:362
#define TIFFTAG_DATETIME
Definition: tiff.h:278
char * tif_name
Definition: tiffiop.h:96
#define TIFFTAG_ANTIALIASSTRENGTH
Definition: tiff.h:485
#define TIFFTAG_PRIMARYCHROMATICITIES
Definition: tiff.h:286
Definition: tiffiop.h:95
#define FIELD_YCBCRSUBSAMPLING
Definition: tif_dir.h:131
GLboolean GLboolean GLboolean b
#define TIFFTAG_CURRENTPREPROFILEMATRIX
Definition: tiff.h:510
#define TIFFTAG_CAMERACALIBRATION2
Definition: tiff.h:459
#define SAMPLEFORMAT_INT
Definition: tiff.h:313
#define FIELD_SMAXSAMPLEVALUE
Definition: tif_dir.h:127
#define EXIFTAG_DATETIMEORIGINAL
Definition: tiff.h:591
png_uint_32 i
Definition: png.h:2640
#define EXIFTAG_EXPOSURETIME
Definition: tiff.h:583
#define TIFFTAG_TILEBYTECOUNTS
Definition: tiff.h:292
#define TIFFTAG_YCBCRCOEFFICIENTS
Definition: tiff.h:345
#define EXIFTAG_LIGHTSOURCE
Definition: tiff.h:604
#define FIELD_SUBIFD
Definition: tif_dir.h:135
#define FIELD_TRANSFERFUNCTION
Definition: tif_dir.h:133
#define TIFFTAG_CURRENTICCPROFILE
Definition: tiff.h:509
#define FIELD_FILLORDER
Definition: tif_dir.h:112
#define TIFFTAG_PIXAR_MATRIX_WORLDTOCAMERA
Definition: tiff.h:383
#define FIELD_MAXSAMPLEVALUE
Definition: tif_dir.h:117
#define EXIFTAG_WHITEBALANCE
Definition: tiff.h:631
#define FIELD_BITSPERSAMPLE
Definition: tif_dir.h:108
#define TIFFTAG_YCBCRPOSITIONING
Definition: tiff.h:347
#define TIFFTAG_PIXAR_WRAPMODES
Definition: tiff.h:380
#define TIFFTAG_MAKERNOTESAFETY
Definition: tiff.h:489
#define TIFFTAG_TILEWIDTH
Definition: tiff.h:289
#define TIFFTAG_IMAGEDESCRIPTION
Definition: tiff.h:222
#define EXIFTAG_SATURATION
Definition: tiff.h:637
#define FIELD_STRIPBYTECOUNTS
Definition: tif_dir.h:121
#define TIFFTAG_MASKEDAREAS
Definition: tiff.h:504
#define EXIFTAG_FLASH
Definition: tiff.h:605
void _TIFFSetupFieldInfo(TIFF *tif, const TIFFFieldInfo info[], size_t n)
Definition: tif_dirinfo.c:527
#define streq(a, b)
Definition: mkg3states.c:44
#define EXIFTAG_RELATEDSOUNDFILE
Definition: tiff.h:617
#define EXIFTAG_EXPOSUREBIASVALUE
Definition: tiff.h:600
#define TIFFTAG_LENSINFO
Definition: tiff.h:483
#define TIFFTAG_TILELENGTH
Definition: tiff.h:290
#define TIFFTAG_CAMERACALIBRATION1
Definition: tiff.h:458
unsigned char field_passcount
Definition: tiffio.h:308
#define EXIFTAG_USERCOMMENT
Definition: tiff.h:609
#define TIFFTAG_CAMERASERIALNUMBER
Definition: tiff.h:482
#define EXIFTAG_SHUTTERSPEEDVALUE
Definition: tiff.h:597
#define TIFFTAG_ANALOGBALANCE
Definition: tiff.h:464
#define TIFFTAG_IMAGELENGTH
Definition: tiff.h:166
#define FIELD_PLANARCONFIG
Definition: tif_dir.h:118
size_t tif_nfields
Definition: tiffiop.h:181
#define TIFFTAG_TILEOFFSETS
Definition: tiff.h:291
#define EXIFTAG_SUBJECTLOCATION
Definition: tiff.h:623
#define EXIFTAG_FILESOURCE
Definition: tiff.h:626
#define TIFFTAG_SAMPLESPERPIXEL
Definition: tiff.h:235
#define TIFFTAG_BAYERGREENSPLIT
Definition: tiff.h:476
#define EXIFTAG_FOCALLENGTH
Definition: tiff.h:606
#define SAMPLEFORMAT_VOID
Definition: tiff.h:315
#define TIFFTAG_DNGBACKWARDVERSION
Definition: tiff.h:432
#define EXIFTAG_EXIFVERSION
Definition: tiff.h:590
#define TIFFTAG_BASELINENOISE
Definition: tiff.h:473
#define TIFFTAG_FREEOFFSETS
Definition: tiff.h:248
#define EXIFTAG_EXPOSUREPROGRAM
Definition: tiff.h:585
#define TIFFTAG_ASSHOTWHITEXY
Definition: tiff.h:468
#define TIFFTAG_DOCUMENTNAME
Definition: tiff.h:221
#define EXIFTAG_FOCALPLANEYRESOLUTION
Definition: tiff.h:621
#define TIFFTAG_BESTQUALITYSCALE
Definition: tiff.h:495
#define EXIFTAG_SUBSECTIMEORIGINAL
Definition: tiff.h:611
#define TIFFTAG_XMLPACKET
Definition: tiff.h:351
#define TIFFTAG_BLACKLEVELDELTAH
Definition: tiff.h:443
#define SAMPLEFORMAT_UINT
Definition: tiff.h:312
#define TIFFTAG_ASSHOTICCPROFILE
Definition: tiff.h:506
#define TIFFTAG_GRAYRESPONSECURVE
Definition: tiff.h:256
#define EXIFTAG_EXPOSUREMODE
Definition: tiff.h:630
#define EXIFTAG_SHARPNESS
Definition: tiff.h:638
#define EXIFTAG_COMPRESSEDBITSPERPIXEL
Definition: tiff.h:596
#define EXIFTAG_DIGITALZOOMRATIO
Definition: tiff.h:632
#define TIFFhowmany8(x)
Definition: tiffiop.h:226
#define TIFFTAG_CHROMABLURRADIUS
Definition: tiff.h:484
#define SAMPLEFORMAT_IEEEFP
Definition: tiff.h:314
#define TIFFTAG_PIXAR_IMAGEFULLLENGTH
Definition: tiff.h:375
#define TIFFTAG_XPOSITION
Definition: tiff.h:246
GLdouble n
void _TIFFMergeFieldInfo(TIFF *tif, const TIFFFieldInfo info[], int n)
Definition: tif_dirinfo.c:570
#define TIFFTAG_RAWDATAUNIQUEID
Definition: tiff.h:496
#define TIFFTAG_HALFTONEHINTS
Definition: tiff.h:288
#define TIFFTAG_PAGENAME
Definition: tiff.h:245
void * _TIFFrealloc(tdata_t p, tsize_t s)
Definition: tif_acorn.c:473
#define TIFFTAG_DNGPRIVATEDATA
Definition: tiff.h:488
#define FIELD_PHOTOMETRIC
Definition: tif_dir.h:110
#define TIFFTAG_DEFAULTSCALE
Definition: tiff.h:449
#define TIFFTAG_LINEARRESPONSELIMIT
Definition: tiff.h:481
#define EXIFTAG_SUBSECTIME
Definition: tiff.h:610
#define EXIFTAG_SUBSECTIMEDIGITIZED
Definition: tiff.h:612
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:63
#define TIFFTAG_PHOTOMETRIC
Definition: tiff.h:199
short field_readcount
Definition: tiffio.h:303
#define TIFFTAG_ARTIST
Definition: tiff.h:279
#define EXIFTAG_DATETIMEDIGITIZED
Definition: tiff.h:593
#define EXIFTAG_FLASHPIXVERSION
Definition: tiff.h:613
#define TIFFTAG_PAGENUMBER
Definition: tiff.h:269
#define FIELD_COMPRESSION
Definition: tif_dir.h:109
#define TIFFTAG_ASSHOTPREPROFILEMATRIX
Definition: tiff.h:507
#define FIELD_SMINSAMPLEVALUE
Definition: tif_dir.h:126
#define FIELD_ROWSPERSTRIP
Definition: tif_dir.h:115
#define EXIFTAG_BRIGHTNESSVALUE
Definition: tiff.h:599
#define TIFFTAG_GRAYRESPONSEUNIT
Definition: tiff.h:250
#define TIFFTAG_MODEL
Definition: tiff.h:224
#define TIFFTAG_PIXAR_TEXTUREFORMAT
Definition: tiff.h:379
#define TIFFTAG_BASELINESHARPNESS
Definition: tiff.h:474
#define TIFFTAG_HOSTCOMPUTER
Definition: tiff.h:280
#define EXIFTAG_SUBJECTDISTANCE
Definition: tiff.h:602
#define TIFFTAG_TRANSFERFUNCTION
Definition: tiff.h:276
#define FIELD_INKNAMES
Definition: tif_dir.h:134
#define TIFFTAG_WHITEPOINT
Definition: tiff.h:285
TIFFFieldInfo ** tif_fieldinfo
Definition: tiffiop.h:180
#define EXIFTAG_CFAPATTERN
Definition: tiff.h:628
#define TIFFTAG_SHADOWSCALE
Definition: tiff.h:487
#define TIFFTAG_DEFAULTCROPORIGIN
Definition: tiff.h:450
#define TIFFTAG_COMPRESSION
Definition: tiff.h:168
#define FIELD_ORIENTATION
Definition: tif_dir.h:113
#define TIFFTAG_INKSET
Definition: tiff.h:300
#define TIFFTAG_CFALAYOUT
Definition: tiff.h:438
#define EXIFTAG_SCENETYPE
Definition: tiff.h:627
#define TIFFArrayCount(a)
Definition: tiffiop.h:232
void _TIFFmemset(tdata_t p, int v, tsize_t c)
Definition: tif_acorn.c:479
#define TIFFTAG_XCLIPPATHUNITS
Definition: tiff.h:322
#define TIFFTAG_NUMBEROFINKS
Definition: tiff.h:304
#define FIELD_IMAGEDEPTH
Definition: tif_dir.h:128
#define TIFFTAG_SMAXSAMPLEVALUE
Definition: tiff.h:319
const TIFFFieldInfo * _TIFFFieldWithName(TIFF *tif, const char *field_name)
Definition: tif_dirinfo.c:785
#define TIFFTAG_COLORMATRIX1
Definition: tiff.h:454
#define EXIFTAG_CONTRAST
Definition: tiff.h:636
unsigned long uint32
Definition: md5.h:41
GLenum type
#define FIELD_YCBCRPOSITIONING
Definition: tif_dir.h:132
int TIFFDataWidth(TIFFDataType type)
Definition: tif_dirinfo.c:620
void _TIFFPrintFieldInfo(TIFF *tif, FILE *fd)
Definition: tif_dirinfo.c:596
typedef int
Definition: png.h:978
#define TIFFTAG_LOCALIZEDCAMERAMODEL
Definition: tiff.h:434
#define EXIFTAG_GAINCONTROL
Definition: tiff.h:642
int _TIFFDataSize(TIFFDataType type)
Definition: tif_dirinfo.c:655
#define FIELD_EXTRASAMPLES
Definition: tif_dir.h:124
#define TIFFTAG_CELLLENGTH
Definition: tiff.h:217
backing_store_ptr info
Definition: jmemsys.h:181
#define TIFFTAG_ASSHOTNEUTRAL
Definition: tiff.h:466
#define TIFFTAG_STONITS
Definition: tiff.h:426
const TIFFFieldInfo * _TIFFFieldWithTag(TIFF *tif, ttag_t tag)
Definition: tif_dirinfo.c:771
#define TIFFTAG_TILEDEPTH
Definition: tiff.h:365
#define EXIFTAG_COMPONENTSCONFIGURATION
Definition: tiff.h:595
#define TIFFTAG_IMAGEDEPTH
Definition: tiff.h:364
#define TIFFTAG_RESOLUTIONUNIT
Definition: tiff.h:265
#define EXIFTAG_SCENECAPTURETYPE
Definition: tiff.h:634
#define EXIFTAG_FNUMBER
Definition: tiff.h:584
#define TIFFTAG_XRESOLUTION
Definition: tiff.h:240
#define TIFFTAG_BLACKLEVELDELTAV
Definition: tiff.h:445
#define TIFFTAG_DEFAULTCROPSIZE
Definition: tiff.h:452
#define TIFFTAG_MAKE
Definition: tiff.h:223
#define FIELD_POSITION
Definition: tif_dir.h:104
#define TIFFTAG_COLORRESPONSEUNIT
Definition: tiff.h:270
TIFFDirectory tif_dir
Definition: tiffiop.h:122
#define FIELD_PAGENUMBER
Definition: tif_dir.h:120
#define FIELD_TILEDEPTH
Definition: tif_dir.h:129
#define EXIFTAG_APERTUREVALUE
Definition: tiff.h:598
#define TIFFTAG_CFAPLANECOLOR
Definition: tiff.h:436
#define FIELD_TILEDIMENSIONS
Definition: tif_dir.h:102
#define TIFFTAG_WHITELEVEL
Definition: tiff.h:447
#define TIFFTAG_ACTIVEAREA
Definition: tiff.h:502
ttag_t field_tag
Definition: tiffio.h:302
const TIFFFieldInfo * tif_foundfield
Definition: tiffiop.h:182
#define EXIFTAG_SPATIALFREQUENCYRESPONSE
Definition: tiff.h:619
unsigned char field_oktochange
Definition: tiffio.h:307
#define TIFFTAG_RICHTIFFIPTC
Definition: tiff.h:389
#define TIFFTAG_TARGETPRINTER
Definition: tiff.h:306
#define EXIFTAG_SPECTRALSENSITIVITY
Definition: tiff.h:586
const TIFFFieldInfo * _TIFFFindFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType dt)
Definition: tif_dirinfo.c:705
TIFFFieldInfo * _TIFFCreateAnonFieldInfo(TIFF *tif, ttag_t tag, TIFFDataType field_type)
Definition: tif_dirinfo.c:815
#define TIFFTAG_UNIQUECAMERAMODEL
Definition: tiff.h:433
#define TIFFTAG_REDUCTIONMATRIX1
Definition: tiff.h:460
void * _TIFFmalloc(tsize_t s)
Definition: tif_acorn.c:461
#define EXIFTAG_CUSTOMRENDERED
Definition: tiff.h:629
#define EXIFTAG_OECF
Definition: tiff.h:588
#define FIELD_COLORMAP
Definition: tif_dir.h:123
#define FIELD_SAMPLESPERPIXEL
Definition: tif_dir.h:114
char * field_name
Definition: tiffio.h:309
uint16 td_sampleformat
Definition: tif_dir.h:45
#define TIFFTAG_YCLIPPATHUNITS
Definition: tiff.h:324
TIFFDataType field_type
Definition: tiffio.h:305
void _TIFFfree(tdata_t p)
Definition: tif_acorn.c:467
TIFFDataType _TIFFSampleToTagType(TIFF *tif)
Definition: tif_dirinfo.c:684
#define EXIFTAG_FOCALLENGTHIN35MMFILM
Definition: tiff.h:633
Definition: tiff.h:151
#define EXIFTAG_SUBJECTDISTANCERANGE
Definition: tiff.h:640
#define EXIFTAG_MAXAPERTUREVALUE
Definition: tiff.h:601
#define TIFFTAG_SAMPLEFORMAT
Definition: tiff.h:311
#define TIFFTAG_OSUBFILETYPE
Definition: tiff.h:161
#define FIELD_SAMPLEFORMAT
Definition: tif_dir.h:125
const TIFFFieldInfo * _TIFFFindFieldInfoByName(TIFF *tif, const char *field_name, TIFFDataType dt)
Definition: tif_dirinfo.c:737
#define TIFFTAG_CLIPPATH
Definition: tiff.h:320
#define EXIFTAG_PIXELXDIMENSION
Definition: tiff.h:615
GLsizeiptr size
unsigned short field_bit
Definition: tiffio.h:306
#define TRUE
Definition: ftobjs.h:53
#define TIFFTAG_BLACKLEVEL
Definition: tiff.h:442
#define TIFFTAG_MAXSAMPLEVALUE
Definition: tiff.h:239
short field_writecount
Definition: tiffio.h:304
#define TIFFTAG_PHOTOSHOP
Definition: tiff.h:412
#define TIFFTAG_CALIBRATIONILLUMINANT1
Definition: tiff.h:493
TIFFDataType
Definition: tiff.h:137
#define FIELD_SUBFILETYPE
Definition: tif_dir.h:107
#define EXIFTAG_METERINGMODE
Definition: tiff.h:603
#define EXIFTAG_SENSINGMETHOD
Definition: tiff.h:625