ome-files  0.5.0
Tags.h
1 /*
2  * #%L
3  * OME-FILES C++ library for image IO.
4  * Copyright © 2006 - 2015 Open Microscopy Environment:
5  * - Massachusetts Institute of Technology
6  * - National Institutes of Health
7  * - University of Dundee
8  * - Board of Regents of the University of Wisconsin-Madison
9  * - Glencoe Software, Inc.
10  * %%
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing official
34  * policies, either expressed or implied, of any organization.
35  * #L%
36  */
37 
38 #ifndef OME_FILES_TIFF_TAGS_H
39 #define OME_FILES_TIFF_TAGS_H
40 
41 #include <array>
42 #include <cstdint>
43 #include <memory>
44 #include <string>
45 #include <vector>
46 
47 #include <ome/files/tiff/Types.h>
48 
49 namespace ome
50 {
51  namespace files
52  {
53  namespace tiff
54  {
55 
56  class TIFF;
57 
60  {
67  MAKE,
72  };
73 
76  {
78  };
79 
82  {
97  };
98 
101  {
103  };
104 
107  {
109  };
110 
113  {
115  };
116 
119  {
121  };
122 
125  {
127  };
128 
131  {
133  };
134 
137  {
139  };
140 
143  {
145  };
146 
149  {
151  };
152 
155  {
157  };
158 
161  {
166  };
167 
170  {
172  };
173 
176  {
178  };
179 
182  {
185  };
186 
189  {
204  };
205 
208  {
211  };
212 
215  {
223  };
224 
227  {
233  };
234 
237  {
242  };
243 
246  {
248  };
249 
252  {
254  };
255 
258  {
261  };
262 
263  /*
264  * Tags which are known but not currently wrapped.
265  *
266  * OSUBFILETYPE, ///< Type of data in this subfile [old tag].
267  * COLORRESPONSEUNIT, ///<
268  * SMINSAMPLEVALUE, ///<
269  * SMAXSAMPLEVALUE, ///<
270  * CLIPPATH, ///<
271  * XCLIPPATHUNITS, ///<
272  * YCLIPPATHUNITS, ///<
273  * OPIPROXY, ///<
274  * GLOBALPARAMETERSIFD, ///<
275  * PROFILETYPE, ///<
276  * FAXPROFILE, ///<
277  * CODINGMETHODS, ///<
278  * VERSIONYEAR, ///<
279  * MODENUMBER, ///<
280  * DECODE, ///<
281  * IMAGEBASECOLOR, ///<
282  * T82OPTIONS, ///<
283  * JPEGPROC, ///<
284  * JPEGIFOFFSET, ///<
285  * JPEGIFBYTECOUNT, ///<
286  * JPEGRESTARTINTERVAL, ///<
287  * JPEGLOSSLESSPREDICTORS, ///<
288  * JPEGPOINTTRANSFORM, ///<
289  * JPEGQTABLES, ///<
290  * JPEGDCTABLES, ///<
291  * JPEGACTABLES, ///<
292  * STRIPROWCOUNTS, ///<
293  * OPIIMAGEID, ///< Full pathname or identifier of original image (OPI).
294  * REFPTS, ///<
295  * REGIONTACKPOINT, ///<
296  * REGIONWARPCORNERS, ///<
297  * REGIONAFFINE, ///<
298  * PIXAR_IMAGEFULLLENGTH, ///<
299  * PIXAR_IMAGEFULLWIDTH, ///<
300  * PIXAR_TEXTUREFORMAT, ///<
301  * PIXAR_WRAPMODES, ///<
302  * PIXAR_FOVCOT, ///<
303  * PIXAR_MATRIX_WORLDTOSCREEN, ///<
304  * PIXAR_MATRIX_WORLDTOCAMERA, ///<
305  * WRITERSERIALNUMBER, ///<
306  * IT8SITE, ///<
307  * IT8COLORSEQUENCE, ///<
308  * IT8HEADER, ///<
309  * IT8RASTERPADDING, ///<
310  * IT8BITSPERRUNLENGTH, ///<
311  * IT8BITSPEREXTENDEDRUNLENGTH, ///<
312  * IT8COLORTABLE, ///<
313  * IT8IMAGECOLORINDICATOR, ///<
314  * IT8BKGCOLORINDICATOR, ///<
315  * IT8IMAGECOLORVALUE, ///<
316  * IT8BKGCOLORVALUE, ///<
317  * IT8PIXELINTENSITYRANGE, ///<
318  * IT8TRANSPARENCYINDICATOR, ///<
319  * IT8COLORCHARACTERIZATION, ///<
320  * IT8HCUSAGE, ///<
321  * IT8TRAPINDICATOR, ///<
322  * IT8CMYKEQUIVALENT, ///<
323  * FRAMECOUNT, ///<
324  * EXIFIFD, ///<
325  * IMAGELAYER, ///< Background, mask and foreground layers from RFC2301.
326  * JBIGOPTIONS, ///<
327  * GPSIFD, ///<
328  * FAXRECVPARAMS, ///<
329  * FAXSUBADDRESS, ///<
330  * FAXRECVTIME, ///<
331  * FAXDCS, ///<
332  * STONITS, ///<
333  * FEDEX_EDR, ///<
334  * INTEROPERABILITYIFD, ///<
335  * DNGVERSION, ///<
336  * DNGBACKWARDVERSION, ///<
337  * UNIQUECAMERAMODEL, ///<
338  * LOCALIZEDCAMERAMODEL, ///<
339  * CFAPLANECOLOR, ///<
340  * CFALAYOUT, ///<
341  * LINEARIZATIONTABLE, ///<
342  * BLACKLEVELREPEATDIM, ///<
343  * BLACKLEVEL, ///<
344  * BLACKLEVELDELTAH, ///<
345  * BLACKLEVELDELTAV, ///<
346  * WHITELEVEL, ///<
347  * DEFAULTSCALE, ///<
348  * DEFAULTCROPORIGIN, ///<
349  * DEFAULTCROPSIZE, ///<
350  * COLORMATRIX1, ///<
351  * COLORMATRIX2, ///<
352  * CAMERACALIBRATION1, ///<
353  * CAMERACALIBRATION2, ///<
354  * REDUCTIONMATRIX1, ///<
355  * REDUCTIONMATRIX2, ///<
356  * ANALOGBALANCE, ///<
357  * ASSHOTNEUTRAL, ///<
358  * ASSHOTWHITEXY, ///<
359  * BASELINEEXPOSURE, ///<
360  * BASELINENOISE, ///<
361  * BASELINESHARPNESS, ///<
362  * BAYERGREENSPLIT, ///<
363  * LINEARRESPONSELIMIT, ///<
364  * CAMERASERIALNUMBER, ///<
365  * LENSINFO, ///<
366  * CHROMABLURRADIUS, ///<
367  * ANTIALIASSTRENGTH, ///<
368  * SHADOWSCALE, ///<
369  * DNGPRIVATEDATA, ///<
370  * MAKERNOTESAFETY, ///<
371  * CALIBRATIONILLUMINANT1, ///<
372  * CALIBRATIONILLUMINANT2, ///<
373  * BESTQUALITYSCALE, ///<
374  * RAWDATAUNIQUEID, ///<
375  * ORIGINALRAWFILENAME, ///<
376  * ORIGINALRAWFILEDATA, ///<
377  * ACTIVEAREA, ///<
378  * MASKEDAREAS, ///<
379  * ASSHOTICCPROFILE, ///<
380  * ASSHOTPREPROFILEMATRIX, ///<
381  * CURRENTICCPROFILE, ///<
382  * CURRENTPREPROFILEMATRIX, ///<
383  * DCSHUESHIFTVALUES, ///<
384  * FAXMODE, ///<
385  * JPEGQUALITY, ///<
386  * JPEGCOLORMODE, ///<
387  * JPEGTABLESMODE, ///<
388  * FAXFILLFUNC, ///<
389  * PIXARLOGDATAFMT, ///<
390  * DCSIMAGERTYPE, ///<
391  * DCSINTERPMODE, ///<
392  * DCSBALANCEARRAY, ///<
393  * DCSCORRECTMATRIX, ///<
394  * DCSGAMMA, ///<
395  * DCSTOESHOULDERPTS, ///<
396  * DCSCALIBRATIONFD, ///<
397  * ZIPQUALITY, ///<
398  * PIXARLOGQUALITY, ///<
399  * DCSCLIPRECTANGLE, ///<
400  * SGILOGDATAFMT, ///<
401  * SGILOGENCODE, ///<
402  * LZMAPRESET, ///<
403  * PERSAMPLE ///<
404  */
405 
412  tag_type
414 
416  tag_type
418 
420  tag_type
422 
424  tag_type
426 
428  tag_type
430 
432  tag_type
434 
436  tag_type
438 
440  tag_type
442 
444  tag_type
446 
448  tag_type
450 
452  tag_type
454 
456  tag_type
458 
460  tag_type
462 
464  tag_type
466 
468  tag_type
470 
472  tag_type
474 
476  tag_type
478 
480  tag_type
482 
484  tag_type
486 
488  tag_type
490 
492  tag_type
494 
496  tag_type
498 
500  tag_type
502 
504  tag_type
506 
508  tag_type
510 
511  }
512 
513  namespace detail
514  {
518  namespace tiff
519  {
520 
525  template<typename TagCategory>
527 
529  template<>
531  {
533  typedef std::string value_type;
534  };
535 
537  template<>
539  {
541  typedef std::vector<std::string> value_type;
542  };
543 
545  template<>
547  {
549  typedef uint16_t value_type;
550  };
551 
553  template<>
555  {
557  typedef std::vector<uint16_t> value_type;
558  };
559 
561  template<>
563  {
565  typedef ::ome::files::tiff::Compression value_type;
566  };
567 
569  template<>
571  {
573  typedef ::ome::files::tiff::FillOrder value_type;
574  };
575 
577  template<>
579  {
581  typedef ::ome::files::tiff::Orientation value_type;
582  };
583 
585  template<>
587  {
589  typedef ::ome::files::tiff::PhotometricInterpretation value_type;
590  };
591 
593  template<>
595  {
597  typedef ::ome::files::tiff::PlanarConfiguration value_type;
598  };
599 
601  template<>
603  {
605  typedef ::ome::files::tiff::Predictor value_type;
606  };
607 
609  template<>
611  {
613  typedef ::ome::files::tiff::SampleFormat value_type;
614  };
615 
617  template<>
619  {
621  typedef ::ome::files::tiff::Threshholding value_type;
622  };
623 
625  template<>
627  {
629  typedef ::ome::files::tiff::YCbCrPosition value_type;
630  };
631 
633  template<>
635  {
637  typedef std::array<uint16_t, 2> value_type;
638  };
639 
641  template<>
643  {
645  typedef std::array<uint16_t, 6> value_type;
646  };
647 
649  template<>
651  {
653  typedef std::vector<::ome::files::tiff::ExtraSamples> value_type;
654  };
655 
657  template<>
659  {
661  typedef std::array<std::vector<uint16_t>, 3> value_type;
662  };
663 
665  template<>
667  {
669  typedef uint32_t value_type;
670  };
671 
673  template<>
675  {
677  typedef std::vector<uint32_t> value_type;
678  };
679 
681  template<>
683  {
685  typedef std::vector<uint64_t> value_type;
686  };
687 
689  template<>
691  {
693  typedef std::vector<uint8_t> value_type;
694  };
695 
697  template<>
699  {
701  typedef float value_type;
702  };
703 
705  template<>
707  {
709  typedef std::array<float, 2> value_type;
710  };
711 
713  template<>
715  {
717  typedef std::array<float, 3> value_type;
718  };
719 
721  template<>
723  {
725  typedef std::array<float, 6> value_type;
726  };
727 
728  }
729  }
730  }
731 }
732 
733 #endif // OME_FILES_TIFF_TAGS_H
734 
735 /*
736  * Local Variables:
737  * mode:C++
738  * End:
739  */
std::array< std::vector< uint16_t >, 3 > value_type
uint16_t array type.
Definition: Tags.h:661
Options for Group3 fax compression.
Definition: Tags.h:199
How components of each pixel are stored.
Definition: Tags.h:132
::ome::files::tiff::FillOrder value_type
uint16_t type.
Definition: Tags.h:573
Number of columns in the image (pixels per row).
Definition: Tags.h:196
Height of dithering or halftoning matrix for bilevel data.
Definition: Tags.h:85
Map a given tag category enum type to the corresponding language value type.
Definition: Tags.h:526
Minimum component value.
Definition: Tags.h:93
Name of the document from which the image originated.
Definition: Tags.h:64
Chromaticity of the white point of the image as 1931 CIE (xy).
Definition: Tags.h:247
std::vector<::ome::files::tiff::ExtraSamples > value_type
uint16_t vector type.
Definition: Tags.h:653
Private tag for ImageJ metadata byte counts.
Definition: Tags.h:209
UInt16PhotometricInterpretation1
Photometric interpretation enum fields.
Definition: Tags.h:124
RawDataTag1
Byte (Unsigned 8-bit integer) fields.
Definition: Tags.h:226
std::array< uint16_t, 6 > value_type
uint16 array type.
Definition: Tags.h:645
::ome::files::tiff::Predictor value_type
uint16_t type.
Definition: Tags.h:605
The x position of the image in RESOLUTIONUNITs.
Definition: Tags.h:240
Description of extra components.
Definition: Tags.h:177
FloatTag2
Floating point (×2) fields.
Definition: Tags.h:245
Number of the page from which the image originated.
Definition: Tags.h:164
::ome::files::tiff::Threshholding value_type
uint16_t type.
Definition: Tags.h:621
Image orientation.
Definition: Tags.h:120
StringTag1
String fields.
Definition: Tags.h:59
unsigned int tag_type
Tag number.
Definition: Types.h:68
Private tag for ImageJ metadata.
Definition: Tags.h:232
Compression scheme in use on the image data.
Definition: Tags.h:108
FloatTag3
Floating point (×3) fields.
Definition: Tags.h:251
Name of the page from which the image originated.
Definition: Tags.h:69
UInt16TagArray3
Unsigned 16-bit integer array (×3) fields.
Definition: Tags.h:181
UInt16SampleFormat1
Sample format enum fields.
Definition: Tags.h:142
Maximum number of consecutive bad scan lines encountered.
Definition: Tags.h:191
Options for Group 4 Fax compression (T6Options).
Definition: Tags.h:193
JPEG quantization and/or Huffman tables (JPEG "abbreviated table specification" datastream).
Definition: Tags.h:229
Description of the printing environment.
Definition: Tags.h:71
Component values corresponding to a 0% dot and 100% dot.
Definition: Tags.h:162
Date and time of image creation.
Definition: Tags.h:63
Byte offset of each tile.
Definition: Tags.h:222
Number of bytes in each strip (after compression).
Definition: Tags.h:219
UInt16FillOrder1
Fill order enum fields.
Definition: Tags.h:112
Mathematical operation applied before encoding.
Definition: Tags.h:138
Transfer function for the image.
Definition: Tags.h:184
std::vector< uint32_t > value_type
uint32_t vector type.
Definition: Tags.h:677
Reference black and white pairs for RGB or YCbCr images.
Definition: Tags.h:260
Type of data in this subfile [new tag].
Definition: Tags.h:198
Number of rows per strip.
Definition: Tags.h:197
std::array< uint16_t, 2 > value_type
uint16_t array type.
Definition: Tags.h:637
Scanner manufacturer.
Definition: Tags.h:67
Name and version of the software creating the image.
Definition: Tags.h:70
XMP metadata.
Definition: Tags.h:231
Tile depth in pixels (z planes).
Definition: Tags.h:201
Byte offset of each strip.
Definition: Tags.h:220
Description of the image.
Definition: Tags.h:66
Colour map for palette colour images.
Definition: Tags.h:183
Maximum component value.
Definition: Tags.h:92
uint16_t value_type
uint16_t type.
Definition: Tags.h:549
Positioning of subsampled chrominance components relative to luminance samples.
Definition: Tags.h:156
Inkset used in a separated image.
Definition: Tags.h:90
Computer and/or operating system creating the image.
Definition: Tags.h:65
::ome::files::tiff::PhotometricInterpretation value_type
uint16_t type.
Definition: Tags.h:589
Open Microscopy Environment C++.
UInt16Tag6
Unsigned 16-bit integer (×6) fields.
Definition: Tags.h:169
::ome::files::tiff::SampleFormat value_type
uint16_t type.
Definition: Tags.h:613
std::array< float, 2 > value_type
float array type.
Definition: Tags.h:709
Person who created the image.
Definition: Tags.h:61
std::array< float, 3 > value_type
float array type.
Definition: Tags.h:717
Number of rows in the image (pixels per column).
Definition: Tags.h:195
UInt16Tag2
Unsigned 16-bit integer (×2) fields.
Definition: Tags.h:160
StringTagArray1
String array fields.
Definition: Tags.h:75
std::vector< uint16_t > value_type
uint16_t vector type.
Definition: Tags.h:557
UInt16TagArray1
Unsigned 16-bit integer array fields.
Definition: Tags.h:100
Expand range of TransferFunction.
Definition: Tags.h:171
std::vector< std::string > value_type
string type.
Definition: Tags.h:541
Number of inks.
Definition: Tags.h:94
UInt16PlanarConfiguration1
PlanarConfiguration enum fields.
Definition: Tags.h:130
Range of detail (low-high) for which tonal detail should be retained.
Definition: Tags.h:163
Number of pixels per resolution unit along the image width.
Definition: Tags.h:238
UInt32Tag1
Unsigned 32-bit integer fields.
Definition: Tags.h:188
std::vector< uint64_t > value_type
uint64_t vector type.
Definition: Tags.h:685
How to interpret each data sample in a pixel.
Definition: Tags.h:144
IPTC (International Press Telecommunications Council) metadata.
Definition: Tags.h:210
UInt16Tag1
Unsigned 16-bit integer fields.
Definition: Tags.h:81
UInt16Compression1
Compression enum fields.
Definition: Tags.h:106
UInt32TagArray1
Unsigned 32-bit integer array fields.
Definition: Tags.h:207
Tile width in pixels (columns).
Definition: Tags.h:203
Use SAMPLEFORMAT [obsolete].
Definition: Tags.h:87
Subsampling factors used for YCbCr chrominance components.
Definition: Tags.h:165
uint32_t value_type
uint32_t type.
Definition: Tags.h:669
Coefficients describing the RGB to YCbCr transform.
Definition: Tags.h:253
Photometric interpretation; colour space of image data.
Definition: Tags.h:126
Number of bits per component.
Definition: Tags.h:83
::ome::files::tiff::YCbCrPosition value_type
uint16_t type.
Definition: Tags.h:629
Number of pixels per resolution unit along the image height.
Definition: Tags.h:239
UInt16YCbCrPosition1
YCbCrPosition enum fields.
Definition: Tags.h:154
Options for Group4 fax compression.
Definition: Tags.h:200
Scanner model name or number.
Definition: Tags.h:68
UInt64TagArray1
Unsigned 64-bit integer fields.
Definition: Tags.h:214
Image uses indexed color in any color space.
Definition: Tags.h:89
::ome::files::tiff::PlanarConfiguration value_type
uint16_t type.
Definition: Tags.h:597
Tile height in pixels (rows).
Definition: Tags.h:202
Photoshop "Image Resource Blocks".
Definition: Tags.h:230
Unit of measurement for XRESOLUTION and YRESOLUTION.
Definition: Tags.h:95
Options for Group 3 Fax compression (T4Options).
Definition: Tags.h:192
Number of components per pixel.
Definition: Tags.h:96
Method used to convert to black and white pixels.
Definition: Tags.h:150
Number of bytes in each tile (after compression).
Definition: Tags.h:221
ICC profile data.
Definition: Tags.h:228
tag_type getWrappedTag(StringTag1 tag)
Get the TIFF tag number for the specified tag.
Definition: Tags.cpp:66
Offsets of free bytes [unused].
Definition: Tags.h:216
FloatTag6
Floating point (×6) fields.
Definition: Tags.h:257
THe y position of the image in RESOLUTIONUNITs.
Definition: Tags.h:241
Use EXTRASAMPLES [obsolete].
Definition: Tags.h:91
UInt16Orientation1
Orientation enum fields.
Definition: Tags.h:118
Optical density of greyscale pixel values.
Definition: Tags.h:102
FloatTag1
Floating point fields.
Definition: Tags.h:236
Names of each ink used in a separated image.
Definition: Tags.h:77
UInt16Threshholding1
Threshholding enum fields.
Definition: Tags.h:148
Copyright notice.
Definition: Tags.h:62
UInt16Predictor1
Predictor enum fields.
Definition: Tags.h:136
Sizes of free bytes [unused].
Definition: Tags.h:217
Offsets of child IFDs.
Definition: Tags.h:218
std::array< float, 6 > value_type
float array type.
Definition: Tags.h:725
Number of bad scan lines encountered.
Definition: Tags.h:190
Number of z planes in the image.
Definition: Tags.h:194
Precision of GRAYRESPONSECURVE.
Definition: Tags.h:88
UInt16ExtraSamplesArray1
Unsigned 16-bit integer array fields.
Definition: Tags.h:175
How bad scanlines were handled.
Definition: Tags.h:86
::ome::files::tiff::Orientation value_type
uint16_t type.
Definition: Tags.h:581
Chromaticities of primary colours as 1931 CIE R(xy) G(xy) B(xy).
Definition: Tags.h:259
Logical order of bits within a byte.
Definition: Tags.h:114
std::string value_type
string type.
Definition: Tags.h:533
Width of dithering or halftoning matrix for bilevel data.
Definition: Tags.h:84
std::vector< uint8_t > value_type
uint32_t vector type.
Definition: Tags.h:693
::ome::files::tiff::Compression value_type
uint16_t type.
Definition: Tags.h:565