15 std::shared_ptr<std::ifstream> sp;
33 uint16_t get16(
DEntry const & e) {
return le?e.
data&0xffff:e.
data>>16;}
34 uint16_t next16(
DEntry const & e) {
return le?e.
data>>16:e.
data&0xffff;}
35 uint32_t to32(
DEntry const & e);
36 std::string get_str(
DEntry const & de);
37 std::vector<uint16_t> get16s(
DEntry const & e);
38 std::vector<uint32_t> get32s(
DEntry const & e);
39 std::tuple<uint32_t,uint32_t> get_ratio(
DEntry const & e);
42 Tiff(std::shared_ptr<std::ifstream> s) : sp(s) {}
51 Tag_ImageWidth = 0x100,
52 Tag_ImageLength = 0x101,
53 Tag_BitsPerSample = 0x102,
54 Tag_Compression = 0x103,
55 Tag_PhotometricInterpretation = 0x106,
56 Tag_FillOrder = 0x10a,
57 Tag_ImageDescription = 0x10e,
58 Tag_StripOffsets = 0x111,
59 Tag_Orientation = 0x112,
60 Tag_SamplesPerPixel = 0x115,
61 Tag_RowsPerStrip = 0x116,
62 Tag_StripByteCounts = 0x117,
63 Tag_XResolution = 0x11a,
64 Tag_YResolution = 0x11b,
65 Tag_PlanarConfiguration = 0x11c,
66 Tag_ResolutionUnit = 0x128,
68 Tag_SampleFormat = 0x153,
81 {Cmp_PackBits,
"PackBits"}
89 Ptm_TransparencyMask = 4
93 {Ptm_WhiteIsZero,
"WhiteIsZero"},
94 {Ptm_BlackIsZero,
"BlackIsZero"},
96 {Ptm_Palette,
"Palette"},
97 {Ptm_TransparencyMask,
"TransparencyMask"}
109 {Unt_Centimeter,
"Centimeter"}
114 Fmt_TwoComplement = 2,
120 {Fmt_Unsigned,
"Unsigned"},
121 {Fmt_TwoComplement,
"TwoComplement"},
122 {Fmt_IEEEFloat,
"IEEEFloat"},
123 {Fmt_Undefined,
"Undefined"}
std::string image_description
image description
std::map< SampleFormat, std::string > const format_name
String names for sample formats.
uint16_t samples_per_pixel
samples per pixel
std::vector< uint32_t > strip_offsets
strip offsets
std::vector< char > read_image()
uint32_t image_width
width of image
std::vector< uint32_t > strip_byte_counts
strip byte counots
std::vector< SampleFormat > sample_formats
sample formats
Compression compression
compression method
std::map< Photometric, std::string > const photom_name
String names for photometric formats.
Tiff(std::shared_ptr< std::ifstream > s)
Construct TIFF processor from an input stream.
std::tuple< uint32_t, uint32_t > yresolution
y resolution
std::tuple< uint32_t, uint32_t > xresolution
x resolution
uint32_t image_length
length of image
std::string software
software used
Photometric photometric
photometric format
Unit resolution_unit
unit for image resolution
std::map< Compression, std::string > const compress_name
String names for compression methods.
uint16_t planar_configuration
planar configuration
SampleFormat
Sample formats.
Photometric
Photometric formats.
uint16_t fill_order
fill order
Tag
Directory entry ID tags.
uint32_t rows_per_strip
rows per strip
uint16_t type
entry data type
std::map< Unit, std::string > const unit_name
String names for units.
Compression
Compression methods.
uint16_t orientation
orientation of image
std::vector< uint16_t > bits_per_sample
bits per sample
uint32_t parse_ifd(uint32_t i=0)
Parse image file directory (IFD)
uint32_t data
data or offset
std::string image_id
image ID