Mercurial > octave-libtiff
comparison scripts/image/private/__tiff_imfinfo__.m @ 31202:be6ccdcd5775
Tiff: added isBigEndian and getDirectoryOffset methods to the class
* scripts/io/Tiff.m: added isBigEndian and getDirectoryOffset methods
to the class.
* libtinterp/corefcn/tiff.cc: added __tiff_is_big_endian__ and
__tiff_get_directory_offset__ as internal functions for isBigEndian
and getDirectoryOffset repectively.
* scripts/image/private/__tiff_imfinfo__.m: used the two new methods
to get the corresponding info fields.
author | magedrifaat <magedrifaat@gmail.com> |
---|---|
date | Fri, 02 Sep 2022 21:20:56 +0200 |
parents | e5e8cb049b4b |
children |
comparison
equal
deleted
inserted
replaced
31201:e5e8cb049b4b | 31202:be6ccdcd5775 |
---|---|
15 endif | 15 endif |
16 | 16 |
17 for dir_idx = 1:dir_count | 17 for dir_idx = 1:dir_count |
18 info(dir_idx).Filename = filename; | 18 info(dir_idx).Filename = filename; |
19 info(dir_idx).FileModDate = strftime ("%e-%b-%Y %H:%M:%S", | 19 info(dir_idx).FileModDate = strftime ("%e-%b-%Y %H:%M:%S", |
20 localtime (file_stat.ctime)); | 20 localtime (file_stat.mtime)); |
21 info(dir_idx).FileSize = file_stat.size; | 21 info(dir_idx).FileSize = file_stat.size; |
22 info(dir_idx).Format = "tif"; | 22 info(dir_idx).Format = "tif"; |
23 info(dir_idx).FormatVersion = ""; | 23 info(dir_idx).FormatVersion = ""; |
24 endfor | 24 endfor |
25 endif | 25 endif |
71 info(dir_idx).Colormap ... | 71 info(dir_idx).Colormap ... |
72 = get_tag_defaulted (tif, Tiff.TagID.ColorMap, []); | 72 = get_tag_defaulted (tif, Tiff.TagID.ColorMap, []); |
73 endif | 73 endif |
74 endif | 74 endif |
75 | 75 |
76 ## FIXME: implement isBigEndian | 76 if (tif.isBigEndian ()) |
77 # if (tif.isBigEndian ()) | 77 info(dir_idx).ByteOrder = "big-endian"; |
78 # info(dir_idx).ByteOrder = "big-endian"; | 78 else |
79 # else | 79 info(dir_idx).ByteOrder = "little-endian"; |
80 # info(dir_idx).ByteOrder = "little-endian"; | 80 endif |
81 # endif | |
82 | 81 |
83 info(dir_idx).NewSubFileType ... | 82 info(dir_idx).NewSubFileType ... |
84 = get_tag_defaulted (tif, Tiff.TagID.SubFileType, | 83 = get_tag_defaulted (tif, Tiff.TagID.SubFileType, |
85 Tiff.SubFileType.Default); | 84 Tiff.SubFileType.Default); |
86 | 85 |
151 | 150 |
152 info(dir_idx).Thresholding ... | 151 info(dir_idx).Thresholding ... |
153 = get_tag_defaulted (tif, Tiff.TagID.Thresholding, | 152 = get_tag_defaulted (tif, Tiff.TagID.Thresholding, |
154 Tiff.Thresholding.BiLevel); | 153 Tiff.Thresholding.BiLevel); |
155 | 154 |
156 ## FIXME: implement getDirectoryOffset method | 155 info(dir_idx).Offset = tif.getDirectoryOffset (); |
157 # info(dir_idx).Offset = tif.getDirectoryOffset (); | |
158 | 156 |
159 info(dir_idx).ImageDescription ... | 157 info(dir_idx).ImageDescription ... |
160 = get_tag_defaulted (tif, Tiff.TagID.ImageDescription, ""); | 158 = get_tag_defaulted (tif, Tiff.TagID.ImageDescription, ""); |
161 | 159 |
162 info(dir_idx).Photoshop ... | 160 info(dir_idx).Photoshop ... |