• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/processing/TIFFTags.cpp

00001 #include <map>
00002 #include "pthread.h"
00003 
00004 #include "TIFFTags.h"
00005 
00006 namespace FCam {
00007     const TiffEntryInfo tiffEntryTypes[]={
00009         {
00010             "Artist",
00011             // Person who created the image.
00012             315,
00013             TIFF_ASCII
00014             // Note: some older TIFF files used this tag for storing Copyright information.
00015         },{
00016             "BitsPerSample",
00017             // Number of bits per component.
00018             258,
00019             TIFF_SHORT
00020             // N = SamplesPerPixel
00021             // Note that this field allows a different number of bits per component for each
00022             // component corresponding to a pixel. For example, RGB color data could use a
00023             // different number of bits per component for each of the three color planes. Most RGB
00024             // files will have the same number of BitsPerSample for each component. Even in this
00025             // case, the writer must write all three values.
00026             // Default = 1. See also SamplesPerPixel.
00027             //
00028             // From DNG Spec:
00029             // Supported values are from 8 to 32 bits/sample. The depth
00030             // must be the same for each sample if SamplesPerPixel is not
00031             // equal to 1. If BitsPerSample is not equal to 8 or 16 or 32,
00032             // then the bits must be packed into bytes using the TIFF
00033             // default FillOrder of 1 (big-endian), even if the TIFF file
00034             // itself uses little-endian byte order.
00035         },{
00036             "CellLength",
00037             // The length of the dithering or halftoning matrix used to create a dithered or
00038             // halftoned bilevel file.
00039             265,
00040             TIFF_SHORT
00041             // N = 1
00042             // This field should only be present if Threshholding = 2
00043             // No default. See also Threshholding.
00044         },{
00045             "CellWidth",
00046             // The width of the dithering or halftoning matrix used to create a dithered or
00047             // halftoned bilevel file
00048             264,
00049             TIFF_SHORT
00050             // N = 1
00051             // No default. See also Threshholding.
00052         },{
00053             "ColorMap",
00054             // A color map for palette color images.
00055             32,
00056             TIFF_SHORT
00057             // N = 3 * (2**BitsPerSample)
00058             // This field defines a Red-Green-Blue color map (often called a lookup table) for
00059             // palette-color images. In a palette-color image, a pixel value is used to index into
00060             // an RGB lookup table. For example, a palette-color pixel having a value of 0
00061             // would be displayed according to the 0th Red, Green, Blue triplet.
00062             // In a TIFF ColorMap, all the Red values come first, followed by the Green values,
00063             // then the Blue values. The number of values for each color is 2**BitsPerSample.
00064             // Therefore, the ColorMap field for an 8-bit palette-color image would have 3 * 256
00065             // values.
00066             // The width of each value is 16 bits, as implied by the type of SHORT. 0 represents
00067             // the minimum intensity, and 65535 represents the maximum intensity. Black is
00068             // represented by 0,0,0, and white by 65535, 65535, 65535.
00069             // See also PhotometricInterpretation—palette color.
00070             // No default. ColorMap must be included in all palette-color images.
00071         },{
00072             "Compression",
00073             // Compression scheme used on the image data.
00074             259,
00075             TIFF_SHORT
00076             // N = 1
00077             // 1 = No compression, but pack data into bytes as tightly as possible leaving no unused
00078             // bits except at the end of a row.
00079             // If Then the sample values are stored as an array of type:
00080             // BitsPerSample = 16 for all samples SHORT
00081             // BitsPerSample = 32 for all samples LONG
00082             // Otherwise BYTE
00083             // Each row is padded to the next BYTE/SHORT/LONG boundary, consistent with
00084             // the preceding BitsPerSample rule.
00085             // If the image data is stored as an array of SHORTs or LONGs, the byte ordering
00086             // must be consistent with that specified in bytes 0 and 1 of the TIFF file header.
00087             // Therefore, little-endian format files will have the least significant bytes preceding
00088             // the most significant bytes, while big-endian format files will have the opposite
00089             // order.
00090             // If the number of bits per component is not a power of 2, and you are willing to give up
00091             // some space for better performance, use the next higher power of 2. For example, if
00092             // your data can be represented in 6 bits, set BitsPerSample to 8 instead of 6, and then
00093             // convert the range of the values from [0,63] to [0,255].
00094             // Rows must begin on byte boundaries. (SHORT boundaries if the data is stored as
00095             // SHORTs, LONG boundaries if the data is stored as LONGs).
00096             // Some graphics systems require image data rows to be word-aligned or double-word-
00097             // aligned, and padded to word-boundaries or double-word boundaries. Uncompressed
00098             // TIFF rows will need to be copied into word-aligned or double-word-aligned row
00099             // buffers before being passed to the graphics routines in these environments.
00100             // 2 = CCITT Group 3 1-Dimensional Modified Huffman run-length encoding. See
00101             // Section 10. BitsPerSample must be 1, since this type of compression is defined
00102             // only for bilevel images.
00103             // 32773 = PackBits compression, a simple byte-oriented run-length scheme. See Section 9
00104             // for details.
00105             // Data compression applies only to the image data, pointed to by StripOffsets.
00106             // Default = 1.
00107             //
00108             // From DNG Spec:
00109             // Two Compression tag values are supported:
00110             // Value = 1: Uncompressed data.
00111             // Value = 7: JPEG compressed data, either baseline DCT JPEG, or lossless JPEG compression.
00112             // If PhotometricInterpretation = 6 (YCbCr) and BitsPerSample
00113             // = 8/8/8, or if PhotometricInterpretation = 1 (BlackIsZero)
00114             // and BitsPerSample = 8, then the JPEG variant must be
00115             // baseline DCT JPEG. Otherwise, the JPEG variant must be
00116             // lossless Huffman JPEG. For lossless JPEG, the internal
00117             // width/length/components in the JPEG stream are not required
00118             // to match the strip or tile's width/length/components. Only
00119             // the total sample counts need to match. It is common for CFA
00120             // images to be encoded with a different width, length or
00121             // component count to allow the JPEG compression predictors to
00122             // work across like colors.
00123         },{
00124             "Copyright",
00125             // Copyright notice.
00126             33432,
00127             TIFF_ASCII
00128             // Copyright notice of the person or organization that claims the copyright to the
00129             // image. The complete copyright statement should be listed in this field including
00130             // any dates and statements of claims. For example, “Copyright, John Smith, 19xx.
00131             // All rights reserved.”
00132         },{
00133             "DateTime",
00134             // Date and time of image creation.
00135             306,
00136             TIFF_ASCII
00137             // N = 20
00138             // The format is: “YYYY:MM:DD HH:MM:SS”, with hours like those on a 24-hour
00139             // clock, and one space character between the date and the time. The length of the
00140             // string, including the terminating NUL, is 20 bytes.
00141         },{
00142             "ExtraSamples",
00143             // Description of extra components.
00144             33,
00145             TIFF_SHORT
00146             // N = m
00147             // Specifies that each pixel has m extra components whose interpretation is defined
00148             // by one of the values listed below. When this field is used, the SamplesPerPixel
00149             // field has a value greater than the PhotometricInterpretation field suggests.
00150             // For example, full-color RGB data normally has SamplesPerPixel=3. If
00151             // SamplesPerPixel is greater than 3, then the ExtraSamples field describes the
00152             // meaning of the extra samples. If SamplesPerPixel is, say, 5 then ExtraSamples
00153             // will contain 2 values, one for each extra sample.
00154             // ExtraSamples is typically used to include non-color information, such as opacity,
00155             // in an image. The possible values for each item in the field's value are:
00156             // 0 = Unspecified data
00157             // 1 = Associated alpha data (with pre-multiplied color)
00158             // 2 = Unassociated alpha data
00159             // Associated alpha data is opacity information; it is fully described in Section 21.
00160             // Unassociated alpha data is transparency information that logically exists indepen-
00161             // dent of an image; it is commonly called a soft matte. Note that including both
00162             // unassociated Land associated alpha is undefined because associated alpha specifies
00163             // that color components are pre-multiplied by the alpha component, while
00164             // unassociated alpha specifies the opposite.
00165             // By convention, extra components that are present must be stored as the “last com-
00166             // ponents” in each pixel. For example, if SamplesPerPixel is 4 and there is 1 extra
00167             // component, then it is located in the last component location (SamplesPerPixel-1)
00168             // in each pixel.
00169             // Components designated as “extra” are just like other components in a pixel. In
00170             // particular, the size of such components is defined by the value of the
00171             // BitsPerSample field.
00172             // With the introduction of this field, TIFF readers must not assume a particular
00173             // SamplesPerPixel value based on the value of the PhotometricInterpretation field.
00174             // For example, if the file is an RGB file, SamplesPerPixel may be greater than 3.
00175             // The default is no extra samples. This field must be present if there are extra
00176             // samples.
00177             // See also SamplesPerPixel, AssociatedAlpha.
00178         },{
00179             "FillOrder",
00180             // The logical order of bits within a byte.
00181             266,
00182             TIFF_SHORT
00183             // N = 1
00184             // 1 = pixels are arranged within a byte such that pixels with lower column values are
00185             // stored in the higher-order bits of the byte.
00186             // 1-bit uncompressed data example: Pixel 0 of a row is stored in the high-order bit
00187             // of byte 0, pixel 1 is stored in the next-highest bit, ..., pixel 7 is stored in the low-
00188             // order bit of byte 0, pixel 8 is stored in the high-order bit of byte 1, and so on.
00189             // CCITT 1-bit compressed data example: The high-order bit of the first compres-
00190             // sion code is stored in the high-order bit of byte 0, the next-highest bit of the first
00191             // compression code is stored in the next-highest bit of byte 0, and so on.
00192             // 2 = pixels are arranged within a byte such that pixels with lower column values are
00193             // stored in the lower-order bits of the byte.
00194             // We recommend that FillOrder=2 be used only in special-purpose applications. It
00195             // is easy and inexpensive for writers to reverse bit order by using a 256-byte lookup
00196             // table1 and the data is
00197             // either uncompressed or compressed using CCITT 1D or 2D compression, to
00198             // avoid potentially ambigous situations.
00199             // Support for FillOrder=2 is not required in a Baseline TIFF compliant reader
00200             // Default is FillOrder = 1.
00201             // FreeByteCounts
00202             // For each string of contiguous unused bytes in a TIFF file, the number of bytes in
00203             // the string.
00204             // Tag = 289  (121.H)
00205             // Type = LONG
00206             // Not recommended for general interchange.
00207             // See also FreeOffsets.
00208         },{
00209             "FreeOffsets",
00210             // For each string of contiguous unused bytes in a TIFF file, the byte offset of the
00211             // string.
00212             288,
00213             TIFF_LONG
00214             // Not recommended for general interchange.
00215             // See also FreeByteCounts.
00216         },{
00217             "GrayResponseCurve",
00218             // For grayscale data, the optical density of each possible pixel value.
00219             29,
00220             TIFF_SHORT
00221             // N = 2**BitsPerSample
00222             // The 0th value of GrayResponseCurve corresponds to the optical density of a pixel
00223             // having a value of 0, and so on.
00224             // This field may provide useful information for sophisticated applications, but it is
00225             // currently ignored by most TIFF readers.
00226             // See also GrayResponseUnit, PhotometricInterpretation.
00227         },{
00228             "GrayResponseUnit",
00229             // The precision of the information contained in the GrayResponseCurve.
00230             29,
00231             TIFF_SHORT
00232             // N = 1
00233             // Because optical density is specified in terms of fractional numbers, this field is
00234             // necessary to interpret the stored integer information. For example, if
00235             // GrayScaleResponseUnits is set to 4 (ten-thousandths of a unit), and a
00236             // GrayScaleResponseCurve number for gray level 4 is 3455, then the resulting
00237             // actual value is 0.3455.
00238             // Optical densitometers typically measure densities within the range of 0.0 to 2.0.
00239             // 1 = Number represents tenths of a unit.
00240             // 2 = Number represents hundredths of a unit.
00241             // 3 = Number represents thousandths of a unit.
00242             // 4 =  Number represents ten-thousandths of a unit.
00243             // 5 = Number represents hundred-thousandths of a unit.
00244             // Modifies GrayResponseCurve.
00245             // See also GrayResponseCurve.
00246             // For historical reasons, the default is 2. However, for greater accuracy, 3 is recom-
00247             // mended.
00248         },{
00249             "HostComputer",
00250             // The computer and/or operating system in use at the time of image creation.
00251             316,
00252             TIFF_ASCII
00253             // See also Make, Model, Software.
00254         },{
00255             "ImageDescription",
00256             // A string that describes the subject of the image.
00257             27,
00258             TIFF_ASCII
00259             // For example, a user may wish to attach a comment such as “1988 company pic-
00260             // nic” to an image.
00261         },{
00262             "ImageLength",
00263             // The number of rows of pixels in the image.
00264             257,
00265             TIFF_LONG // or SHORT
00266             // N = 1
00267             // No default. See also ImageWidth.
00268         },{
00269             "ImageWidth",
00270             // The number of columns in the image, i.e., the number of pixels per row.
00271             256,
00272             TIFF_LONG // or SHORT
00273             // N = 1
00274             // No default. See also ImageLength.
00275         },{
00276             "Make",
00277             // The scanner manufacturer.
00278             271,
00279             TIFF_ASCII
00280             // Manufacturer of the scanner, video digitizer, or other type of equipment used to
00281             // generate the image. Synthetic images should not include this field.
00282             // See also Model, Software.
00283         },{
00284             "MaxSampleValue",
00285             // The maximum component value used.
00286             281,
00287             TIFF_SHORT
00288             // N = SamplesPerPixel
00289             // This field is not to be used to affect the visual appearance of an image when it is
00290             // displayed or printed. Nor should this field affect the interpretation of any other
00291             // field; it is used only for statistical purposes.
00292             // Default is 2**(BitsPerSample) - 1.
00293         },{
00294             "MinSampleValue",
00295             // The minimum component value used.
00296             280,
00297             TIFF_SHORT
00298             // N = SamplesPerPixel
00299             // See also MaxSampleValue.
00300             // Default is 0.
00301         },{
00302             "Model",
00303             // The scanner model name or number.
00304             272,
00305             TIFF_ASCII
00306             // The model name or number of the scanner, video digitizer, or other type of equip-
00307             // ment used to generate the image.
00308             // See also Make, Software.
00309         },{
00310             "NewSubfileType",
00311             // A general indication of the kind of data contained in this subfile.
00312             254,
00313             TIFF_LONG
00314             // N = 1 Replaces the old SubfileType field, due to
00315             // limitations in the definition of that field.
00316             // NewSubfileType is mainly useful when there are multiple
00317             // subfiles in a single TIFF file.  This field is made up of a
00318             // set of 32 flag bits. Unused bits are expected to be 0. Bit
00319             // 0 is the low-order bit.  Currently defined values are: Bit
00320             // 0 is 1 if the image is a reduced-resolution version of
00321             // another image in this TIFF file; else the bit is 0.  Bit 1
00322             // is 1 if the image is a single page of a multi-page image
00323             // (see the PageNumber field description); else the bit is 0.
00324             // Bit 2 is 1 if the image defines a transparency mask for
00325             // another image in this TIFF file.  The
00326             // PhotometricInterpretation value must be 4, designating a
00327             // transparency mask.  These values are defined as bit flags
00328             // because they are independent of each other.  Default is 0.
00329             //
00330             // From DNG Spec: In DNG versions earlier than 1.2.0.0, full
00331             // resolution raw images should use NewSubFileType equal to
00332             // 0. Rendered previews or reduced resolution versions of raw
00333             // images should use NewSubFileType equal to 1. DNG 1.2.0.0
00334             // allows a new value for NewSubFileType equal to
00335             // 10001.H. This value, used for alternative or non-primary
00336             // rendered previews, allows for multiple renderings (not just
00337             // multiple sizes of a single rendering) to be stored in a DNG
00338             // file. DNG reading software that displays a preview for a
00339             // DNG file should, by default, display a preview from an IFD
00340             // with NewSubFileType equal to 1. Alternative renderings
00341             // should only be displayed if requested by the user.
00342 
00343         },{
00344             "Orientation",
00345             // The orientation of the image with respect to the rows and columns.
00346             274,
00347             TIFF_SHORT
00348             // N = 1
00349             // 1 = The 0th row represents the visual top of the image, and the 0th column represents
00350             // the visual left-hand side.
00351             // 2 = The 0th row represents the visual top of the image, and the 0th column represents
00352             // the visual right-hand side.
00353             // 3 = The 0th row represents the visual bottom of the image, and the 0th column repre-
00354             // sents the visual right-hand side.
00355             // 4 = The 0th row represents the visual bottom of the image, and the 0th column repre-
00356             // sents the visual left-hand side.
00357             // 5 = The 0th row represents the visual left-hand side of the image, and the 0th column
00358             // represents the visual top.
00359             // 6 = The 0th row represents the visual right-hand side of the image, and the 0th column
00360             // represents the visual top.
00361             // 7 = The 0th row represents the visual right-hand side of the image, and the 0th column
00362             // represents the visual bottom.
00363             // 8 = The 0th row represents the visual left-hand side of the image, and the 0th column
00364             // represents the visual bottom.
00365             // Default is 1.
00366             // Support for orientations other than 1 is not a Baseline TIFF requirement.
00367             //
00368             // From DNG spec:
00369             // Orientation is a required tag for DNG. With the Orientation
00370             // tag present, file browsers can perform lossless rotation of
00371             // DNG files by modifying a single byte of the file. DNG
00372             // readers should support all possible orientations, including
00373             // mirrored orientations. Note that the mirrored orientations
00374             // are not allowed by the TIFF-EP specification, so writers
00375             // should not use them if they want their files be compatible
00376             // with both specifications.
00377         },{
00378             "PhotometricInterpretation",
00379             // The color space of the image data.
00380             262,
00381             TIFF_SHORT
00382             // N = 1
00383             // 0 = WhiteIsZero. For bilevel and grayscale images:  0 is imaged as white.
00384             // 2**BitsPerSample-1 is imaged as black. This is the normal value for Compres-
00385             // sion=2.
00386             // 1 =  BlackIsZero. For bilevel and grayscale images:  0 is imaged as black.
00387             // 2**BitsPerSample-1 is imaged as white. If this value is specified for Compres-
00388             // sion=2, the image should display and print reversed.
00389             // 2 = RGB. In the RGB model, a color is described as a combination of the three pri-
00390             // mary colors of light (red, green, and blue) in particular concentrations. For each of
00391             // the three components, 0 represents minimum intensity, and 2**BitsPerSample - 1
00392             // represents maximum intensity. Thus an RGB value of (0,0,0) represents black,
00393             // and (255,255,255) represents white, assuming 8-bit components. For
00394             // PlanarConfiguration = 1, the components are stored in the indicated order:  first
00395             // Red, then Green, then Blue2, the StripOffsets for the
00396             // component planes are stored in the indicated order:  first the Red component plane
00397             // StripOffsets, then the Green plane StripOffsets, then the Blue plane StripOffsets.
00398             // 3= Palette color.  In this model, a color is described with a single component. The
00399             // value of the component is used as an index into the red, green and blue curves in
00400             // the ColorMap field to retrieve an RGB triplet that defines the color. When
00401             // PhotometricInterpretation=3 is used, ColorMap must be present and
00402             // SamplesPerPixel must be 1.
00403             // 4 =  Transparency Mask.
00404             // This means that the image is used to define an irregularly shaped region of another
00405             // image in the same TIFF file. SamplesPerPixel and BitsPerSample must be 1.
00406             // PackBits compression is recommended. The 1-bits define the interior of the re-
00407             // gion; the 0-bits define the exterior of the region.
00408             // A reader application can use the mask to determine which parts of the image to
00409             // display. Main image pixels that correspond to 1-bits in the transparency mask are
00410             // imaged to the screen or printer, but main image pixels that correspond to 0-bits in
00411             // the mask are not displayed or printed.
00412             // The image mask is typically at a higher resolution than the main image, if the
00413             // main image is grayscale or color so that the edges can be sharp.
00414             // There is no default for PhotometricInterpretation, and it is required. Do not rely
00415             // on applications defaulting to what you want.
00416             //
00417             // From DNG Spec:
00418 
00419             // The following values are supported for thumbnail and preview IFDs only:
00420             // 1 = BlackIsZero. Assumed to be in a gamma 2.2 color space, unless otherwise specified using PreviewColorSpace tag.
00421             // 2 = RGB. Assumed to be in the sRGB color space, unless otherwise specified using the PreviewColorSpace tag.
00422             // 6 = YCbCr. Used for JPEG encoded preview images.
00423             // The following values are supported for the raw IFD, and are assumed to be the camera's native color space:
00424             // 32803 = CFA (Color Filter Array).
00425             // 34892 = LinearRaw.
00426             // The CFA PhotometricInterpretation value is documented in
00427             // the TIFF-EP specification. Its use requires the use of the
00428             // CFARepeatPatternDim and CFAPattern tags in the same
00429             // IFD. The origin of the repeating CFA pattern is the
00430             // top-left corner of the ActiveArea rectangle. The LinearRaw
00431             // PhotometricInterpretation value is intended for use by
00432             // cameras that do not use color filter arrays, but instead
00433             // capture all color components at each pixel. It can also be
00434             // used for CFA data that has already been de-mosaiced. The
00435             // LinearRaw value can be used in reduced resolution IFDs,
00436             // even if the raw IFD uses the CFA PhotometricInterpretation
00437             // value.
00438         },{
00439             "PlanarConfiguration",
00440             // How the components of each pixel are stored.
00441             284,
00442             TIFF_SHORT
00443             // N = 1
00444             // 1 =  Chunky format. The component values for each pixel are stored contiguously.
00445             // The order of the components within the pixel is specified by
00446             // PhotometricInterpretation. For example, for RGB data, the data is stored as
00447             // RGBRGBRGB…
00448             // 2 = Planar format. The components are stored in separate “component planes.”  The
00449             // values in StripOffsets and StripByteCounts are then arranged as a 2-dimensional
00450             // array, with SamplesPerPixel rows and StripsPerImage columns. (All of the col-
00451             // umns for row 0 are stored first, followed by the columns of row 1, and so on.)
00452             // PhotometricInterpretation describes the type of data stored in each component
00453             // plane. For example, RGB data is stored with the Red components in one compo-
00454             // nent plane, the Green in another, and the Blue in another.
00455             // PlanarConfiguration=2 is not currently in widespread use and it is not recom-
00456             // mended for general interchange. It is used as an extension and Baseline TIFF
00457             // readers are not required to support it.
00458             // If SamplesPerPixel is 1, PlanarConfiguration is irrelevant, and need not be in-
00459             // cluded.
00460             // If a row interleave effect is desired, a writer might write out the data as
00461             // PlanarConfiguration=2—separate sample planes—but break up the planes into
00462             // multiple strips (one row per strip, perhaps) and interleave the strips.
00463             // Default is 1. See also BitsPerSample, SamplesPerPixel.
00464         },{
00465             "ResolutionUnit",
00466             // The unit of measurement for XResolution and YResolution.
00467             29,
00468             TIFF_SHORT
00469             // N = 1
00470             // To be used with XResolution and YResolution.
00471             // 1 = No absolute unit of measurement. Used for images that may have a non-square
00472             // aspect ratio, but no meaningful absolute dimensions.
00473             // The drawback of ResolutionUnit=1 is that different applications will import the image
00474             // at different sizes. Even if the decision is arbitrary, it might be better to use dots per
00475             // inch or dots per centimeter, and to pick XResolution and YResolution so that the
00476             // aspect ratio is correct and the maximum dimension of the image is about four inches
00477             // (the “four” is arbitrary.)
00478             // 2 =  Inch.
00479             // 3 =  Centimeter.
00480             // Default is 2.
00481         },{
00482             "RowsPerStrip",
00483             // The number of rows per strip.
00484             278,
00485             TIFF_LONG // or SHORT
00486             // N = 1
00487             // TIFF image data is organized into strips for faster random access and efficient I/O
00488             // buffering.
00489             // RowsPerStrip and ImageLength together tell us the number of strips in the entire
00490             // image. The equation is:
00491             // StripsPerImage = floor ((ImageLength + RowsPerStrip - 1) / RowsPerStrip).
00492             // StripsPerImage is not a field. It is merely a value that a TIFF reader will want to
00493             // compute because it specifies the number of StripOffsets and StripByteCounts for the
00494             // image.
00495             // Note that either SHORT or LONG values can be used to specify RowsPerStrip.
00496             // SHORT values may be used for small TIFF files. It should be noted, however, that
00497             // earlier TIFF specification revisions required LONG values and that some software
00498             // may not accept SHORT values.
00499             // The default is 2**32 - 1, which is effectively infinity. That is, the entire image is
00500             // one strip.
00501             // Use of a single strip is not recommended. Choose RowsPerStrip such that each strip is
00502             // about 8K bytes, even if the data is not compressed, since it makes buffering simpler
00503             // for readers. The “8K” value is fairly arbitrary, but seems to work well.
00504             // See also ImageLength, StripOffsets, StripByteCounts, TileWidth, TileLength,
00505             // TileOffsets, TileByteCounts.
00506         },{
00507             "SamplesPerPixel",
00508             // The number of components per pixel.
00509             277,
00510             TIFF_SHORT
00511             // N = 1
00512             // SamplesPerPixel is usually 1 for bilevel, grayscale, and palette-color images.
00513             // SamplesPerPixel is usually 3 for RGB images.
00514             // Default = 1. See also BitsPerSample, PhotometricInterpretation, ExtraSamples.
00515         },{
00516             "Software",
00517             // Name and version number of the software package(s) used to create the image.
00518             305,
00519             TIFF_ASCII
00520             // See also Make, Model.
00521         },{
00522             "StripByteCounts",
00523             // For each strip, the number of bytes in the strip after compression.
00524             279,
00525             TIFF_LONG // or SHORT, but make sure to write LONG
00526             // N = StripsPerImage for PlanarConfiguration equal to 1.
00527             // = SamplesPerPixel * StripsPerImage for PlanarConfiguration equal to 2
00528             // This tag is required for Baseline TIFF files.
00529             // No default.
00530             // See also StripOffsets, RowsPerStrip, TileOffsets, TileByteCounts.
00531         },{
00532             "StripOffsets",
00533             // For each strip, the byte offset of that strip.
00534             273,
00535             TIFF_LONG // or SHORT, but make sure to write LONG
00536             // N = StripsPerImage for PlanarConfiguration equal to 1.
00537             // = SamplesPerPixel * StripsPerImage for PlanarConfiguration equal to 2
00538             // The offset is specified with respect to the beginning of the TIFF file. Note that this
00539             // implies that each strip has a location independent of the locations of other strips.
00540             // This feature may be useful for editing applications. This required field is the only
00541             // way for a reader to find the image data. (Unless TileOffsets is used; see
00542             // TileOffsets.)
00543             // Note that either SHORT or LONG values may be used to specify the strip offsets.
00544             // SHORT values may be used for small TIFF files. It should be noted, however, that
00545             // earlier TIFF specifications required LONG strip offsets and that some software
00546             // may not accept SHORT values.
00547             // For maximum compatibility with operating systems such as MS-DOS and Win-
00548             // dows, the StripOffsets array should be less than or equal to 64K bytes in length,
00549             // and the strips themselves, in both compressed and uncompressed forms, should
00550             // not be larger than 64K bytes.
00551             // No default. See also StripByteCounts, RowsPerStrip, TileOffsets,
00552             // TileByteCounts.
00553         },{
00554             "SubfileType",
00555             // A general indication of the kind of data contained in this subfile.
00556             255,
00557             TIFF_SHORT
00558             // N = 1
00559             // Currently defined values are:
00560             // 1 = full-resolution image data
00561             // 2 = reduced-resolution image data
00562             // 3 = a single page of a multi-page image (see the PageNumber field description).
00563             // Note that several image types may be found in a single TIFF file, with each subfile
00564             // described by its own IFD.
00565             // No default.
00566             // This field is deprecated. The NewSubfileType field should be used instead.
00567         },{
00568             "Threshholding",
00569             // For black and white TIFF files that represent shades of gray, the technique used to
00570             // convert from gray to black and white pixels.
00571             263,
00572             TIFF_SHORT
00573             // N = 1
00574             // 1 = No dithering or halftoning has been applied to the image data.
00575             // 2 = An ordered dither or halftone technique has been applied to the image data.
00576             // 3 = A randomized process such as error diffusion has been applied to the image data.
00577             // Default is Threshholding = 1. See also CellWidth, CellLength.
00578         },{
00579             "XResolution",
00580             // The number of pixels per ResolutionUnit in the ImageWidth direction.
00581             282,
00582             TIFF_RATIONAL
00583             // N = 1
00584             // It is not mandatory that the image be actually displayed or printed at the size implied
00585             // by this parameter. It is up to the application to use this information as it wishes.
00586             // No default. See also YResolution, ResolutionUnit.
00587         },{
00588             "YResolution",
00589             // The number of pixels per ResolutionUnit in the ImageLength direction.
00590             283,
00591             TIFF_RATIONAL
00592             // N = 1
00593             // No default. See also XResolution, ResolutionUnit.
00594             //
00595         },
00597         {
00598             "SubIFDs",
00599             330,
00600             TIFF_IFD // (type=13) or “LONG”. “IFD” is preferred.
00601             // N = number of child IFDs
00602             // Each value is an offset (from the beginning of the TIFF file, as always) to a child
00603             // IFD. Child images provide extra information for the parent image—such as a
00604             // subsampled version of the parent image.
00605             // TIFF data type 13, “IFD,” is otherwise identical to LONG, but is only used to
00606             // point to other valid IFDs.
00607         },
00609         {
00610             "TileWidth",
00611             322,
00612             TIFF_SHORT // or LONG
00613             // N = 1
00614             // The tile width in pixels.  This is the number of columns in each tile.
00615             // Assuming integer arithmetic, three computed values that are useful in the follow-
00616             // ing field descriptions are:
00617             // TilesAcross = (ImageWidth + TileWidth - 1) / TileWidth
00618             // TilesDown = (ImageLength + TileLength - 1) / TileLength
00619             // TilesPerImage = TilesAcross * TilesDown
00620             // These computed values are not TIFF fields; they are simply values determined by
00621             // the ImageWidth, TileWidth, ImageLength, and TileLength fields.
00622             // TileWidth and ImageWidth together determine the number of tiles that span the
00623             // width of the image (TilesAcross). TileLength and ImageLength together deter-
00624             // mine the number of tiles that span the length of the image (TilesDown).
00625             // We recommend choosing TileWidth and TileLength such that the resulting tiles
00626             // are about 4K to 32K bytes before compression. This seems to be a reasonable
00627             // value for most applications and compression schemes.
00628             // TileWidth must be a multiple of 16. This restriction improves performance in
00629             // some graphics environments and enhances compatibility with compression
00630             // schemes such as JPEG.
00631             // Tiles need not be square.
00632             // Note that ImageWidth can be less than TileWidth, although this means that the
00633             // tiles are too large or that you are using tiling on really small images, neither of
00634             // which is recommended. The same observation holds for ImageLength and
00635             // TileLength.
00636             // No default. See also TileLength, TileOffsets, TileByteCounts.
00637         },{
00638             "TileLength",
00639             323,
00640             TIFF_SHORT // or LONG
00641             // N = 1
00642             // The tile length (height) in pixels. This is the number of rows in each tile.
00643             // TileLength must be a multiple of 16 for compatibility with compression schemes
00644             // such as JPEG.
00645             // Replaces RowsPerStrip in tiled TIFF files.
00646             // No default. See also TileWidth, TileOffsets, TileByteCounts.
00647         },{
00648             "TileOffsets",
00649             324,
00650             TIFF_LONG
00651             // N = TilesPerImage for PlanarConfiguration = 1
00652             // = SamplesPerPixel * TilesPerImage for PlanarConfiguration = 2
00653             // For each tile, the byte offset of that tile, as compressed and stored on disk. The
00654             // offset is specified with respect to the beginning of the TIFF file. Note that this
00655             // implies that each tile has a location independent of the locations of other tiles.
00656             // Offsets are ordered left-to-right and top-to-bottom. For PlanarConfiguration = 2,
00657             // the offsets for the first component plane are stored first, followed by all the offsets
00658             // for the second component plane, and so on.
00659             // No default. See also TileWidth, TileLength, TileByteCounts.
00660         },{
00661             "TileByteCounts",
00662             325,
00663             TIFF_SHORT // or LONG
00664             // N = TilesPerImage for PlanarConfiguration = 1
00665             // = SamplesPerPixel * TilesPerImage for PlanarConfiguration = 2
00666             // For each tile, the number of (compressed) bytes in that tile.
00667             // See TileOffsets for a description of how the byte counts are ordered.
00668             // No default. See also TileWidth, TileLength, TileOffsets.
00669         },
00670 // TIFF/EP Tags (knowledge inferred from many places, ISO spec costs money)
00671         {
00672             "CFAPattern",
00673             33422,
00674             TIFF_BYTE
00675             // Count        Number of pixels in a single CFA pattern repetition
00676             // Default      None
00677             // Description
00678             // Indicates the color filter array (CFA) geometric pattern of the image sensor when a one-chip color area sensor is used.
00679             // It does not apply to all sensing methods.
00680             // The value consists of an id code for every pixel in that pattern. The pattern shape is given by CFARepeatPatternDim, the pixels
00681             // are listed left-to-right, top-to-bottom, with the first pattern starting at the top-left corner of the sensor.
00682             // This identification code can be:
00683             // 0 = Red
00684             // 1 = Green
00685             // 2 = Blue
00686             // 3 = Cyan
00687             // 4 = Magenta
00688             // 5 = Yellow
00689             // 6 = White
00690         },        {
00691             "CFARepeatPatternDim",
00692             33421,
00693             TIFF_SHORT
00694             // Count 2
00695             // Default ?
00696             // Description
00697             // (inferred from Boris's saving code, web info - Eddy)
00698             // Dimensions of the CFA repeating pattern, as two shorts. The colors that make up the pattern are given by CFAPattern
00699         },
00701         {
00702             "DNGVersion",
00703             50706,
00704             TIFF_BYTE,
00705             // Count:
00706             // 4
00707             // Value:
00708             // See below
00709             // Default:
00710             // Required tag
00711             // Usage:
00712             // IFD 0
00713             // Description:
00714             // This tag encodes the DNG four-tier version number. For
00715             // files compliant with this version of the DNG specification
00716             // (1.2.0.0), this tag should contain the bytes: 1, 2, 0, 0.
00717         },{
00718             "DNGBackwardVersion",
00719             50707,
00720             TIFF_BYTE,
00721             // Count:
00722             // 4
00723             // Value:
00724             // See below
00725             // Default:
00726             // DNGVersion with the last two bytes set to zero.
00727             // Usage:
00728             // IFD 0
00729             // Description:
00730             // This tag specifies the oldest version of the Digital
00731             // Negative specification for which a file is
00732             // compatible. Readers should not attempt to read a file if
00733             // this tag specifies a version number that is higher than the
00734             // version number of the specification the reader was based
00735             // on.  In addition to checking the version tags, readers
00736             // should, for all tags, check the types, counts, and values,
00737             // to verify it is able to correctly read the file.  For more
00738             // information on compatibility with previous DNG versions,
00739             // see Appendix A: Compatibility with Previous Versions.
00740         },{
00741             "UniqueCameraModel",
00742             50708,
00743             TIFF_ASCII,
00744             // Count:
00745             // String length including null
00746             // Value:
00747             // Null terminated string
00748             // Default:
00749             // Required tag
00750             // Usage:
00751             // IFD 0
00752             // Description:
00753             // UniqueCameraModel defines a unique, non-localized name for
00754             // the camera model that created the image in the raw
00755             // file. This name should include the manufacturer's name to
00756             // avoid conflicts, and should not be localized, even if the
00757             // camera name itself is localized for different markets (see
00758             // LocalizedCameraModel).
00759             // This string may be used by reader software to index into
00760             // per-model preferences and replacement profiles.  Examples
00761             // of unique model names are:
00762             // •"Canon EOS 300D"
00763             // •"Fujifilm FinePix S2Pro"
00764             // •"Kodak ProBack645"
00765             // •"Minolta DiMAGE A1"
00766             // •"Nikon D1X"
00767             // •"Olympus C-5050Z"
00768             // •"Pentax *istD"
00769             // •"Sony F828"
00770         },{
00771             "LocalizedCameraModel",
00772             50709,
00773             TIFF_ASCII //or BYTE,
00774             // Count:
00775             // Byte count including null
00776             // Value:
00777             // Null terminated UTF-8 encoded Unicode string
00778             // Default:
00779             // Same as UniqueCameraModel
00780             // Usage:
00781             // IFD 0
00782             // Description:
00783             // Similar to the UniqueCameraModel field, except the name can
00784             // be localized for different markets to match the
00785             // localization of the camera name.
00786         },{
00787             "CFAPlaneColor",
00788             50710,
00789             TIFF_BYTE,
00790             // Count:
00791             // ColorPlanes
00792             // Value:
00793             // See below
00794             // Default:
00795             // 0, 1, 2 (red, green, blue)
00796             // Usage:
00797             // Raw IFD
00798             // Description:
00799             // CFAPlaneColor provides a mapping between the values in the
00800             // CFAPattern tag and the plane numbers in LinearRaw
00801             // space. This is a required tag for non-RGB CFA images
00802         },{
00803             "CFALayout",
00804             50711,
00805             TIFF_SHORT,
00806             // Count:
00807             // 1
00808             // Value:
00809             // See below
00810             // Default:
00811             // 1
00812             // Usage:
00813             // Raw IFD
00814             // Description:
00815             // CFALayout describes the spatial layout of the CFA. The currently defined values are:
00816             // 1 = Rectangular (or square) layout
00817             // 2 = Staggered layout A: even columns are offset down by 1/2 row
00818             // 3 = Staggered layout B: even columns are offset up by 1/2 row
00819             // 4 = Staggered layout C: even rows are offset right by 1/2 column
00820             // 5 = Staggered layout D: even rows are offset left by 1/2 column
00821             // 6 = Staggered layout E: even rows are offset up by 1/2 row, even columns are offset left by 1/2 column
00822             // 7 = Staggered layout F: even rows are offset up by 1/2 row, even columns are offset right by 1/2 column
00823             // 8 = Staggered layout G: even rows are offset down by 1/2 row, even columns are offset left by 1/2 column
00824             // 9 = Staggered layout H: even rows are offset down by 1/2 row, even columns are offset right by 1/2 column
00825             // Note that for the purposes of this tag, rows and columns are numbered starting with one.
00826             // Layout values 6 through 9 were added with DNG version 1.3.0.0.
00827         },{
00828             "LinearizationTable",
00829             50712,
00830             TIFF_SHORT,
00831             // Count:
00832             // N
00833             // Value:
00834             // See below
00835             // Default:
00836             // Identity table (0, 1, 2, 3, etc.)
00837             // Usage:
00838             // Raw IFD
00839             // Description:
00840             // LinearizationTable describes a lookup table that maps
00841             // stored values into linear values. This tag is typically
00842             // used to increase compression ratios by storing the raw data
00843             // in a non-linear, more visually uniform space with fewer
00844             // total encoding levels.  If SamplesPerPixel is not equal to
00845             // one, this single table applies to all the samples for each
00846             // pixel.  See Chapter 5, “Mapping Raw Values to Linear
00847             // Reference Values” on page 65 for details of the processing
00848             // model.
00849         },{
00850             "BlackLevelRepeatDim",
00851             50713,
00852             TIFF_SHORT,
00853             // Count:
00854             // 2
00855             // Value:
00856             // Value: 0: BlackLevelRepeatRows
00857             // Value: 1: BlackLevelRepeatCols
00858             // Default:
00859             // 1, 1
00860             // Usage:
00861             // Raw IFD
00862             // Description:
00863             // This tag specifies repeat pattern size for the BlackLevel tag.
00864         },{
00865             "BlackLevel",
00866             50714,
00867             TIFF_SHORT // or LONG or RATIONAL,
00868             // Count:
00869             // BlackLevelRepeatRows * BlackLevelRepeatCols * SamplesPerPixel
00870             // Value:
00871             // See below
00872             // Default:
00873             // 0
00874             // Usage:
00875             // Raw IFD
00876             // Description:
00877             // This tag specifies the zero light (a.k.a. thermal black or
00878             // black current) encoding level, as a repeating pattern. The
00879             // origin of this pattern is the top-left corner of the
00880             // ActiveArea rectangle. The values are stored in
00881             // row-column-sample scan order.  See Chapter 5, “Mapping Raw
00882             // Values to Linear Reference Values” on page 65 for details
00883             // of the processing model.
00884         },{
00885             "BlackLevelDeltaH",
00886             50715,
00887             TIFF_SRATIONAL,
00888             // Count:
00889             // ActiveArea width
00890             // Value:
00891             // See below
00892             // Default:
00893             // All zeros
00894             // Usage:
00895             // Raw IFD
00896             // Description:
00897             // If the zero light encoding level is a function of the image
00898             // column, BlackLevelDeltaH specifies the difference between
00899             // the zero light encoding level for each column and the
00900             // baseline zero light encoding level.  If SamplesPerPixel is
00901             // not equal to one, this single table applies to all the
00902             // samples for each pixel.  See Chapter 5, “Mapping Raw Values
00903             // to Linear Reference Values” on page 65 for details of the
00904             // processing model.
00905         },{
00906             "BlackLevelDeltaV",
00907             50716,
00908             TIFF_SRATIONAL,
00909             // Count:
00910             // ActiveArea length
00911             // Value:
00912             // See below
00913             // Default:
00914             // All zeros
00915             // Usage:
00916             // Raw IFD
00917             // Description:
00918             // If the zero light encoding level is a function of the image
00919             // row, this tag specifies the difference between the zero
00920             // light encoding level for each row and the baseline zero
00921             // light encoding level.  If SamplesPerPixel is not equal to
00922             // one, this single table applies to all the samples for each
00923             // pixel.  See Chapter 5, “Mapping Raw Values to Linear
00924             // Reference Values” on page 65 for details of the processing
00925             // model.
00926         },{
00927             "WhiteLevel",
00928             50717,
00929             TIFF_SHORT //or LONG,
00930             // Count:
00931             // SamplesPerPixel
00932             // Value:
00933             // See below
00934             // Default:
00935             // (2 ** BitsPerSample) - 1
00936             // Usage:
00937             // Raw IFD
00938             // Description:
00939             // This tag specifies the fully saturated encoding level for
00940             // the raw sample values. Saturation is caused either by the
00941             // sensor itself becoming highly non-linear in response, or by
00942             // the camera's analog to digital converter clipping.  See
00943             // Chapter 5, “Mapping Raw Values to Linear Reference Values”
00944             // on page 65 for details of the processing model.
00945         },{
00946             "DefaultScale",
00947             50718,
00948             TIFF_RATIONAL,
00949             // Count:
00950             // 2
00951             // Value:
00952             // Value: 0: DefaultScaleH
00953             // Value: 1: DefaultScaleV
00954             // Default:
00955             // 1.0, 1.0
00956             // Usage:
00957             // Raw IFD
00958             // Description:
00959             // DefaultScale is required for cameras with non-square
00960             // pixels. It specifies the default scale factors for each
00961             // direction to convert the image to square pixels. Typically
00962             // these factors are selected to approximately preserve total
00963             // pixel count.  For CFA images that use CFALayout equal to 2,
00964             // 3, 4, or 5, such as the Fujifilm SuperCCD, these two values
00965             // should usually differ by a factor of 2.0.
00966         },{
00967             "BestQualityScale",
00968             50780,
00969             TIFF_RATIONAL,
00970             // Count:
00971             // 1
00972             // Value:
00973             // see below
00974             // Default:
00975             // 1.0
00976             // Usage:
00977             // Raw IFD
00978             // Description:
00979             // For some cameras, the best possible image quality is not
00980             // achieved by preserving the total pixel count during
00981             // conversion. For example, Fujifilm SuperCCD images have
00982             // maximum detail when their total pixel count is doubled.
00983             // This tag specifies the amount by which the values of the
00984             // DefaultScale tag need to be multiplied to achieve the best
00985             // quality image size.
00986         },{
00987             "DefaultCropOrigin",
00988             50719,
00989             TIFF_SHORT //or LONG or RATIONAL,
00990             // Count:
00991             // 2
00992             // Value:
00993             // Value: 0: DefaultCropOriginH
00994             // Value: 1: DefaultCropOriginV
00995             // Default:
00996             // 0, 0
00997             // Usage:
00998             // Raw IFD
00999             // Description:
01000             // Raw images often store extra pixels around the edges of the
01001             // final image. These extra pixels help prevent interpolation
01002             // artifacts near the edges of the final image.
01003             // Default:CropOrigin specifies the origin of the final image
01004             // area, in raw image coordinates (i.e., before the
01005             // DefaultScale has been applied), relative to the top-left
01006             // corner of the ActiveArea rectangle.
01007         },{
01008             "DefaultCropSize",
01009             50720,
01010             TIFF_SHORT // or LONG or RATIONAL,
01011             // Count:
01012             // 2
01013             // Value:
01014             // Value: 0: DefaultCropSizeH
01015             // Value: 1: DefaultCropSizeV
01016             // Default:
01017             // ImageWidth, ImageLength
01018             // Usage:
01019             // Raw IFD
01020             // Description:
01021             // Raw images often store extra pixels around the edges of the
01022             // final image. These extra pixels help prevent interpolation
01023             // artifacts near the edges of the final image.
01024             // Default:CropSize specifies the size of the final image
01025             // area, in raw image coordinates (i.e., before the
01026             // DefaultScale has been applied).
01027         },{
01028             "CalibrationIlluminant1",
01029             50778,
01030             TIFF_SHORT,
01031             // Count:
01032             // 1
01033             // Value:
01034             // See below
01035             // Default:
01036             // 0 (unknown)
01037             // Usage:
01038             // IFD 0 or Camera Profile IFD
01039             // Description:
01040             // The illuminant used for the first set of color calibration
01041             // tags. The legal values for this tag are the same as the
01042             // legal values for the LightSource EXIF tag.  See Chapter 6,
01043             // “Mapping Camera Color Space to CIE XYZ Space” on page 67
01044             // for details of the color-processing model.
01045         },{
01046             "CalibrationIlluminant2",
01047             50779,
01048             TIFF_SHORT,
01049             // Count:
01050             // 1
01051             // Value:
01052             // See below
01053             // Default:
01054             // None
01055             // Usage:
01056             // IFD 0 or Camera Profile IFD
01057             // Description:
01058             // The illuminant used for an optional second set of color
01059             // calibration tags. The legal values for this tag are the
01060             // same as the legal values for the CalibrationIlluminant1
01061             // tag; however, if both are included, neither is allowed to
01062             // have a value of 0 (unknown).  See Chapter 6, “Mapping
01063             // Camera Color Space to CIE XYZ Space” on page 67 for details
01064             // of the color-processing model.
01065         },{
01066             "ColorMatrix1",
01067             50721,
01068             TIFF_SRATIONAL,
01069             // Count:
01070             // ColorPlanes * 3
01071             // Value:
01072             // See below
01073             // Default:
01074             // None
01075             // Usage:
01076             // IFD 0 or Camera Profile IFD
01077             // Description:
01078             // ColorMatrix1 defines a transformation matrix that converts
01079             // XYZ values to reference camera native color space values,
01080             // under the first calibration illuminant. The matrix values
01081             // are stored in row scan order.  The ColorMatrix1 tag is
01082             // required for all non-monochrome DNG files.  See Chapter 6,
01083             // “Mapping Camera Color Space to CIE XYZ Space” on page 67
01084             // for details of the color-processing model.
01085         },{
01086             "ColorMatrix2",
01087             50722,
01088             TIFF_SRATIONAL,
01089             // Count:
01090             // ColorPlanes * 3
01091             // Value:
01092             // See below
01093             // Default:
01094             // None
01095             // Usage:
01096             // IFD 0 or Camera Profile IFD
01097             // Description:
01098             // ColorMatrix2 defines a transformation matrix that converts
01099             // XYZ values to reference camera native color space values,
01100             // under the second calibration illuminant. The matrix values
01101             // are stored in row scan order.  See Chapter 6, “Mapping
01102             // Camera Color Space to CIE XYZ Space” on page 67 for details
01103             // of the color-processing model.
01104         },{
01105             "CameraCalibration1",
01106             50723,
01107             TIFF_SRATIONAL,
01108             // Count:
01109             // ColorPlanes * ColorPlanes
01110             // Value:
01111             // See below
01112             // Default:
01113             // Identity matrix
01114             // Usage:
01115             // IFD 0
01116             // Description:
01117             // CameraCalibration1 defines a calibration matrix that
01118             // transforms reference camera native space values to
01119             // individual camera native space values under the first
01120             // calibration illuminant. The matrix is stored in row scan
01121             // order.  This matrix is stored separately from the matrix
01122             // specified by the ColorMatrix1 tag to allow raw converters
01123             // to swap in replacement color matrices based on
01124             // UniqueCameraModel tag, while still taking advantage of any
01125             // per-individual camera calibration performed by the camera
01126             // manufacturer.See Chapter 6, “Mapping Camera Color Space to
01127             // CIE XYZ Space” on page 67 for details of the
01128             // color-processing model.
01129         },{
01130             "CameraCalibration2",
01131             50724,
01132             TIFF_SRATIONAL,
01133             // Count:
01134             // ColorPlanes * ColorPlanes
01135             // Value:
01136             // See below
01137             // Default:
01138             // Identity matrix
01139             // Usage:
01140             // IFD 0
01141             // Description:
01142             // CameraCalibration2 defines a calibration matrix that
01143             // transforms reference camera native space values to
01144             // individual camera native space values under the second
01145             // calibration illuminant. The matrix is stored in row scan
01146             // order.  This matrix is stored separately from the matrix
01147             // specified by the ColorMatrix2 tag to allow raw converters
01148             // to swap in replacement color matrices based on
01149             // UniqueCameraModel tag, while still taking advantage of any
01150             // per-individual camera calibration performed by the camera
01151             // manufacturer.  See Chapter 6, “Mapping Camera Color Space
01152             // to CIE XYZ Space” on page 67 for details of the
01153             // color-processing model.
01154         },{
01155             "ReductionMatrix1",
01156             50725,
01157             TIFF_SRATIONAL,
01158             // Count:
01159             // 3 * ColorPlanes
01160             // Value:
01161             // See below
01162             // Default:
01163             // None
01164             // Usage:
01165             // IFD 0 or Camera Profile IFD
01166             // Description:
01167             // ReductionMatrix1 defines a dimensionality reduction matrix
01168             // for use as the first stage in converting color camera
01169             // native space values to XYZ values, under the first
01170             // calibration illuminant. This tag may only be used if
01171             // ColorPlanes is greater than 3. The matrix is stored in row
01172             // scan order.  See Chapter 6, “Mapping Camera Color Space to
01173             // CIE XYZ Space” on page 67 for details of the
01174             // color-processing model.
01175         },{
01176             "ReductionMatrix2",
01177             50726,
01178             TIFF_SRATIONAL,
01179             // Count:
01180             // 3 * ColorPlanes
01181             // Value:
01182             // See below
01183             // Default:
01184             // None
01185             // Usage:
01186             // IFD 0 or Camera Profile IFD
01187             // Description:
01188             // ReductionMatrix2 defines a dimensionality reduction matrix
01189             // for use as the first stage in converting color camera
01190             // native space values to XYZ values, under the second
01191             // calibration illuminant. This tag may only be used if
01192             // ColorPlanes is greater than 3. The matrix is stored in row
01193             // scan order.  See Chapter 6, “Mapping Camera Color Space to
01194             // CIE XYZ Space” on page 67 for details of the
01195             // color-processing model.
01196         },{
01197             "AnalogBalance",
01198             50727,
01199             TIFF_RATIONAL,
01200             // Count:
01201             // ColorPlanes
01202             // Value:
01203             // See below
01204             // Default:
01205             // All 1.0
01206             // Usage:
01207             // IFD 0
01208             // Description:
01209             // Normally the stored raw values are not white balanced,
01210             // since any digital white balancing will reduce the dynamic
01211             // range of the final image if the user decides to later
01212             // adjust the white balance; however, if camera hardware is
01213             // capable of white balancing the color channels before the
01214             // signal is digitized, it can improve the dynamic range of
01215             // the final image.
01216             // AnalogBalance defines the gain, either analog (recommended)
01217             // or digital (not recommended) that has been applied the
01218             // stored raw values.
01219             // See Chapter 6, “Mapping Camera Color Space to CIE XYZ
01220             // Space” on page 67 for details of the color-processing
01221             // model.
01222         },{
01223             "AsShotNeutral",
01224             50728,
01225             TIFF_SHORT //or RATIONAL,
01226             // Count:
01227             // ColorPlanes
01228             // Value:
01229             // See below
01230             // Default:
01231             // None
01232             // Usage:
01233             // IFD 0
01234             // Description:
01235             // AsShotNeutral specifies the selected white balance at time
01236             // of capture, encoded as the coordinates of a perfectly
01237             // neutral color in linear reference space values. The
01238             // inclusion of this tag precludes the inclusion of the
01239             // AsShotWhiteXY tag.
01240         },{
01241             "AsShotWhiteXY",
01242             50729,
01243             TIFF_RATIONAL,
01244             // Count:
01245             // 2
01246             // Value:
01247             // See below
01248             // Default:
01249             // None
01250             // Usage:
01251             // IFD 0
01252             // Description:
01253             // AsShotWhiteXY specifies the selected white balance at time
01254             // of capture, encoded as x-y chromaticity coordinates. The
01255             // inclusion of this tag precludes the inclusion of the
01256             // AsShotNeutral tag.
01257         },{
01258             "BaselineExposure",
01259             50730,
01260             TIFF_SRATIONAL,
01261             // Count:
01262             // 1
01263             // Value:
01264             // See below
01265             // Default:
01266             // 0.0
01267             // Usage:
01268             // IFD 0
01269             // Description:
01270             // Camera models vary in the trade-off they make between
01271             // highlight headroom and shadow noise. Some leave a
01272             // significant amount of highlight headroom during a normal
01273             // exposure. This allows significant negative exposure
01274             // compensation to be applied during raw conversion, but also
01275             // means normal exposures will contain more shadow
01276             // noise. Other models leave less headroom during normal
01277             // exposures. This allows for less negative exposure
01278             // compensation, but results in lower shadow noise for normal
01279             // exposures.
01280             // Because of these differences, a raw converter needs to vary
01281             // the zero point of its exposure compensation control from
01282             // model to model. BaselineExposure specifies by how much (in
01283             // EV units) to move the zero point. Positive values result in
01284             // brighter default results, while negative values result in
01285             // darker default results.
01286         },{
01287             "BaselineNoise",
01288             50731,
01289             TIFF_RATIONAL,
01290             // Count:
01291             // 1
01292             // Value:
01293             // See below
01294             // Default:
01295             // 1.0
01296             // Usage:
01297             // IFD 0
01298             // Description:
01299             // BaselineNoise specifies the relative noise level of the
01300             // camera model at a baseline ISO value of 100, compared to a
01301             // reference camera model.
01302             // Since noise levels tend to vary approximately with the
01303             // square root of the ISO value, a raw converter can use this
01304             // value, combined with the current ISO, to estimate the
01305             // relative noise level of the current image.
01306         },{
01307             "BaselineSharpness",
01308             50732,
01309             TIFF_RATIONAL,
01310             // Count:
01311             // 1
01312             // Value:
01313             // See below
01314             // Default:
01315             // 1.0
01316             // Usage:
01317             // IFD 0
01318             // Description:
01319             // BaselineSharpness specifies the relative amount of
01320             // sharpening required for this camera model, compared to a
01321             // reference camera model. Camera models vary in the strengths
01322             // of their anti-aliasing filters. Cameras with weak or no
01323             // filters require less sharpening than cameras with strong
01324             // anti-aliasing filters.
01325         },{
01326             "BayerGreenSplit",
01327             50733,
01328             TIFF_LONG,
01329             // Count:
01330             // 1
01331             // Value:
01332             // See below
01333             // Default:
01334             // 0
01335             // Usage:
01336             // Raw IFD
01337             // Description:
01338             // BayerGreenSplit only applies to CFA images using a Bayer
01339             // pattern filter array. This tag specifies, in arbitrary
01340             // units, how closely the values of the green pixels in the
01341             // blue/green rows track the values of the green pixels in the
01342             // red/green rows.
01343             // A value of zero means the two kinds of green pixels track
01344             // closely, while a non-zero value means they sometimes
01345             // diverge. The useful range for this tag is from 0 (no
01346             // divergence) to about 5000 (quite large divergence).
01347         },{
01348             "LinearResponseLimit",
01349             50734,
01350             TIFF_RATIONAL,
01351             // Count:
01352             // 1
01353             // Value:
01354             // See below
01355             // Default:
01356             // 1.0
01357             // Usage:
01358             // IFD 0
01359             // Description:
01360             // Some sensors have an unpredictable non-linearity in their
01361             // response as they near the upper limit of their encoding
01362             // range. This non-linearity results in color shifts in the
01363             // highlight areas of the resulting image unless the raw
01364             // converter compensates for this effect.
01365             // LinearResponseLimit specifies the fraction of the encoding
01366             // range above which the response may become significantly
01367             // non-linear.
01368         },{
01369             "CameraSerialNumber",
01370             50735,
01371             TIFF_ASCII,
01372             // Count:
01373             // String length including null
01374             // Value:
01375             // Null terminated string
01376             // Default:
01377             // None
01378             // Usage:
01379             // IFD 0
01380             // Description:
01381             // CameraSerialNumber contains the serial number of the camera or camera body that captured the image.
01382         },{
01383             "LensInfo",
01384             50736,
01385             TIFF_RATIONAL,
01386             // Count:
01387             // 4
01388             // Value:
01389             // Value: 0: Minimum focal length in mm.
01390             // Value: 1: Maximum focal length in mm.
01391             // Value: 2: Minimum (maximum aperture) f-stop at minimum focal length.
01392             // Value: 3: Minimum (maximum aperture) f-stop at maximum focal length.
01393             // Default:
01394             // none
01395             // Usage:
01396             // IFD 0
01397             // Description:
01398             // LensInfo contains information about the lens that captured
01399             // the image. If the minimum f-stops are unknown, they should
01400             // be encoded as 0/0.
01401         },{
01402             "ChromaBlurRadius",
01403             50737,
01404             TIFF_RATIONAL,
01405             // Count:
01406             // 1
01407             // Value:
01408             // Chroma blur radius in pixels
01409             // Default:
01410             // See below
01411             // Usage:
01412             // Raw IFD
01413             // Description:
01414             // ChromaBlurRadius provides a hint to the DNG reader about
01415             // how much chroma blur should be applied to the image. If
01416             // this tag is omitted, the reader will use its default amount
01417             // of chroma blurring.
01418             // Normally this tag is only included for non-CFA images,
01419             // since the amount of chroma blur required for mosaic images
01420             // is highly dependent on the de-mosaic algorithm, in which
01421             // case the DNG reader's default value is likely optimized for
01422             // its particular de-mosaic algorithm.
01423         },{
01424             "AntiAliasStrength",
01425             50738,
01426             TIFF_RATIONAL,
01427             // Count:
01428             // 1
01429             // Value:
01430             // Relative strength of the camera's anti-alias filter
01431             // Default:
01432             // 1.0
01433             // Usage:
01434             // Raw IFD
01435             // Description:
01436             // AntiAliasStrength provides a hint to the DNG reader about
01437             // how strong the camera's anti-alias filter is. A value of
01438             // 0.0 means no anti-alias filter (i.e., the camera is prone
01439             // to aliasing artifacts with some subjects), while a value of
01440             // 1.0 means a strong anti-alias filter (i.e., the camera
01441             // almost never has aliasing artifacts).
01442             // Note that this tag overlaps in functionality with the
01443             // BaselineSharpness tag. The primary difference is the
01444             // AntiAliasStrength tag is used as a hint to the de-mosaic
01445             // algorithm, while the BaselineSharpness tag is used as a
01446             // hint to a sharpening algorithm applied later in the
01447             // processing pipeline.
01448         },{
01449             "ShadowScale",
01450             50739,
01451             TIFF_RATIONAL,
01452             // Count:
01453             // 1
01454             // Value:
01455             // See below
01456             // Default:
01457             // 1.0
01458             // Usage:
01459             // IFD 0
01460             // Description:
01461             // This tag is used by Adobe Camera Raw to control the sensitivity of its "Shadows" slider.
01462         },{
01463             "DNGPrivateData",
01464             50740,
01465             TIFF_BYTE,
01466             // Count: Length of private data block in bytes Value: See
01467             // below Default: None Usage: IFD 0 Description:
01468             // DNGPrivateData provides a way for camera manufacturers to
01469             // store private data in the DNG file for use by their own raw
01470             // converters, and to have that data preserved by programs
01471             // that edit DNG files.
01472             // The private data must follow these rules:
01473             // The private data must start with a null-terminated ASCII
01474             // string identifying the data. The first part of this string
01475             // must be the manufacturer's name, to avoid conflicts between
01476             // manufacturers.
01477             // *The private data must be self-contained. All offsets
01478             // within the private data must be offsets relative to the
01479             // start of the private data, and must not point to bytes
01480             // outside the private data.
01481             // *The private data must be byte-order independent. If a DNG
01482             // file is converted from a big-endian file to a
01483             // little-endian file, the data must remain valid.
01484         },{
01485             "MakerNoteSafety",
01486             50741,
01487             TIFF_SHORT,
01488             // Count:
01489             // 1
01490             // Value:
01491             // 0 (unsafe) or 1 (safe)
01492             // Default:
01493             // 0
01494             // Usage:
01495             // IFD 0
01496             // Description:
01497             // MakerNoteSafety lets the DNG reader know whether the EXIF
01498             // MakerNote tag is safe to preserve along with the rest of
01499             // the EXIF data. File browsers and other image management
01500             // software processing an image with a preserved MakerNote
01501             // should be aware that any thumbnail image embedded in the
01502             // MakerNote may be stale, and may not reflect the current
01503             // state of the full size image.
01504             // A MakerNote is safe to preserve if it follows these rules:
01505             // *The MakerNote data must be self-contained. All offsets
01506             // within the MakerNote must be offsets relative to the start
01507             // of the MakerNote, and must not point to bytes outside the
01508             // MakerNote.
01509             // *The MakerNote data must be byte-order independent. Moving
01510             // *the data to a file with a different byte order must not
01511             // *invalidate it.
01512         },{
01513             "RawDataUniqueID",
01514             50781,
01515             TIFF_BYTE,
01516             // Count:
01517             // 16
01518             // Value:
01519             // See below
01520             // Default:
01521             // Optional
01522             // Usage:
01523             // IFD 0
01524             // Description:
01525             // This tag contains a 16-byte unique identifier for the raw
01526             // image data in the DNG file. DNG readers can use this tag to
01527             // recognize a particular raw image, even if the file's name
01528             // or the metadata contained in the file has been changed.  If
01529             // a DNG writer creates such an identifier, it should do so
01530             // using an algorithm that will ensure that it is very
01531             // unlikely two different images will end up having the same
01532             // identifier.
01533         },{
01534             "OriginalRawFileName",
01535             50827,
01536             TIFF_ASCII // or BYTE,
01537             // Count:
01538             // Byte count including null
01539             // Value:
01540             // Null terminated UTF-8 encoded Unicode string
01541             // Default:
01542             // Optional
01543             // Usage:
01544             // IFD 0
01545             // Description:
01546             // If the DNG file was converted from a non-DNG raw file, then
01547             // this tag contains the file name of that original raw file.
01548         },{
01549             "OriginalRawFileData",
01550             50828,
01551             TIFF_UNDEFINED,
01552             // Count:
01553             // Byte count of embedded data
01554             // Value:
01555             // See below
01556             // Default:
01557             // Optional
01558             // Usage:
01559             // IFD 0
01560             // Description:
01561             // If the DNG file was converted from a non-DNG raw file, then
01562             // this tag contains the compressed contents of that original
01563             // raw file.  The contents of this tag always use the
01564             // big-endian byte order.
01565             // The tag contains a sequence of data blocks. Future versions
01566             // of the DNG specification may define additional data blocks,
01567             // so DNG readers should ignore extra bytes when parsing this
01568             // tag. DNG readers should also detect the case where data
01569             // blocks are missing from the end of the sequence, and should
01570             // assume a default value for all the missing blocks.  There
01571             // are no padding or alignment bytes between data blocks. The
01572             // sequence of data blocks is:
01573             // 1.Compressed data fork of original raw file.
01574             // 2.Compressed Mac OS resource fork of original raw file.
01575             // 3.Mac OS file type (4 bytes) of original raw file.
01576             // 4.Mac OS file creator (4 bytes) of original raw file.
01577             // 5.Compressed data fork of sidecar ".THM" file.
01578             // 6.Compressed Mac OS resource fork of sidecar ".THM" file.
01579             // 7.Mac OS file type (4 bytes) of sidecar ".THM" file.
01580             // 8.Mac OS file creator (4 bytes) of sidecar ".THM" file.
01581             // If the Mac OS file types or creator codes are unknown, zero is stored.
01582             // If the Mac OS resource forks do not exist, they should be encoded as zero length forks.
01583             // Each fork (data or Mac OS resource) is compressed and encoded as:
01584             // ForkLength = first four bytes. This is the uncompressed
01585             // length of this fork. If this value is zero, then no more
01586             // data is stored for this fork.
01587             // From ForkLength, compute the number of 64K compression blocks used for this data (the last block is usually smaller than 64K):
01588             // ForkBlocks = Floor ((ForkLength + 65535) / 65536)
01589             // The next (ForkBlocks + 1) 4-byte values are an index into
01590             // the compressed data. The first ForkBlock values are offsets
01591             // from the start of the data for this fork to the start of
01592             // the compressed data for the corresponding compression
01593             // block. The last value is an offset from the start of the
01594             // data for this fork to the end of the data for this fork.
01595             // Following this index is the ZIP compressed data for each 64K compression block.
01596         },{
01597             "ActiveArea",
01598             50829,
01599             TIFF_SHORT // or LONG,
01600             // Count:
01601             // 4
01602             // Value:
01603             // See below
01604             // Default:
01605             // 0, 0, ImageLength, ImageWidth
01606             // Usage:
01607             // Raw IFD
01608             // Description:
01609             // This rectangle defines the active (non-masked) pixels of
01610             // the sensor. The order of the rectangle coordinates is: top,
01611             // left, bottom, right.
01612         },{
01613             "MaskedAreas",
01614             50830,
01615             TIFF_SHORT // or LONG,
01616             // Count:
01617             // 4 * number of rectangles
01618             // Value:
01619             // See below
01620             // Default:
01621             // None
01622             // Usage:
01623             // Raw IFD
01624             // Description:
01625             // This tag contains a list of non-overlapping rectangle
01626             // coordinates of fully masked pixels, which can be optionally
01627             // used by DNG readers to measure the black encoding level.
01628             // The order of each rectangle's coordinates is: top, left,
01629             // bottom, right.  If the raw image data has already had its
01630             // black encoding level subtracted, then this tag should not
01631             // be used, since the masked pixels are no longer useful.
01632             // Note that DNG writers are still required to include
01633             // estimate and store the black encoding level using the black
01634             // level DNG tags. Support for the MaskedAreas tag is not
01635             // required of DNG readers.
01636         },{
01637             "AsShotICCProfile",
01638             50831,
01639             TIFF_UNDEFINED,
01640             // Count:
01641             // Length of ICC profile in bytes
01642             // Value:
01643             // See below
01644             // Default:
01645             // Optional
01646             // Usage:
01647             // IFD 0
01648             // Description:
01649             // This tag contains an ICC profile that, in conjunction with
01650             // the AsShotPreProfileMatrix tag, provides the camera
01651             // manufacturer with a way to specify a default color
01652             // rendering from camera color space coordinates (linear
01653             // reference values) into the ICC profile connection space.
01654             // The ICC profile connection space is an output referred
01655             // colorimetric space, whereas the other color calibration
01656             // tags in DNG specify a conversion into a scene referred
01657             // colorimetric space. This means that the rendering in this
01658             // profile should include any desired tone and gamut mapping
01659             // needed to convert between scene referred values and output
01660             // referred values.  DNG readers that have their own tone and
01661             // gamut mapping controls (such as Adobe Camera Raw) will
01662             // probably ignore this tag pair.
01663         },{
01664             "AsShotPreProfileMatrix",
01665             50832,
01666             TIFF_SRATIONAL,
01667             // Count:
01668             // 3 * ColorPlanes or ColorPlanes * ColorPlanes
01669             // Value:
01670             // See below
01671             // Default:
01672             // Identity matrix
01673             // Usage:
01674             // IFD 0
01675             // Description:
01676             // This tag is used in conjunction with the AsShotICCProfile
01677             // tag. It specifies a matrix that should be applied to the
01678             // camera color space coordinates before processing the values
01679             // through the ICC profile specified in the AsShotICCProfile
01680             // tag.  The matrix is stored in the row scan order.
01681             // If ColorPlanes is greater than three, then this matrix can
01682             // (but is not required to) reduce the dimensionality of the
01683             // color data down to three components, in which case the
01684             // AsShotICCProfile should have three rather than ColorPlanes
01685             // input components.
01686         },{
01687             "CurrentICCProfile",
01688             50833,
01689             TIFF_UNDEFINED,
01690             // Count:
01691             // Length of ICC profile in bytes
01692             // Value:
01693             // See below
01694             // Default:
01695             // Optional
01696             // Usage:
01697             // IFD 0
01698             // Description:
01699             // This tag is used in conjunction with the CurrentPreProfileMatrix tag.
01700             // The CurrentICCProfile and CurrentPreProfileMatrix tags have
01701             // the same purpose and usage as the AsShotICCProfile and
01702             // AsShotPreProfileMatrix tag pair, except they are for use by
01703             // raw file editors rather than camera manufacturers.
01704         },{
01705             "CurrentPreProfileMatrix",
01706             50834,
01707             TIFF_SRATIONAL,
01708             // Count:
01709             // 3 * ColorPlanes or ColorPlanes * ColorPlanes
01710             // Value:
01711             // See below
01712             // Default:
01713             // Identity matrix
01714             // Usage:
01715             // IFD 0
01716             // Description:
01717             // This tag is used in conjunction with the CurrentICCProfile tag.
01718             // The CurrentICCProfile and CurrentPreProfileMatrix tags have
01719             // the same purpose and usage as the AsShotICCProfile and
01720             // AsShotPreProfileMatrix tag pair, except they are for use by
01721             // raw file editors rather than camera manufacturers.
01722         },{
01723             "ColorimetricReference",
01724             50879,
01725             TIFF_SHORT,
01726             // Count:
01727             // 1
01728             // Value:
01729             // 0 or 1
01730             // Default:
01731             // 0
01732             // Usage:
01733             // IFD 0
01734             // Description:
01735             // The DNG color model documents a transform between camera
01736             // colors and CIE XYZ values. This tag describes the
01737             // colorimetric reference for the CIE XYZ values.
01738             // 0 = The XYZ values are scene-referred.
01739             // 1 = The XYZ values are output-referred, using the ICC
01740             // profile perceptual dynamic range.
01741             // This tag allows output-referred data to be stored in DNG
01742             // files and still processed correctly by DNG readers.
01743         },{
01744             "CameraCalibrationSignature",
01745             50931,
01746             TIFF_ASCII // or BYTE,
01747             // Count:
01748             // Length of string including null
01749             // Value:
01750             // Null terminated string
01751             // Default:
01752             // Empty string
01753             // Usage:
01754             // IFD 0
01755             // Description:
01756             // A UTF-8 encoded string associated with the
01757             // CameraCalibration1 and CameraCalibration2 tags. The
01758             // CameraCalibration1 and CameraCalibration2 tags should only
01759             // be used in the DNG color transform if the string stored in
01760             // the CameraCalibrationSignature tag exactly matches the
01761             // string stored in the ProfileCalibrationSignature tag for
01762             // the selected camera profile.
01763         },{
01764             "ProfileCalibrationSignature",
01765             50932,
01766             TIFF_ASCII // or BYTE,
01767             // Count:
01768             // Length of string including null
01769             // Value:
01770             // Null terminated string
01771             // Default:
01772             // Empty string
01773             // Usage:
01774             // IFD 0 or Camera Profile IFD
01775             // Description:
01776             // A UTF-8 encoded string associated with the camera profile
01777             // tags. The CameraCalibration1 and CameraCalibration2 tags
01778             // should only be used in the DNG color transfer if the string
01779             // stored in the CameraCalibrationSignature tag exactly
01780             // matches the string stored in the
01781             // ProfileCalibrationSignature tag for the selected camera
01782             // profile.
01783         },{
01784             "ExtraCameraProfiles",
01785             50933,
01786             TIFF_LONG,
01787             // Count:
01788             // Number of extra camera profiles
01789             // Value:
01790             // Offsets to Camera Profile IFDs
01791             // Default:
01792             // Empty list
01793             // Usage:
01794             // IFD 0
01795             // Description:
01796             // A list of file offsets to extra Camera Profile IFDs. The
01797             // format of a camera profile begins with a 16-bit byte order
01798             // mark (MM or II) followed by a 16-bit "magic" number equal
01799             // to 0x4352 (CR), a 32-bit IFD offset, and then a standard
01800             // TIFF format IFD. All offsets are relative to the start of
01801             // the byte order mark. Note that the primary camera profile
01802             // tags should be stored in IFD 0, and the ExtraCameraProfiles
01803             // tag should only be used if there is more than one camera
01804             // profile stored in the DNG file.
01805         },{
01806             "AsShotProfileName",
01807             50934,
01808             TIFF_ASCII // or BYTE,
01809             // Count:
01810             // Length of string including null
01811             // Value:
01812             // Null terminated string
01813             // Default:
01814             // Optional
01815             // Usage:
01816             // IFD 0
01817             // Description:
01818             // A UTF-8 encoded string containing the name of the "as shot"
01819             // camera profile, if any.
01820         },{
01821             "NoiseReductionApplied",
01822             50935,
01823             TIFF_RATIONAL,
01824             // Count:
01825             // 1
01826             // Value:
01827             // See below
01828             // Default:
01829             // 0/0
01830             // Usage:
01831             // Raw IFD
01832             // Description:
01833             // This tag indicates how much noise reduction has been
01834             // applied to the raw data on a scale of 0.0 to 1.0. A 0.0
01835             // value indicates that no noise reduction has been applied. A
01836             // 1.0 value indicates that the "ideal" amount of noise
01837             // reduction has been applied, i.e. that the DNG reader should
01838             // not apply additional noise reduction by default. A value of
01839             // 0/0 indicates that this parameter is unknown.
01840         },{
01841             "ProfileName",
01842             50936,
01843             TIFF_ASCII // or BYTE,
01844             // Count:
01845             // Length of string including null
01846             // Value:
01847             // Null terminated string
01848             // Default:
01849             // None
01850             // Usage:
01851             // IFD 0 or Camera Profile IFD
01852             // Description:
01853             // A UTF-8 encoded string containing the name of the camera
01854             // profile. This tag is optional if there is only a single
01855             // camera profile stored in the file but is required for all
01856             // camera profiles if there is more than one camera profile
01857             // stored in the file.
01858         },{
01859             "ProfileHueSatMapDims",
01860             50937,
01861             TIFF_LONG,
01862             // Count:
01863             // 3
01864             // Value:
01865             // HueDivisions SaturationDivisions ValueDivisions
01866             // Default:
01867             // None
01868             // Usage:
01869             // IFD 0 or Camera Profile IFD
01870             // Description:
01871             // This tag specifies the number of input samples in each
01872             // dimension of the hue/saturation/value mapping tables. The
01873             // data for these tables are stored in ProfileHueSatMapData1
01874             // and ProfileHueSatMapData2 tags. Allowed values include the
01875             // following:
01876             // *HueDivisions >= 1
01877             // *SaturationDivisions >= 2
01878             // *ValueDivisions >=1
01879             // The most common case has ValueDivisions equal to 1, so only
01880             // hue and saturation are used as inputs to the mapping table.
01881         },{
01882             "ProfileHueSatMapData1",
01883             50938,
01884             TIFF_FLOAT,
01885             // Count:
01886             // HueDivisions * SaturationDivisions * ValueDivisions * 3
01887             // Value:
01888             // See below
01889             // Default:
01890             // None
01891             // Usage:
01892             // IFD 0 or Camera Profile IFD
01893             // Description:
01894             // This tag contains the data for the first
01895             // hue/saturation/value mapping table. Each entry of the table
01896             // contains three 32-bit IEEE floating-point values. The first
01897             // entry is hue shift in degrees; the second entry is
01898             // saturation scale factor; and the third entry is a value
01899             // scale factor. The table entries are stored in the tag in
01900             // nested loop order, with the value divisions in the outer
01901             // loop, the hue divisions in the middle loop, and the
01902             // saturation divisions in the inner loop. All zero input
01903             // saturation entries are required to have a value scale
01904             // factor of 1.0. The hue/saturation/value table application
01905             // is described in detail in Chapter 6.
01906         },{
01907             "ProfileHueSatMapData2",
01908             50939,
01909             TIFF_FLOAT,
01910             // Count:
01911             // HueDivisions * SaturationDivisions * ValueDivisions * 3
01912             // Value:
01913             // See below
01914             // Default:
01915             // None
01916             // Usage:
01917             // IFD 0 or Camera Profile IFD
01918             // Description:
01919             // This tag contains the data for the second
01920             // hue/saturation/value mapping table. Each entry of the table
01921             // contains three 32-bit IEEE floating-point values. The first
01922             // entry is hue shift in degrees; the second entry is a
01923             // saturation scale factor; and the third entry is a value
01924             // scale factor. The table entries are stored in the tag in
01925             // nested loop order, with the value divisions in the outer
01926             // loop, the hue divisions in the middle loop, and the
01927             // saturation divisions in the inner loop. All zero input
01928             // saturation entries are required to have a value scale
01929             // factor of 1.0. The hue/saturation/value table application
01930             // is described in detail in Chapter 6.
01931         },{
01932             "ProfileToneCurve",
01933             50940,
01934             TIFF_FLOAT,
01935             // Count:
01936             // Samples * 2
01937             // Value:
01938             // See below
01939             // Default:
01940             // None
01941             // Usage:
01942             // IFD 0 or Camera Profile IFD
01943             // Description:
01944             // This tag contains a default tone curve that can be applied
01945             // while processing the image as a starting point for user
01946             // adjustments. The curve is specified as a list of 32-bit
01947             // IEEE floating-point value pairs in linear gamma. Each
01948             // sample has an input value in the range of 0.0 to 1.0, and
01949             // an output value in the range of 0.0 to 1.0. The first
01950             // sample is required to be (0.0, 0.0), and the last sample is
01951             // required to be (1.0, 1.0). Interpolated the curve using a
01952             // cubic spline.
01953         },{
01954             "ProfileEmbedPolicy",
01955             50941,
01956             TIFF_LONG,
01957             // Count:
01958             // 1
01959             // Value:
01960             // See below
01961             // Default:
01962             // 0
01963             // Usage:
01964             // IFD 0 or Camera Profile IFD
01965             // Description:
01966             // This tag contains information about the usage rules for the
01967             // associated camera profile. The valid values and meanings
01968             // are:
01969             // *0 = “allow copying”. The camera profile can be used to
01970             // *process, or be embedded in, any DNG file. It can be copied
01971             // *from DNG files to other DNG files, or copied from DNG
01972             // *files and stored on the user’s system for use in
01973             // *processing or embedding in any DNG file. The camera
01974             // *profile may not be used to process non-DNG files.
01975             // *1 = “embed if used”. This value applies the same rules as
01976             // *“allow copying”, except it does not allow copying the
01977             // *camera profile from a DNG file for use in processing any
01978             // *image other than the image in which it is embedded, unless
01979             // *the profile is already stored on the user’s system.
01980             // *2 = “embed never”. This value only applies to profiles
01981             // *stored on a user’s system but not already embedded in DNG
01982             // *files. These stored profiles can be used to process images
01983             // *but cannot be embedded in files. If a camera profile is
01984             // *already embedded in a DNG file, then this value has the
01985             // *same restrictions as “embed if used”.
01986             // *3 = “no restrictions”. The camera profile creator has not
01987             // *placed any restrictions on the use of the camera profile.
01988         },{
01989             "ProfileCopyright",
01990             50942,
01991             TIFF_ASCII // or BYTE,
01992             // Count:
01993             // Length of string including null
01994             // Value:
01995             // Null terminated string
01996             // Default:
01997             // Optional
01998             // Usage:
01999             // IFD 0 or Camera Profile IFD
02000             // Description:
02001             // A UTF-8 encoded string containing the copyright information
02002             // for the camera profile. This string always should be
02003             // preserved along with the other camera profile tags.
02004         },{
02005             "ForwardMatrix1",
02006             50964,
02007             TIFF_SRATIONAL,
02008             // Count:
02009             // 3 * ColorPlanes
02010             // Value:
02011             // See below
02012             // Default:
02013             // Optional
02014             // Usage:
02015             // IFD 0 or Camera Profile IFD
02016             // Description:
02017             // This tag defines a matrix that maps white balanced camera
02018             // colors to XYZ D50 colors. Application is described in
02019             // detail in Chapter 6.
02020         },{
02021             "ForwardMatrix2",
02022             50965,
02023             TIFF_SRATIONAL,
02024             // Count:
02025             // 3 * ColorPlanes
02026             // Value:
02027             // See below
02028             // Default:
02029             // Optional
02030             // Usage:
02031             // IFD 0 or Camera Profile IFD
02032             // Description:
02033             // This tag defines a matrix that maps white balanced camera
02034             // colors to XYZ D50 colors. Application is described in
02035             // detail in Chapter 6.
02036         },{
02037             "PreviewApplicationName",
02038             50966,
02039             TIFF_ASCII // or BYTE,
02040             // Count:
02041             // Length of string including null
02042             // Value:
02043             // Null terminated string
02044             // Default:
02045             // Optional
02046             // Usage:
02047             // Preview IFD
02048             // Description:
02049             // A UTF-8 encoded string containing the name of the
02050             // application that created the preview stored in the IFD.
02051         },{
02052             "PreviewApplicationVersion",
02053             50967,
02054             TIFF_ASCII // or BYTE,
02055             // Count:
02056             // Length of string including null
02057             // Value:
02058             // Null terminated string
02059             // Default:
02060             // Optional
02061             // Usage:
02062             // Preview IFD
02063             // Description:
02064             // A UTF-8 encoded string containing the version number of the application that created the preview stored in the IFD.
02065         },{
02066             "PreviewSettingsName",
02067             50968,
02068             TIFF_ASCII // or BYTE,
02069             // Count:
02070             // Length of string including null
02071             // Value:
02072             // Null terminated string
02073             // Default:
02074             // Optional
02075             // Usage:
02076             // Preview IFD
02077             // Description:
02078             // A UTF-8 encoded string containing the name of the
02079             // conversion settings (for example, snapshot name) used for
02080             // the preview stored in the IFD.
02081         },{
02082             "PreviewSettingsDigest",
02083             50969,
02084             TIFF_BYTE,
02085             // Count:
02086             // 16
02087             // Value:
02088             // See below
02089             // Default:
02090             // Optional
02091             // Usage:
02092             // Preview IFD
02093             // Description:
02094             // A unique ID of the conversion settings (for example, MD5 digest) used to render the preview stored in the IFD.
02095         },{
02096             "PreviewColorSpace",
02097             50970,
02098             TIFF_LONG,
02099             // Count:
02100             // 1
02101             // Value:
02102             // See below
02103             // Default:
02104             // See below
02105             // Usage:
02106             // Preview IFD
02107             // Description:
02108             // This tag specifies the color space in which the rendered preview in this IFD is stored. The valid values include:
02109             // *0 = Unknown
02110             // *1 = Gray Gamma 2.2
02111             // *2 = sRGB
02112             // *3 = Adobe RGB
02113             // *4 = ProPhoto RGB
02114             // The default value for this tag is sRGB for color previews and Gray Gamma 2.2 for monochrome previews.
02115         },{
02116             "PreviewDateTime",
02117             50971,
02118             TIFF_ASCII,
02119             // Count:
02120             // Length of string including null
02121             // Value:
02122             // Null terminated string
02123             // Default:
02124             // Optional
02125             // Usage:
02126             // Preview IFD
02127             // Description:
02128             // This tag is an ASCII string containing the name of the
02129             // date/time at which the preview stored in the IFD was
02130             // rendered. The date/time is encoded using ISO 8601 format.
02131         },{
02132             "RawImageDigest",
02133             50972,
02134             TIFF_BYTE,
02135             // Count:
02136             // 16
02137             // Value:
02138             // See below
02139             // Default:
02140             // Optional
02141             // Usage:
02142             // IFD 0
02143             // Description:
02144             // This tag is an MD5 digest of the raw image data. All pixels
02145             // in the image are processed in row-scan order. Each pixel is
02146             // zero padded to 16 or 32 bits deep (16-bit for data less
02147             // than or equal to 16 bits deep, 32-bit otherwise). The data
02148             // for each pixel is processed in little-endian byte order.
02149         },{
02150             "OriginalRawFileDigest",
02151             50973,
02152             TIFF_BYTE,
02153             // Count:
02154             // 16
02155             // Value:
02156             // See below
02157             // Default:
02158             // Optional
02159             // Usage:
02160             // IFD 0
02161             // Description:
02162             // This tag is an MD5 digest of the data stored in the OriginalRawFileData tag.
02163         },{
02164             "SubTileBlockSize",
02165             50974,
02166             TIFF_SHORT // or LONG,
02167             // Count:
02168             // 2
02169             // Value:
02170             // SubTileBlockRows SubTileBlockCols
02171             // Default:
02172             // 1, 1
02173             // Usage:
02174             // Raw IFD
02175             // Description:
02176             // Normally, the pixels within a tile are stored in simple
02177             // row-scan order. This tag specifies that the pixels within a
02178             // tile should be grouped first into rectangular blocks of the
02179             // specified size. These blocks are stored in row-scan
02180             // order. Within each block, the pixels are stored in row-scan
02181             // order. The use of a non-default value for this tag requires
02182             // setting the DNGBackwardVersion tag to at least 1.2.0.0.
02183         },{
02184             "RowInterleaveFactor",
02185             50975,
02186             TIFF_SHORT // or LONG,
02187             // Count:
02188             // 1
02189             // Value:
02190             // RowInterleaveFactor
02191             // Default:
02192             // 1
02193             // Usage:
02194             // Raw IFD
02195             // Description:
02196             // This tag specifies that rows of the image are stored in
02197             // interleaved order. The value of the tag specifies the
02198             // number of interleaved fields. The use of a non-default
02199             // value for this tag requires setting the DNGBackwardVersion
02200             // tag to at least 1.2.0.0.
02201         },{
02202             "ProfileLookTableDims",
02203             50981,
02204             TIFF_LONG,
02205             // Count:
02206             // 3
02207             // Value:
02208             // HueDivisions SaturationDivisions ValueDivisions
02209             // Default:
02210             // none
02211             // Usage:
02212             // IFD 0 or Camera Profile IFD
02213             // Description:
02214             // This tag specifies the number of input samples in each
02215             // dimension of a default "look" table. The data for this
02216             // table is stored in the ProfileLookTableData tag. Allowed
02217             // values include:
02218             // HueDivisions >= 1
02219             // SaturationDivisions >= 2
02220             // Value:Divisions >= 1
02221         },{
02222             "ProfileLookTableData",
02223             50982,
02224             TIFF_FLOAT,
02225             // Count:
02226             // HueDivisions * SaturationDivisions * ValueDivisions * 3
02227             // Value:
02228             // See below
02229             // Default:
02230             // none
02231             // Usage:
02232             // IFD 0 or Camera Profile IFD
02233             // Description:
02234             // This tag contains a default "look" table that can be
02235             // applied while processing the image as a starting point for
02236             // user adjustment. This table uses the same format as the
02237             // tables stored in the ProfileHueSatMapData1 and
02238             // ProfileHueSatMapData2 tags, and is applied in the same
02239             // color space. However, it should be applied later in the
02240             // processing pipe, after any exposure compensation and/or
02241             // fill light stages, but before any tone curve stage.  Each
02242             // entry of the table contains three 32-bit IEEE
02243             // floating-point values. The first entry is hue shift in
02244             // degrees, the second entry is a saturation scale factor, and
02245             // the third entry is a value scale factor.  The table entries
02246             // are stored in the tag in nested loop order, with the value
02247             // divisions in the outer loop, the hue divisions in the
02248             // middle loop, and the saturation divisions in the inner
02249             // loop.  All zero input saturation entries are required to
02250             // have a value scale factor of 1.0.
02251         },{
02252             "OpcodeList1",
02253             51008,
02254             TIFF_UNDEFINED,
02255             // Count:
02256             // Variable
02257             // Value:
02258             // Opcode List
02259             // Default:
02260             // Empty List
02261             // Usage:
02262             // Raw IFD
02263             // Description:
02264             // Specifies the list of opcodes that should be applied to the
02265             // raw image, as read directly from the file. The format and
02266             // processing details of an opcode list are described in
02267             // Chapter 7, "Opcode List Processing".
02268         },{
02269             "OpcodeList2",
02270             51009,
02271             TIFF_UNDEFINED,
02272             // Count:
02273             // Variable
02274             // Value:
02275             // Opcode List
02276             // Default:
02277             // Empty List
02278             // Usage:
02279             // Raw IFD
02280             // Description:
02281             // Specifies the list of opcodes that should be applied to the
02282             // raw image, just after it has been mapped to linear
02283             // reference values. The format and processing details of an
02284             // opcode list are described in Chapter 7, "Opcode List
02285             // Processing".
02286         },{
02287             "OpcodeList3",
02288             51022,
02289             TIFF_UNDEFINED,
02290             // Count:
02291             // Variable
02292             // Value:
02293             // Opcode List
02294             // Default:
02295             // Empty List
02296             // Usage:
02297             // Raw IFD
02298             // Description:
02299             // Specifies the list of opcodes that should be applied to the
02300             // raw image, just after it has been demosaiced. The format
02301             // and processing details of an opcode list are described in
02302             // Chapter 7, "Opcode List Processing".
02303         },{
02304             "NoiseProfile",
02305             51041,
02306             TIFF_DOUBLE,
02307             // Count:
02308             // 2 or 2 * ColorPlanes
02309             // Value:
02310             // See Below
02311             // Default:
02312             // Value:s are estimated from BaselineNoise tag (see below).
02313             // Usage:
02314             // Raw IFD
02315             // Description:
02316             // NoiseProfile describes the amount of noise in a raw
02317             // image. Specifically, this tag models the amount of
02318             // signal-dependent photon (shot) noise and signal-independent
02319             // sensor readout noise, two common sources of noise in raw
02320             // images. The model assumes that the noise is white and
02321             // spatially independent, ignoring fixed pattern effects and
02322             // other sources of noise (e.g., pixel response
02323             // non-uniformity, spatially-dependent thermal effects, etc.).
02324             // This tag is intended to be used to describe the amount of
02325             // noise present in unprocessed raw image data. When noise
02326             // reduction has already been applied to the raw data (i.e.,
02327             // NoiseReductionApplied0), this tag may be used to estimate
02328             // the white component of the residual noise.  For the
02329             // purposes of this tag, noise is defined as the standard
02330             // deviation of a random variable x, where xrepresents a
02331             // recorded linear signal in the range x01[,]. The
02332             // two-parameter noise model isNixSixOi+= for parameters
02333             // (SiOi), where Siis a scale term that models the amount of
02334             // sensor amplification, and Oiis an offset term that models
02335             // the amount of sensor readout noise. A more detailed
02336             // explanation of this model is given below.  The data
02337             // elements for this tag are the nsets of noise model
02338             // parameters:S1O1S2O2SnO Note that n must be 1 (i.e.,
02339             // tag count is 2) or equal to the number of color planes in
02340             // the image (i.e., tag count is 2ColorPlanes). When n1=, the
02341             // two specified parameters (S1O1) define the same noise
02342             // model for all image planes. Whenn is equal to the number of
02343             // image planes, the parameters (SiOi) define the noise model
02344             // for the ith image plane, e.g., (S1O1) correspond to the
02345             // first image plane, (S2O2) correspond to the second image
02346             // plane, etc. The order of the parameters follows the plane
02347             // order specified by the CFAPlaneColor tag.  EachSi term must
02348             // be positive (Si0), and eachOi term must be non-negative
02349             // (Oi0).  A BaselineNoise tag value of 1.0 at ISO 100
02350             // corresponds approximately to NoiseProfile parameter values
02351             // of Si2105–=and Oi4.5107–=(e.g., standard deviation of
02352             // 0.00201 when x0.18=); these values may be used to estimate
02353             // absolute noise levels in an image when the NoiseProfile tag
02354             // is missing. When both tags are present, however, DNG
02355             // readers should prefer using the NoiseProfile data, since it
02356             // describes noise levels more precisely than BaselineNoise.
02357             // A more detailed description of the noise model is given
02358             // below. This tag models two common sources of noise:
02359             // 1.Photon (shot) noise p, which has a white Poisson
02360             // distribution, and 2.Electronic readout noise r, which is
02361             // present even in the absence of light and is assumed to have
02362             // an approximately white normal (Gaussian) distribution.
02363             // Assuming thatp andr are independent random variables, the
02364             // square of the total noise (i.e., the variance) can be
02365             // expressed as the sum of the squares of the individual
02366             // sources of noise:N2p2r2+=1 In this expression, the
02367             // variables N, p, andr are expressed in B-bit recorded
02368             // digital values, where common values ofB include 12, 14, and
02369             // 16 bits. Ifxˆ is the average signal level expressed in
02370             // photons, then its variance will also be xˆ, since a random
02371             // variable with a Poisson distribution has a variance equal
02372             // to its mean:pˆ2xˆ=2 wherepˆ denotes the photon noise,
02373             // expressed in photons. The conversion factor between photons
02374             // (xˆpˆ) and B-bit digital values (xp) is the gain factor
02375             // g:xgxˆ=3pgpˆ=4 Substituting equations 2, 3, and 4
02376             // into equation 1 yields:N2gpˆ2r2+=g2xˆr2+=gxr2+=
02377             // Therefore the total noiseN can be expressed as a
02378             // two-parameter function of the signal x:Nxgxr2+=SisOi+=
02379             // for model parameters SigOir2==.  This tag uses the
02380             // convention of a normalized noise model, i.e.,Nx() is the
02381             // standard deviation (i.e., noise) of a random variable x,
02382             // where x represents a recorded linear signal in the range
02383             // x01[,]. The specified parameters (SiOi) must also be
02384             // appropriately normalized.
02385         },
02387         {
02388             "ExifVersion",
02389             // The version of this standard supported. Nonexistence of this field is taken to mean nonconformance to the standard
02390             // (see section 4.2). Conformance to this standard is indicated by recording "0220" as 4-byte ASCII. Since the type is
02391             // UNDEFINED, there is no NULL for termination.
02392             36864,
02393             TIFF_UNDEFINED
02394             // Count = 4
02395             // Default = "0220"
02396         },{
02397             "FlashpixVersion",
02398             // The Flashpix format version supported by a FPXR file. If the FPXR function supports Flashpix format Ver. 1.0, this
02399             // is indicated similarly to ExifVersion by recording "0100" as 4-byte ASCII. Since the type is UNDEFINED, there is no
02400             // NULL for termination.
02401             40960,
02402             TIFF_UNDEFINED
02403             // Count = 4
02404             // Default = "0100"
02405             // 0100 = Flashpix Format Version 1.0
02406             // Other = reserved
02407         },{
02408             "ColorSpace",
02409             // The color space information tag (ColorSpace) is always recorded as the color space specifier.
02410             // Normally sRGB (=1) is used to define the color space based on the PC monitor conditions and environment. If a
02411             // color space other than sRGB is used, Uncalibrated (=FFFF.H) is set. Image data recorded as Uncalibrated can be
02412             // treated as sRGB when it is converted to Flashpix. On sRGB see Annex E.
02413             40961,
02414             TIFF_SHORT
02415             // Count = 1
02416             // 1 = sRGB
02417             // FFFF.H = Uncalibrated
02418             // Other = reserved
02419         },{
02420             "PixelXDimension",
02421             // Information specific to compressed data. When a compressed file is recorded, the valid width of the meaningful
02422             // image shall be recorded in this tag, whether or not there is padding data or a restart marker. This tag should not
02423             // exist in an uncompressed file. For details see section 2.8.1 and Annex F.
02424             40962,
02425             TIFF_LONG // or SHORT
02426             // Count = 1
02427             // Default = none
02428         },{
02429             "PixelYDimension",
02430             // Information specific to compressed data. When a compressed file is recorded, the valid height of the meaningful
02431             // image shall be recorded in this tag, whether or not there is padding data or a restart marker. This tag should not
02432             // exist in an uncompressed file. For details see section 2.8.1 and Annex F. Since data padding is unnecessary in the
02433             // vertical direction, the number of lines recorded in this valid image height tag will in fact be the same as that
02434             // recorded in the SOF.
02435             40963,
02436             TIFF_LONG // or SHORT
02437             // Count = 1
02438         },{
02439             "ComponentsConfiguration",
02440             // Information specific to compressed data. The channels of each component are arranged in order from the 1st
02441             // component to the 4th. For uncompressed data the data arrangement is given in the PhotometricInterpretation tag.
02442             // However, since PhotometricInterpretation can only express the order of Y,Cb and Cr, this tag is provided for cases
02443             // when compressed data uses components other than Y, Cb, and Cr and to enable support of other sequences.
02444             37121,
02445             TIFF_UNDEFINED
02446             // Count = 4
02447             // Default = 4 5 6 0 (if RGB uncompressed)
02448             // 1 2 3 0 (other cases)
02449             // 0 = does not exist
02450             // 1 = Y
02451             // 2 = Cb
02452             // 3 = Cr
02453             // 4 = R
02454             // 5 = G
02455             // 6 = B
02456             // Other = reserved
02457         },{
02458             "CompressedBitsPerPixel",
02459             // Information specific to compressed data. The compression mode used for a compressed image is indicated in unit
02460             // bits per pixel.
02461             37122,
02462             TIFF_RATIONAL
02463             // Count = 1
02464             // Default = none
02465         },{
02466             "MakerNote",
02467             // A tag for manufacturers of Exif writers to record any desired information. The contents are up to the manufacturer,
02468             // but this tag should not be used for any other than its intended purpose.
02469             37500,
02470             TIFF_UNDEFINED
02471             // Count = Any
02472             // Default = none
02473         },{
02474             "UserComment",
02475             // A tag for Exif users to write keywords or comments on the image besides those in ImageDescription, and without
02476             // the character code limitations of the ImageDescription tag.
02477             37510,
02478             TIFF_UNDEFINED
02479             // Count = Any
02480             // Default = none
02481             // The character code used in the UserComment tag is identified based on an ID code in a fixed 8-byte area at the
02482             // start of the tag data area. The unused portion of the area is padded with NULL ("00.H"). ID codes are assigned by
02483             // means of registration. The designation method and references for each character code are given in Table 6 . The
02484             // value of Count N is determined based on the 8 bytes in the character code area and the number of bytes in the
02485             // user comment part. Since the TYPE is not ASCII, NULL termination is not necessary (see Figure 9).
02486             // Table 6 Character Codes and their Designation
02487             // Character Code    Code Designation (8 Bytes)                      References
02488             // ASCII             41.H, 53.H, 43.H, 49.H, 49.H, 00.H, 00.H, 00.H  ITU-T T.50 IA5
02489             // JIS               4A.H, 49.H, 53.H, 00.H, 00.H, 00.H, 00.H, 00.H  JIS X208-1990
02490             // Unicode           55.H, 4E.H, 49.H, 43.H, 4F.H, 44.H, 45.H, 00.H  Unicode Standard
02491             // Undefined         00.H, 00.H, 00.H, 00.H, 00.H, 00.H, 00.H, 00.H  Undefined
02492         },{
02493             "DateTimeOriginal",
02494             // The date and time when the original image data was generated. For a DSC the date and time the picture was taken
02495             // are recorded. The format is "YYYY:MM:DD HH:MM:SS" with time shown in 24-hour format, and the date and time
02496             // separated by one blank character [20.H]. When the date and time are unknown, all the character spaces except
02497             // colons (":") may be filled with blank characters, or else the Interoperability field may be filled with blank characters.
02498             // The character string length is 20 bytes including NULL for termination. When the field is left blank, it is treated as
02499             // unknown.
02500             36867,
02501             TIFF_ASCII
02502             // Count = 20
02503             // Default = none
02504         },{
02505             "DateTimeDigitized",
02506             // The date and time when the image was stored as digital data. If, for example, an image was captured by DSC and at the same
02507             // time the file was recorded, then the DateTimeOriginal and DateTimeDigitized will have the same contents. The format is
02508             // "YYYY:MM:DD HH:MM:SS" with time shown in 24-hour format, and the date and time separated by one blank character [20.H].
02509             // When the date and time are unknown, all the character spaces except colons (":") may be filled with blank characters, or else
02510             // the Interoperability field may be filled with blank characters. The character string length is 20 bytes including NULL for
02511             // termination. When the field is left blank, it is treated as unknown.
02512             36868,
02513             TIFF_ASCII
02514             // Count = 20
02515             // Default = none
02516         },{
02517             "SubsecTime",
02518             // A tag used to record fractions of seconds for the DateTime tag.
02519             37520,
02520             TIFF_ASCII
02521             // Count = Any
02522             // Default = none
02523         },{
02524             "SubsecTimeOriginal",
02525             // A tag used to record fractions of seconds for the DateTimeOriginal tag.
02526             37521,
02527             TIFF_ASCII
02528             // N = Any
02529             // Default = none
02530         },{
02531             "SubsecTimeDigitized",
02532             // A tag used to record fractions of seconds for the DateTimeDigitized tag.
02533             37522,
02534             TIFF_ASCII
02535             // N = Any
02536             // Default = none
02537             // Note-Recording subsecond data (SubsecTime, SubsecTimeOriginal, SubsecTimeDigitized)
02538             // The tag type is ASCII and the string length including NULL is variable length. When the number of valid
02539             // digits is up to the second decimal place, the subsecond value goes in the Value position. When it is up to
02540             // four decimal places, an address value is Interoperability, with the subsecond value put in the location
02541             // pointed to by that address. (Since the count of ASCII type field Interoperability is a value that includes
02542             // NULL, when the number of valid digits is up to four decimal places the count is 5, and the offset value goes
02543             // in the Value Offset field. See section 2.6.2.) Note that the subsecond tag differs from the DateTime tag and
02544             // other such tags already defined in TIFF Rev. 6.0, and that both are recorded in the Exif IFD.
02545             // Ex.: September 9, 1998, 9:15:30.130 (the number of valid digits is up to the third decimal place)
02546             // DateTime 1996:09:01 09:15:30 [NULL]
02547             // SubSecTime 130 [NULL]
02548             // If the string length is longer than the number of valid digits, the digits are aligned with the start of the area
02549             // and the rest is filled with blank characters [20.H]. If the subsecond data is unknown, the Interoperability
02550             // area can be filled with blank characters.
02551             // Examples when subsecond data is 0.130 seconds:
02552             // Ex. 1) '1','3','0',[NULL]
02553             // Ex. 2) '1','3','0',[20.H],[NULL]
02554             // Ex. 3) '1','3','0', [20.H], [20.H], [20.H], [20.H], [20.H], [NULL]
02555             // Example when subsecond data is unknown:
02556             // Ex. 4) [20.H], [20.H], [20.H], [20.H], [20.H], [20.H], [20.H], [20.H], [NULL]
02557         },{
02558             "ExposureTime",
02559             // Exposure time, given in seconds (sec).
02560             33434,
02561             TIFF_RATIONAL
02562             // Count = 1
02563             // Default = none
02564         },{
02565             "FNumber",
02566             // The F number.
02567             33437,
02568             TIFF_RATIONAL
02569             // Count = 1
02570             // Default = none
02571         },{
02572             "ExposureProgram",
02573             // The class of the program used by the camera to set exposure when the picture is taken. The tag values are as
02574             // follows.
02575             34850,
02576             TIFF_SHORT
02577             // Count = 1
02578             // Default = 0
02579             // 0 = Not defined
02580             // 1 = Manual
02581             // 2 = Normal program
02582             // 3 = Aperture priority
02583             // 4 = Shutter priority
02584             // 5 = Creative program (biased toward depth of field)
02585             // 6 = Action program (biased toward fast shutter speed)
02586             // 7 = Portrait mode (for closeup photos with the background out of focus)
02587             // 8 = Landscape mode (for landscape photos with the background in focus)
02588             // Other = reserved
02589         },{
02590             "SpectralSensitivity",
02591             // Indicates the spectral sensitivity of each channel of the camera used. The tag value is an ASCII string compatible
02592             // with the standard developed by the ASTM Technical committee.
02593             34852,
02594             TIFF_ASCII
02595             // Count = Any
02596             // Default = none
02597         },{
02598             "ISOSpeedRatings",
02599             // Indicates the ISO Speed and ISO Latitude of the camera or input device as specified in ISO 12232.
02600             34855,
02601             TIFF_SHORT
02602             // Count = Any
02603             // Default = none
02604         },{
02605             "OECF",
02606             // Indicates the Opto-Electric Conversion Function (OECF) specified in ISO 14524. OECF is the relationship between
02607             // the camera optical input and the image values.
02608             34856,
02609             TIFF_UNDEFINED
02610             // Count = ANY
02611             // Default = none
02612             // When this tag records an OECF of m rows and n columns, the values are as in Figure 10.
02613             // Length Type Meaning
02614             // 2 SHORT Columns = n
02615             // 2 SHORT Rows = m
02616             // Any ASCII 0th column item name (NULL terminated)
02617             // : : :
02618             // Any ASCII n-1th column item name (NULL terminated)
02619             // 8 SRATIONAL OECF value [0,0]
02620             // : : :
02621             // 8 SRATIONAL OECF value [n-1,0]
02622             // 8 SRATIONAL OECF value [0,m-1]
02623             // : : :
02624             // 8 SRATIONAL OECF value [n-1,m-1]
02625             // Figure 10 OECF Description
02626             // Table 9 gives a simple example.
02627             // Table 9 Example of Exposure and RGB Output Level
02628             // Camera log Aperture R Output Level G Output Level B Output Level
02629             // -3.0 10.2 12.4 8.9
02630             // -2.0 48.1 47.5 48.3
02631             // -1.0 150.2 152.0 149.8
02632         },{
02633             "ShutterSpeedValue",
02634             // Shutter speed. The unit is the APEX (Additive System of Photographic Exposure) setting (see Annex C).
02635             37377,
02636             TIFF_SRATIONAL
02637             // Count = 1
02638             // Default = none
02639         },{
02640             "ApertureValue",
02641             // The lens aperture. The unit is the APEX value.
02642             37378,
02643             TIFF_RATIONAL
02644             // Count = 1
02645             // Default = none
02646         },{
02647             "BrightnessValue",
02648             // The value of brightness. The unit is the APEX value. Ordinarily it is given in the range of -99.99 to 99.99. Note that
02649             // if the numerator of the recorded value is FFFFFFFF.H, Unknown shall be indicated.
02650             37379,
02651             TIFF_SRATIONAL
02652             // Count = 1
02653             // Default = none
02654         },{
02655             "ExposureBiasValue",
02656             // The exposure bias. The unit is the APEX value. Ordinarily it is given in the range of –99.99 to 99.99.
02657             37380,
02658             TIFF_SRATIONAL
02659             // Count = 1
02660             // Default = none
02661         },{
02662             "MaxApertureValue",
02663             // The smallest F number of the lens. The unit is the APEX value. Ordinarily it is given in the range of 00.00 to 99.99,
02664             // but it is not limited to this range.
02665             37381,
02666             TIFF_RATIONAL
02667             // Count = 1
02668             // Default = none
02669         },{
02670             "SubjectDistance",
02671             // The distance to the subject, given in meters. Note that if the numerator of the recorded value is FFFFFFFF.H,
02672             // Infinity shall be indicated; and if the numerator is 0, Distance unknown shall be indicated.
02673             37382,
02674             TIFF_RATIONAL
02675             // Count = 1
02676             // Default = none
02677         },{
02678             "MeteringMode",
02679             // The metering mode.
02680             37383,
02681             TIFF_SHORT
02682             // Count = 1
02683             // Default = 0
02684             // 0 = unknown
02685             // 1 = Average
02686             // 2 = CenterWeightedAverage
02687             // 3 = Spot
02688             // 4 = MultiSpot
02689             // 5 = Pattern
02690             // 6 = Partial
02691             // Other = reserved
02692             // 255 = other
02693         },{
02694             "LightSource",
02695             // The kind of light source.
02696             37384,
02697             TIFF_SHORT
02698             // Count = 1
02699             // Default = 0
02700             // 0 = unknown
02701             // 1 = Daylight
02702             // 2 = Fluorescent
02703             // 3 = Tungsten (incandescent light)
02704             // 4 = Flash
02705             // 9 = Fine weather
02706             // 10 = Cloudy weather
02707             // 11 = Shade
02708             // 12 = Daylight fluorescent (D 5700 – 7100K)
02709             // 13 = Day white fluorescent (N 4600 – 5400K)
02710             // 14 = Cool white fluorescent (W 3900 – 4500K)
02711             // 15 = White fluorescent (WW 3200 – 3700K)
02712             // 17 = Standard light A
02713             // 18 = Standard light B
02714             // 19 = Standard light C
02715             // 20 = D55
02716             // 21 = D65
02717             // 22 = D75
02718             // 23 = D50
02719             // 24 = ISO studio tungsten
02720             // 255 = other light source
02721             // Other = reserved
02722         },{
02723             "Flash",
02724             // This tag indicates the status of flash when the image was shot. Bit 0 indicates the flash firing status, bits 1 and 2
02725             // indicate the flash return status, bits 3 and 4 indicate the flash mode, bit 5 indicates whether the flash function is
02726             // present, and bit 6 indicates "red eye" mode (see Figure 11).
02727             37385,
02728             TIFF_SHORT
02729             // Count = 1
02730             // Values for bit 0 indicating whether the flash fired.
02731             // 0b = Flash did not fire.
02732             // 1b = Flash fired.
02733             // Values for bits 1 and 2 indicating the status of returned light.
02734             // 00b = No strobe return detection function
02735             // 01b = reserved
02736             // 10b = Strobe return light not detected.
02737             // 11b = Strobe return light detected.
02738             // Values for bits 3 and 4 indicating the camera's flash mode.
02739             // 00b = unknown
02740             // 01b = Compulsory flash firing
02741             // 10b = Compulsory flash suppression
02742             // 11b = Auto mode
02743             // Values for bit 5 indicating the presence of a flash function.
02744             // 0b = Flash function present
02745             // 1b = No flash function
02746             // Values for bit 6 indicating the camera's red-eye mode.
02747             // 0b = No red-eye reduction mode or unknown
02748             // 1b = Red-eye reduction supported
02749         },{
02750             "SubjectArea",
02751             // This tag indicates the location and area of the main subject in the overall scene.
02752             37396,
02753             TIFF_SHORT
02754             // Count = 2 or 3 or 4
02755             // Default = none
02756             // The subject location and area are defined by Count values as follows.
02757             // Count = 2 Indicates the location of the main subject as coordinates. The first value is the X coordinate and the
02758             // second is the Y coordinate.
02759             // Count = 3 The area of the main subject is given as a circle. The circular area is expressed as center coordinates
02760             // and diameter. The first value is the center X coordinate, the second is the center Y coordinate, and the
02761             // third is the diameter. (See Figure 12.)
02762             // Count = 4 The area of the main subject is given as a rectangle. The rectangular area is expressed as center
02763             // coordinates and area dimensions. The first value is the center X coordinate, the second is the center Y
02764             // coordinate, the third is the width of the area, and the fourth is the height of the area. (See Figure 13.)
02765             // Note that the coordinate values, width, and height are expressed in relation to the upper left as origin, prior to
02766             // rotation processing as per the Rotation tag.
02767         },{
02768             "FocalLength",
02769             // The actual focal length of the lens, in mm. Conversion is not made to the focal length of a 35 mm film camera.
02770             37386,
02771             TIFF_RATIONAL
02772             // Count = 1
02773             // Default = none
02774         },{
02775             "FlashEnergy",
02776             // Indicates the strobe energy at the time the image is captured, as measured in Beam Candle Power Seconds
02777             // (BCPS).
02778             41483,
02779             TIFF_RATIONAL
02780             // Count = 1
02781             // Default = none
02782         },{
02783             "SpatialFrequencyResponse",
02784             // This tag records the camera or input device spatial frequency table and SFR values in the direction of image width,
02785             // image height, and diagonal direction, as specified in ISO 12233.
02786             41484,
02787             TIFF_UNDEFINED
02788             // Count = ANY
02789             // Default = none
02790             // When the spatial frequency response for m rows and n columns is recorded, the values are as shown in Figure 14.
02791             // Length Type Meaning
02792             // 2 SHORT Columns = n
02793             // 2 SHORT Rows = m
02794             // Any ASCII 0th column item name (NULL terminated)
02795             // : : :
02796             // Any ASCII n-1th column item name (NULL terminated)
02797             // 8 RATIONAL SFR value [0,0]
02798             // : : :
02799             // 8 RATIONAL SFR value [n-1,0]
02800             // 8 RATIONAL SFR value [0,m-1]
02801             // : : :
02802             // 8 RATIONAL SFR value [n-1,m-1]
02803             // Figure 14 Spatial Frequency Response Description
02804             // Table 10 gives a simple example.
02805             // Table 10 Example of Spatial Frequency Response
02806             // Spatial Frequency (lw/ph) Along Image Width Along Image Height
02807             // 0.1 1.00 1.00
02808             // 0.2 0.90 0.95
02809             // 0.3 0.80 0.85
02810         },{
02811             "FocalPlaneXResolution",
02812             // Indicates the number of pixels in the image width (X) direction per FocalPlaneResolutionUnit on the camera focal
02813             // plane.
02814             41486,
02815             TIFF_RATIONAL
02816             // Count = 1
02817             // Default = none
02818         },{
02819             "FocalPlaneYResolution",
02820             // Indicates the number of pixels in the image height (Y) direction per FocalPlaneResolutionUnit on the camera focal
02821             // plane.
02822             41487,
02823             TIFF_RATIONAL
02824             // Count = 1
02825             // Default = none
02826         },{
02827             "FocalPlaneResolutionUnit",
02828             // Indicates the unit for measuring FocalPlaneXResolution and FocalPlaneYResolution. This value is the same as the
02829             // ResolutionUnit.
02830             41488,
02831             TIFF_SHORT
02832             // Count = 1
02833             // Default = 2 (inch)
02834             // Note on use of tags concerning focal plane resolution
02835             // These tags record the actual focal plane resolutions of the main image which is written as a file after processing
02836             // instead of the pixel resolution of the image sensor in the camera. It should be noted carefully that the data from
02837             // the image sensor is resampled.
02838             // These tags are used at the same time as a FocalLength tag when the angle of field of the recorded image is to
02839             // be calculated precisely.
02840         },{
02841             "SubjectLocation",
02842             // Indicates the location of the main subject in the scene. The value of this tag represents the pixel at the center of the
02843             // main subject relative to the left edge, prior to rotation processing as per the Rotation tag. The first value indicates
02844             // the X column number and second indicates the Y row number.
02845             41492,
02846             TIFF_SHORT
02847             // Count = 2
02848             // Default = none
02849             // When a camera records the main subject location, it is recommended that the SubjectArea tag be used instead of this tag.
02850         },{
02851             "ExposureIndex",
02852             // Indicates the exposure index selected on the camera or input device at the time the image is captured.
02853             41493,
02854             TIFF_RATIONAL
02855             // Count = 1
02856             // Default = none
02857         },{
02858             "SensingMethod",
02859             // Indicates the image sensor type on the camera or input device. The values are as follows.
02860             41495,
02861             TIFF_SHORT
02862             // Count = 1
02863             // Default = none
02864             // 1 = Not defined
02865             // 2 = One-chip color area sensor
02866             // 3 = Two-chip color area sensor
02867             // 4 = Three-chip color area sensor
02868             // 5 = Color sequential area sensor
02869             // 7 = Trilinear sensor
02870             // 8 = Color sequential linear sensor
02871             // Other = reserved
02872         },{
02873             "FileSource",
02874             // Indicates the image source. If a DSC recorded the image, this tag value of this tag always be set to 3, indicating
02875             // that the image was recorded on a DSC.
02876             41728,
02877             TIFF_UNDEFINED
02878             // Count = 1
02879             // Default = 3
02880             // 3 = DSC
02881             // Other = reserved
02882         },{
02883             "SceneType",
02884             // Indicates the type of scene. If a DSC recorded the image, this tag value shall always be set to 1, indicating that the
02885             // image was directly photographed.
02886             41729,
02887             TIFF_UNDEFINED
02888             // Count = 1
02889             // Default = 1
02890             // 1 = A directly photographed image
02891             // Other = reserved
02892         },{
02893             "CFAPatternEXIF",
02894             // Indicates the color filter array (CFA) geometric pattern of the image sensor when a one-chip color area sensor is
02895             // used. It does not apply to all sensing methods.
02896             41730,
02897             TIFF_UNDEFINED
02898             // Count = ANY
02899             // Default = none
02900             // Figure 15 shows how a CFA pattern is recorded for a one-chip color area sensor when the color filter array is
02901             // repeated in m x n (vertical x lateral) pixel units.
02902             // Length Type Meaning
02903             // 2 SHORT Horizontal repeat pixel unit = n
02904             // 2 SHORT Vertical repeat pixel unit = m
02905             // 1 BYTE CFA value [0.0]
02906             // : : :
02907             // 1 BYTE CFA value [n-1.0]
02908             // 1 BYTE CFA value [0.m-1]
02909             // : : :
02910             // 1 BYTE CFA value [n-1.m-1]
02911             // Figure 15 CFA Pattern Description
02912             // The relation of color filter color to CFA value is shown in Table 11.
02913             // Table 11 Color Filter Color and CFA Value
02914             // Filter Color CFA Value
02915             // RED 00.H
02916             // GREEN 01.H
02917             // BLUE 02.H
02918             // CYAN 03.H
02919             // MAGENTA 04.H
02920             // YELLOW 05.H
02921             // WHITE 06.H
02922         },{
02923             "CustomRendered",
02924             // This tag indicates the use of special processing on image data, such as rendering geared to output. When special
02925             // processing is performed, the reader is expected to disable or minimize any further processing.
02926             41985,
02927             TIFF_SHORT
02928             // Count = 1
02929             // Default = 0
02930             // 0 = Normal process
02931             // 1 = Custom process
02932             // Other = reserved
02933         },{
02934             "ExposureMode",
02935             // This tag indicates the exposure mode set when the image was shot. In auto-bracketing mode, the camera shoots a
02936             // series of frames of the same scene at different exposure settings.
02937             41986,
02938             TIFF_SHORT
02939             // Count = 1
02940             // Default = none
02941             // 0 = Auto exposure
02942             // 1 = Manual exposure
02943             // 2 = Auto bracket
02944             // Other = reserved
02945         },{
02946             "WhiteBalance",
02947             // This tag indicates the white balance mode set when the image was shot.
02948             41987,
02949             TIFF_SHORT
02950             // Count = 1
02951             // Default = none
02952             // 0 = Auto white balance
02953             // 1 = Manual white balance
02954             // Other = reserved
02955         },{
02956             "DigitalZoomRatio",
02957             // This tag indicates the digital zoom ratio when the image was shot. If the numerator of the recorded value is 0, this
02958             // indicates that digital zoom was not used.
02959             41988,
02960             TIFF_RATIONAL
02961             // Count = 1
02962             // Default = none
02963         },{
02964             "FocalLengthIn35mmFilm",
02965             // This tag indicates the equivalent focal length assuming a 35mm film camera, in mm. A value of 0 means the focal
02966             // length is unknown. Note that this tag differs from the FocalLength tag.
02967             41989,
02968             TIFF_SHORT
02969             // Count = 1
02970             // Default = none
02971         },{
02972             "This tag indicates the type of scene that was shot. It can also be used to record the mode in which the image was",
02973             // shot. Note that this differs from the scene type (SceneType) tag.
02974             41990,
02975             TIFF_SHORT
02976             // Count = 1
02977             // Default = 0
02978             // 0 = Standard
02979             // 1 = Landscape
02980             // 2 = Portrait
02981             // 3 = Night scene
02982             // Other = reserved
02983         },{
02984             "GainControl",
02985             // This tag indicates the degree of overall image gain adjustment.
02986             41991,
02987             TIFF_SHORT
02988             // Count = 1
02989             // Default = none
02990             // 0 = None
02991             // 1 = Low gain up
02992             // 2 = High gain up
02993             // 3 = Low gain down
02994             // 4 = High gain down
02995             // Other = reserved
02996         },{
02997             "Contrast",
02998             // This tag indicates the direction of contrast processing applied by the camera when the image was shot.
02999             41992,
03000             TIFF_SHORT
03001             // Count = 1
03002             // Default = 0
03003             // 0 = Normal
03004             // 1 = Soft
03005             // 2 = Hard
03006             // Other = reserved
03007         },{
03008             "Saturation",
03009             // This tag indicates the direction of saturation processing applied by the camera when the image was shot.
03010             41993,
03011             TIFF_SHORT
03012             // Count = 1
03013             // Default = 0
03014             // 0 = Normal
03015             // 1 = Low saturation
03016             // 2 = High saturation
03017             // Other = reserved
03018         },{
03019             "Sharpness",
03020             // This tag indicates the direction of sharpness processing applied by the camera when the image was shot.
03021             41994,
03022             TIFF_SHORT
03023             // Count = 1
03024             // Default = 0
03025             // 0 = Normal
03026             // 1 = Soft
03027             // 2 = Hard
03028             // Other = reserved
03029         },{
03030             "DeviceSettingDescription",
03031             // This tag indicates information on the picture-taking conditions of a particular camera model. The tag is used only to
03032             // indicate the picture-taking conditions in the reader.
03033             41995,
03034             TIFF_UNDEFINED
03035             // Count = Any
03036             // Default = none
03037             // The information is recorded in the format shown in Figure 17. The data is recorded in Unicode using SHORT type
03038             // for the number of display rows and columns and UNDEFINED type for the camera settings. The Unicode (UCS-2)
03039             // string including Signature is NULL terminated. The specifics of the Unicode string are as given in ISO/IEC 10464-1.
03040             // Length Type Meaning
03041             // 2 SHORT Display columns
03042             // 2 SHORT Display rows
03043             // Any UNDEFINED Camera setting-1
03044             // Any UNDEFINED Camera setting-2
03045             // : : :
03046             // Any UNDEFINED Camera setting-n
03047             // Figure 17 Format used to record picture-taking conditions
03048         },{
03049             "SubjectDistanceRange",
03050             // This tag indicates the distance to the subject.
03051             41996,
03052             TIFF_SHORT
03053             // Count = 1
03054             // Default = none
03055             // 0 = unknown
03056             // 1 = Macro
03057             // 2 = Close view
03058             // 3 = Distant view
03059             // Other = reserved
03060         },{
03061             "ImageUniqueID",
03062             // This tag indicates an identifier assigned uniquely to each image. It is recorded as an ASCII string equivalent to
03063             // hexadecimal notation and 128-bit fixed length.
03064             42016,
03065             TIFF_ASCII
03066             // Count = 33
03067             // Default = none
03068         }
03069     };
03070 
03071 
03072     TiffEntryInfo const* tiffEntryLookup(uint16_t tag) {
03073         static std::map<uint16_t, TiffEntryInfo const*> entriesByTag;
03074         static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
03075         static bool initialized = false;
03076 
03077         // Build map if not yet initialized. Annoying thread-safety mutex
03078         if (!initialized) {
03079             pthread_mutex_lock(&mutex);
03080             if (!initialized) {
03081                 for (unsigned int i=0; i < sizeof(tiffEntryTypes)/sizeof(TiffEntryInfo); i++) {
03082                     entriesByTag[tiffEntryTypes[i].tag] = tiffEntryTypes+i;
03083                 }
03084                 initialized = true;
03085             }
03086             pthread_mutex_unlock(&mutex);
03087         }
03088 
03089         std::map<uint16_t, TiffEntryInfo const*>::iterator it = entriesByTag.find(tag);
03090         if (it == entriesByTag.end()) return NULL;
03091         return it->second;
03092     }
03093 
03094     // The lookup by entry name is done using basic c char arrays, to avoid having to make duplicate strings of the whole big tiffEntryTypes table.
03095 
03096     // Need to compare const char* as strings, not pointers.
03097     struct TiffNameLess {
03098         bool operator()(const char *l, const char *r) const {
03099             return strcmp(l, r) < 0;
03100         }
03101     };
03102 
03103     TiffEntryInfo const* tiffEntryLookup(const std::string &entryName) {
03104         static std::map<const char*, TiffEntryInfo const*, TiffNameLess> entriesByName;
03105         static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
03106         static bool initialized = false;
03107 
03108         // Build map if not yet initialized. Annoying thread-safety mutex
03109         if (!initialized) {
03110             pthread_mutex_lock(&mutex);
03111             if (!initialized) {
03112                 for (unsigned int i=0; i < sizeof(tiffEntryTypes)/sizeof(TiffEntryInfo); i++) {
03113                     entriesByName[tiffEntryTypes[i].name] = tiffEntryTypes+i;
03114                 }
03115                 initialized = true;
03116             }
03117             pthread_mutex_unlock(&mutex);
03118         }
03119         std::map<const char*, TiffEntryInfo const*, TiffNameLess>::iterator it = entriesByName.find(entryName.c_str());
03120         if (it == entriesByName.end()) return NULL;
03121         return it->second;
03122     }
03123 
03124 }

Generated on Thu Jul 15 2010 17:51:28 for FCam by  doxygen 1.7.1