1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
# Generated @ 2022-01-29T10:40:19+01:00
# Command line:
# /home/leah/proj/nimterop/nimterop/toast --preprocess -m:c --recurse --includeDirs+=/home/leah/proj/nimexif/libexif/include --pnim --dynlib=libexif/lib/libexif.so --nim:/nix/store/q3idba3s6lhfbdqfc56ira80nid637ki-nim-unwrapped-1.6.0/nim/bin/nim --pluginSourcePath=/home/leah/.cache/nim/nimterop/cPlugins/nimterop_2962677049.nim /home/leah/proj/nimexif/libexif/include/libexif/exif-data.h -o /home/leah/.cache/nim/nimterop/toastCache/nimterop_3454167574.nim
# const 'EXIF_TAG_SUBSEC_TIME' has unsupported value 'EXIF_TAG_SUB_SEC_TIME'
# const 'EXIF_TAG_UNKNOWN_C4A5' has unsupported value 'EXIF_TAG_PRINT_IMAGE_MATCHING'
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
import macros
macro defineEnum(typ: untyped): untyped =
result = newNimNode(nnkStmtList)
# Enum mapped to distinct cint
result.add quote do:
type `typ`* = distinct cint
for i in ["+", "-", "*", "div", "mod", "shl", "shr", "or", "and", "xor", "<", "<=", "==", ">", ">="]:
let
ni = newIdentNode(i)
typout = if i[0] in "<=>": newIdentNode("bool") else: typ # comparisons return bool
if i[0] == '>': # cannot borrow `>` and `>=` from templates
let
nopp = if i.len == 2: newIdentNode("<=") else: newIdentNode("<")
result.add quote do:
proc `ni`*(x: `typ`, y: cint): `typout` = `nopp`(y, x)
proc `ni`*(x: cint, y: `typ`): `typout` = `nopp`(y, x)
proc `ni`*(x, y: `typ`): `typout` = `nopp`(y, x)
else:
result.add quote do:
proc `ni`*(x: `typ`, y: cint): `typout` {.borrow.}
proc `ni`*(x: cint, y: `typ`): `typout` {.borrow.}
proc `ni`*(x, y: `typ`): `typout` {.borrow.}
result.add quote do:
proc `ni`*(x: `typ`, y: int): `typout` = `ni`(x, y.cint)
proc `ni`*(x: int, y: `typ`): `typout` = `ni`(x.cint, y)
let
divop = newIdentNode("/") # `/`()
dlrop = newIdentNode("$") # `$`()
notop = newIdentNode("not") # `not`()
result.add quote do:
proc `divop`*(x, y: `typ`): `typ` = `typ`((x.float / y.float).cint)
proc `divop`*(x: `typ`, y: cint): `typ` = `divop`(x, `typ`(y))
proc `divop`*(x: cint, y: `typ`): `typ` = `divop`(`typ`(x), y)
proc `divop`*(x: `typ`, y: int): `typ` = `divop`(x, y.cint)
proc `divop`*(x: int, y: `typ`): `typ` = `divop`(x.cint, y)
proc `dlrop`*(x: `typ`): string {.borrow.}
proc `notop`*(x: `typ`): `typ` {.borrow.}
type va_list* {.importc, header:"<stdarg.h>".} = object
{.pragma: impexifdataHdr, header: "@libexif@/include/libexif/exif-data.h".}
{.pragma: impexifdataDyn, dynlib: "@libexif@/lib/libexif.so".}
{.experimental: "codeReordering".}
{.passC: "-I@libexif@/include".}
defineEnum(ExifByteOrder) ## ```
## ! Which byte order to use
## ```
defineEnum(ExifDataType) ## ```
## ! Represents the type of image data to which the EXIF data applies.
## The EXIF tags have different constraints depending on the type of
## image data.
## ```
defineEnum(ExifIfd) ## ```
## ! Possible EXIF Image File Directories
## ```
defineEnum(ExifFormat) ## ```
## ! EXIF tag data formats
## ```
defineEnum(ExifLogCode)
defineEnum(ExifTag) ## ```
## exif-ifd.h
##
## Copyright (c) 2002 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## exif-data-tag.h
##
## Copyright (c) 2005 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! EXIF tags
## ```
defineEnum(ExifSupportLevel) ## ```
## ! What level of support a tag enjoys in the EXIF standard
## ```
defineEnum(ExifDataOption) ## ```
## ! Options to configure the behaviour of #ExifData
## ```
const
EXIF_BYTE_ORDER_MOTOROLA* = (0).ExifByteOrder ## ```
## ! Big-endian byte order
## ```
EXIF_BYTE_ORDER_INTEL* = (EXIF_BYTE_ORDER_MOTOROLA + 1).ExifByteOrder ## ```
## ! Little-endian byte order
## ```
EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY* = (0).ExifDataType
EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR* = (EXIF_DATA_TYPE_UNCOMPRESSED_CHUNKY + 1).ExifDataType
EXIF_DATA_TYPE_UNCOMPRESSED_YCC* = (EXIF_DATA_TYPE_UNCOMPRESSED_PLANAR + 1).ExifDataType
EXIF_DATA_TYPE_COMPRESSED* = (EXIF_DATA_TYPE_UNCOMPRESSED_YCC + 1).ExifDataType
EXIF_DATA_TYPE_COUNT* = (EXIF_DATA_TYPE_COMPRESSED + 1).ExifDataType
EXIF_DATA_TYPE_UNKNOWN* = (EXIF_DATA_TYPE_COUNT).ExifDataType
EXIF_IFD_0* = (0).ExifIfd ## ```
## !<
## ```
EXIF_IFD_1* = (EXIF_IFD_0 + 1).ExifIfd ## ```
## !<
## ```
EXIF_IFD_EXIF* = (EXIF_IFD_1 + 1).ExifIfd ## ```
## !<
## ```
EXIF_IFD_GPS* = (EXIF_IFD_EXIF + 1).ExifIfd ## ```
## !<
## ```
EXIF_IFD_INTEROPERABILITY* = (EXIF_IFD_GPS + 1).ExifIfd ## ```
## !<
## ```
EXIF_IFD_COUNT* = (EXIF_IFD_INTEROPERABILITY + 1).ExifIfd ## ```
## !< Not a real value, just (max_value + 1).
## ```
EXIF_FORMAT_BYTE* = (1).ExifFormat
EXIF_FORMAT_ASCII* = (2).ExifFormat
EXIF_FORMAT_SHORT* = (3).ExifFormat
EXIF_FORMAT_LONG* = (4).ExifFormat
EXIF_FORMAT_RATIONAL* = (5).ExifFormat
EXIF_FORMAT_SBYTE* = (6).ExifFormat
EXIF_FORMAT_UNDEFINED* = (7).ExifFormat
EXIF_FORMAT_SSHORT* = (8).ExifFormat
EXIF_FORMAT_SLONG* = (9).ExifFormat
EXIF_FORMAT_SRATIONAL* = (10).ExifFormat
EXIF_FORMAT_FLOAT* = (11).ExifFormat
EXIF_FORMAT_DOUBLE* = (12).ExifFormat
EXIF_LOG_CODE_NONE* = (0).ExifLogCode
EXIF_LOG_CODE_DEBUG* = (EXIF_LOG_CODE_NONE + 1).ExifLogCode
EXIF_LOG_CODE_NO_MEMORY* = (EXIF_LOG_CODE_DEBUG + 1).ExifLogCode
EXIF_LOG_CODE_CORRUPT_DATA* = (EXIF_LOG_CODE_NO_MEMORY + 1).ExifLogCode
EXIF_TAG_INTEROPERABILITY_INDEX* = (0x00000001).ExifTag
EXIF_TAG_INTEROPERABILITY_VERSION* = (0x00000002).ExifTag
EXIF_TAG_NEW_SUBFILE_TYPE* = (0x000000FE).ExifTag
EXIF_TAG_IMAGE_WIDTH* = (0x00000100).ExifTag
EXIF_TAG_IMAGE_LENGTH* = (0x00000101).ExifTag
EXIF_TAG_BITS_PER_SAMPLE* = (0x00000102).ExifTag
EXIF_TAG_COMPRESSION* = (0x00000103).ExifTag
EXIF_TAG_PHOTOMETRIC_INTERPRETATION* = (0x00000106).ExifTag
EXIF_TAG_FILL_ORDER* = (0x0000010A).ExifTag
EXIF_TAG_DOCUMENT_NAME* = (0x0000010D).ExifTag
EXIF_TAG_IMAGE_DESCRIPTION* = (0x0000010E).ExifTag
EXIF_TAG_MAKE* = (0x0000010F).ExifTag
EXIF_TAG_MODEL* = (0x00000110).ExifTag
EXIF_TAG_STRIP_OFFSETS* = (0x00000111).ExifTag
EXIF_TAG_ORIENTATION* = (0x00000112).ExifTag
EXIF_TAG_SAMPLES_PER_PIXEL* = (0x00000115).ExifTag
EXIF_TAG_ROWS_PER_STRIP* = (0x00000116).ExifTag
EXIF_TAG_STRIP_BYTE_COUNTS* = (0x00000117).ExifTag
EXIF_TAG_X_RESOLUTION* = (0x0000011A).ExifTag
EXIF_TAG_Y_RESOLUTION* = (0x0000011B).ExifTag
EXIF_TAG_PLANAR_CONFIGURATION* = (0x0000011C).ExifTag
EXIF_TAG_RESOLUTION_UNIT* = (0x00000128).ExifTag
EXIF_TAG_TRANSFER_FUNCTION* = (0x0000012D).ExifTag
EXIF_TAG_SOFTWARE* = (0x00000131).ExifTag
EXIF_TAG_DATE_TIME* = (0x00000132).ExifTag
EXIF_TAG_ARTIST* = (0x0000013B).ExifTag
EXIF_TAG_WHITE_POINT* = (0x0000013E).ExifTag
EXIF_TAG_PRIMARY_CHROMATICITIES* = (0x0000013F).ExifTag
EXIF_TAG_SUB_IFDS* = (0x0000014A).ExifTag
EXIF_TAG_TRANSFER_RANGE* = (0x00000156).ExifTag
EXIF_TAG_JPEG_PROC* = (0x00000200).ExifTag
EXIF_TAG_JPEG_INTERCHANGE_FORMAT* = (0x00000201).ExifTag
EXIF_TAG_JPEG_INTERCHANGE_FORMAT_LENGTH* = (0x00000202).ExifTag
EXIF_TAG_YCBCR_COEFFICIENTS* = (0x00000211).ExifTag
EXIF_TAG_YCBCR_SUB_SAMPLING* = (0x00000212).ExifTag
EXIF_TAG_YCBCR_POSITIONING* = (0x00000213).ExifTag
EXIF_TAG_REFERENCE_BLACK_WHITE* = (0x00000214).ExifTag
EXIF_TAG_XML_PACKET* = (0x000002BC).ExifTag
EXIF_TAG_RELATED_IMAGE_FILE_FORMAT* = (0x00001000).ExifTag
EXIF_TAG_RELATED_IMAGE_WIDTH* = (0x00001001).ExifTag
EXIF_TAG_RELATED_IMAGE_LENGTH* = (0x00001002).ExifTag
EXIF_TAG_IMAGE_DEPTH* = (0x000080E5).ExifTag
EXIF_TAG_CFA_REPEAT_PATTERN_DIM* = (0x0000828D).ExifTag
EXIF_TAG_CFA_PATTERN* = (0x0000828E).ExifTag
EXIF_TAG_BATTERY_LEVEL* = (0x0000828F).ExifTag
EXIF_TAG_COPYRIGHT* = (0x00008298).ExifTag
EXIF_TAG_EXPOSURE_TIME* = (0x0000829A).ExifTag
EXIF_TAG_FNUMBER* = (0x0000829D).ExifTag
EXIF_TAG_IPTC_NAA* = (0x000083BB).ExifTag
EXIF_TAG_IMAGE_RESOURCES* = (0x00008649).ExifTag
EXIF_TAG_EXIF_IFD_POINTER* = (0x00008769).ExifTag
EXIF_TAG_INTER_COLOR_PROFILE* = (0x00008773).ExifTag
EXIF_TAG_EXPOSURE_PROGRAM* = (0x00008822).ExifTag
EXIF_TAG_SPECTRAL_SENSITIVITY* = (0x00008824).ExifTag
EXIF_TAG_GPS_INFO_IFD_POINTER* = (0x00008825).ExifTag
EXIF_TAG_ISO_SPEED_RATINGS* = (0x00008827).ExifTag
EXIF_TAG_OECF* = (0x00008828).ExifTag
EXIF_TAG_TIME_ZONE_OFFSET* = (0x0000882A).ExifTag
EXIF_TAG_SENSITIVITY_TYPE* = (0x00008830).ExifTag
EXIF_TAG_STANDARD_OUTPUT_SENSITIVITY* = (0x00008831).ExifTag
EXIF_TAG_RECOMMENDED_EXPOSURE_INDEX* = (0x00008832).ExifTag
EXIF_TAG_ISO_SPEED* = (0x00008833).ExifTag
EXIF_TAG_ISO_SPEEDLatitudeYYY* = (0x00008834).ExifTag
EXIF_TAG_ISO_SPEEDLatitudeZZZ* = (0x00008835).ExifTag
EXIF_TAG_EXIF_VERSION* = (0x00009000).ExifTag
EXIF_TAG_DATE_TIME_ORIGINAL* = (0x00009003).ExifTag
EXIF_TAG_DATE_TIME_DIGITIZED* = (0x00009004).ExifTag
EXIF_TAG_OFFSET_TIME* = (0x00009010).ExifTag
EXIF_TAG_OFFSET_TIME_ORIGINAL* = (0x00009011).ExifTag
EXIF_TAG_OFFSET_TIME_DIGITIZED* = (0x00009012).ExifTag
EXIF_TAG_COMPONENTS_CONFIGURATION* = (0x00009101).ExifTag
EXIF_TAG_COMPRESSED_BITS_PER_PIXEL* = (0x00009102).ExifTag
EXIF_TAG_SHUTTER_SPEED_VALUE* = (0x00009201).ExifTag
EXIF_TAG_APERTURE_VALUE* = (0x00009202).ExifTag
EXIF_TAG_BRIGHTNESS_VALUE* = (0x00009203).ExifTag
EXIF_TAG_EXPOSURE_BIAS_VALUE* = (0x00009204).ExifTag
EXIF_TAG_MAX_APERTURE_VALUE* = (0x00009205).ExifTag
EXIF_TAG_SUBJECT_DISTANCE* = (0x00009206).ExifTag
EXIF_TAG_METERING_MODE* = (0x00009207).ExifTag
EXIF_TAG_LIGHT_SOURCE* = (0x00009208).ExifTag
EXIF_TAG_FLASH* = (0x00009209).ExifTag
EXIF_TAG_FOCAL_LENGTH* = (0x0000920A).ExifTag
EXIF_TAG_SUBJECT_AREA* = (0x00009214).ExifTag
EXIF_TAG_TIFF_EP_STANDARD_ID* = (0x00009216).ExifTag
EXIF_TAG_MAKER_NOTE* = (0x0000927C).ExifTag
EXIF_TAG_USER_COMMENT* = (0x00009286).ExifTag
EXIF_TAG_SUB_SEC_TIME* = (0x00009290).ExifTag
EXIF_TAG_SUB_SEC_TIME_ORIGINAL* = (0x00009291).ExifTag
EXIF_TAG_SUB_SEC_TIME_DIGITIZED* = (0x00009292).ExifTag
EXIF_TAG_XP_TITLE* = (0x00009C9B).ExifTag
EXIF_TAG_XP_COMMENT* = (0x00009C9C).ExifTag
EXIF_TAG_XP_AUTHOR* = (0x00009C9D).ExifTag
EXIF_TAG_XP_KEYWORDS* = (0x00009C9E).ExifTag
EXIF_TAG_XP_SUBJECT* = (0x00009C9F).ExifTag
EXIF_TAG_FLASH_PIX_VERSION* = (0x0000A000).ExifTag
EXIF_TAG_COLOR_SPACE* = (0x0000A001).ExifTag
EXIF_TAG_PIXEL_X_DIMENSION* = (0x0000A002).ExifTag
EXIF_TAG_PIXEL_Y_DIMENSION* = (0x0000A003).ExifTag
EXIF_TAG_RELATED_SOUND_FILE* = (0x0000A004).ExifTag
EXIF_TAG_INTEROPERABILITY_IFD_POINTER* = (0x0000A005).ExifTag
EXIF_TAG_FLASH_ENERGY* = (0x0000A20B).ExifTag
EXIF_TAG_SPATIAL_FREQUENCY_RESPONSE* = (0x0000A20C).ExifTag
EXIF_TAG_FOCAL_PLANE_X_RESOLUTION* = (0x0000A20E).ExifTag
EXIF_TAG_FOCAL_PLANE_Y_RESOLUTION* = (0x0000A20F).ExifTag
EXIF_TAG_FOCAL_PLANE_RESOLUTION_UNIT* = (0x0000A210).ExifTag
EXIF_TAG_SUBJECT_LOCATION* = (0x0000A214).ExifTag
EXIF_TAG_EXPOSURE_INDEX* = (0x0000A215).ExifTag
EXIF_TAG_SENSING_METHOD* = (0x0000A217).ExifTag
EXIF_TAG_FILE_SOURCE* = (0x0000A300).ExifTag
EXIF_TAG_SCENE_TYPE* = (0x0000A301).ExifTag
EXIF_TAG_NEW_CFA_PATTERN* = (0x0000A302).ExifTag
EXIF_TAG_CUSTOM_RENDERED* = (0x0000A401).ExifTag
EXIF_TAG_EXPOSURE_MODE* = (0x0000A402).ExifTag
EXIF_TAG_WHITE_BALANCE* = (0x0000A403).ExifTag
EXIF_TAG_DIGITAL_ZOOM_RATIO* = (0x0000A404).ExifTag
EXIF_TAG_FOCAL_LENGTH_IN_35MM_FILM* = (0x0000A405).ExifTag
EXIF_TAG_SCENE_CAPTURE_TYPE* = (0x0000A406).ExifTag
EXIF_TAG_GAIN_CONTROL* = (0x0000A407).ExifTag
EXIF_TAG_CONTRAST* = (0x0000A408).ExifTag
EXIF_TAG_SATURATION* = (0x0000A409).ExifTag
EXIF_TAG_SHARPNESS* = (0x0000A40A).ExifTag
EXIF_TAG_DEVICE_SETTING_DESCRIPTION* = (0x0000A40B).ExifTag
EXIF_TAG_SUBJECT_DISTANCE_RANGE* = (0x0000A40C).ExifTag
EXIF_TAG_IMAGE_UNIQUE_ID* = (0x0000A420).ExifTag
EXIF_TAG_CAMERA_OWNER_NAME* = (0x0000A430).ExifTag
EXIF_TAG_BODY_SERIAL_NUMBER* = (0x0000A431).ExifTag
EXIF_TAG_LENS_SPECIFICATION* = (0x0000A432).ExifTag
EXIF_TAG_LENS_MAKE* = (0x0000A433).ExifTag
EXIF_TAG_LENS_MODEL* = (0x0000A434).ExifTag
EXIF_TAG_LENS_SERIAL_NUMBER* = (0x0000A435).ExifTag
EXIF_TAG_COMPOSITE_IMAGE* = (0x0000A460).ExifTag
EXIF_TAG_SOURCE_IMAGE_NUMBER_OF_COMPOSITE_IMAGE* = (0x0000A461).ExifTag
EXIF_TAG_SOURCE_EXPOSURE_TIMES_OF_COMPOSITE_IMAGE* = (0x0000A462).ExifTag
EXIF_TAG_GAMMA* = (0x0000A500).ExifTag
EXIF_TAG_PRINT_IMAGE_MATCHING* = (0x0000C4A5).ExifTag
EXIF_TAG_PADDING* = (0x0000EA1C).ExifTag
EXIF_TAG_GPS_VERSION_ID* = 0x00000000
EXIF_TAG_GPS_LATITUDE_REF* = 0x00000001
EXIF_TAG_GPS_LATITUDE* = 0x00000002
EXIF_TAG_GPS_LONGITUDE_REF* = 0x00000003
EXIF_TAG_GPS_LONGITUDE* = 0x00000004
EXIF_TAG_GPS_ALTITUDE_REF* = 0x00000005
EXIF_TAG_GPS_ALTITUDE* = 0x00000006
EXIF_TAG_GPS_TIME_STAMP* = 0x00000007
EXIF_TAG_GPS_SATELLITES* = 0x00000008
EXIF_TAG_GPS_STATUS* = 0x00000009
EXIF_TAG_GPS_MEASURE_MODE* = 0x0000000A
EXIF_TAG_GPS_DOP* = 0x0000000B
EXIF_TAG_GPS_SPEED_REF* = 0x0000000C
EXIF_TAG_GPS_SPEED* = 0x0000000D
EXIF_TAG_GPS_TRACK_REF* = 0x0000000E
EXIF_TAG_GPS_TRACK* = 0x0000000F
EXIF_TAG_GPS_IMG_DIRECTION_REF* = 0x00000010
EXIF_TAG_GPS_IMG_DIRECTION* = 0x00000011
EXIF_TAG_GPS_MAP_DATUM* = 0x00000012
EXIF_TAG_GPS_DEST_LATITUDE_REF* = 0x00000013
EXIF_TAG_GPS_DEST_LATITUDE* = 0x00000014
EXIF_TAG_GPS_DEST_LONGITUDE_REF* = 0x00000015
EXIF_TAG_GPS_DEST_LONGITUDE* = 0x00000016
EXIF_TAG_GPS_DEST_BEARING_REF* = 0x00000017
EXIF_TAG_GPS_DEST_BEARING* = 0x00000018
EXIF_TAG_GPS_DEST_DISTANCE_REF* = 0x00000019
EXIF_TAG_GPS_DEST_DISTANCE* = 0x0000001A
EXIF_TAG_GPS_PROCESSING_METHOD* = 0x0000001B
EXIF_TAG_GPS_AREA_INFORMATION* = 0x0000001C
EXIF_TAG_GPS_DATE_STAMP* = 0x0000001D
EXIF_TAG_GPS_DIFFERENTIAL* = 0x0000001E
EXIF_TAG_GPS_H_POSITIONING_ERROR* = 0x0000001F
EXIF_SUPPORT_LEVEL_UNKNOWN* = (0).ExifSupportLevel ## ```
## ! The meaning of this tag is unknown
## ```
EXIF_SUPPORT_LEVEL_NOT_RECORDED* = (EXIF_SUPPORT_LEVEL_UNKNOWN + 1).ExifSupportLevel ## ```
## ! This tag is not allowed in the given IFD
## ```
EXIF_SUPPORT_LEVEL_MANDATORY* = (EXIF_SUPPORT_LEVEL_NOT_RECORDED + 1).ExifSupportLevel ## ```
## ! This tag is mandatory in the given IFD
## ```
EXIF_SUPPORT_LEVEL_OPTIONAL* = (EXIF_SUPPORT_LEVEL_MANDATORY + 1).ExifSupportLevel ## ```
## ! This tag is optional in the given IFD
## ```
EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS* = (1 shl typeof(1)(0)).ExifDataOption ## ```
## ! Act as though unknown tags are not present
## ```
EXIF_DATA_OPTION_FOLLOW_SPECIFICATION* = (1 shl typeof(1)(1)).ExifDataOption ## ```
## ! Fix the EXIF tags to follow the spec
## ```
EXIF_DATA_OPTION_DONT_CHANGE_MAKER_NOTE* = (1 shl typeof(1)(2)).ExifDataOption ## ```
## ! Leave the MakerNote alone, which could cause it to be corrupted
## ```
type
ExifByte* {.importc, impexifdataHdr.} = uint8 ## ```
## 1 byte
## ! EXIF Signed Byte data type
## ```
ExifSByte* {.importc, impexifdataHdr.} = cschar ## ```
## 1 byte
## ! EXIF Text String data type
## ```
ExifAscii* {.importc, impexifdataHdr.} = cstring ## ```
## 1 byte
## ! EXIF Text String data type
## ```
ExifShort* {.importc, impexifdataHdr.} = uint16 ## ```
## 2 bytes
## ! EXIF Signed Short data type
## ```
ExifSShort* {.importc, impexifdataHdr.} = int16 ## ```
## 2 bytes
## ! EXIF Unsigned Long data type
## ```
ExifLong* {.importc, impexifdataHdr.} = uint32 ## ```
## 4 bytes
## ! EXIF Signed Long data type
## ```
ExifSLong* {.importc, impexifdataHdr.} = int32 ## ```
## 4 bytes
## ! EXIF Unsigned Rational data type
## ```
ExifRational* {.bycopy, importc, impexifdataHdr.} = object ## ```
## 4 bytes
## ! EXIF Unsigned Rational data type
## ```
numerator*: ExifLong
denominator*: ExifLong
ExifUndefined* {.importc, impexifdataHdr.} = cchar ## ```
## 1 byte
## ! EXIF Signed Rational data type
## ```
ExifSRational* {.bycopy, importc, impexifdataHdr.} = object ## ```
## 1 byte
## ! EXIF Signed Rational data type
## ```
numerator*: ExifSLong
denominator*: ExifSLong
ExifMemAllocFunc* {.importc, impexifdataHdr.} = proc (s: ExifLong): pointer {.
cdecl.}
ExifMemReallocFunc* {.importc, impexifdataHdr.} = proc (p: pointer;
s: ExifLong): pointer {.cdecl.}
ExifMemFreeFunc* {.importc, impexifdataHdr.} = proc (p: pointer) {.cdecl.}
ExifMem* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifLog* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifLogFunc* {.importc, impexifdataHdr.} = proc (log: ptr ExifLog;
a2: ExifLogCode; domain: cstring; format: cstring; args: va_list;
data: pointer) {.cdecl.}
ExifData* {.importc, impexifdataHdr, bycopy.} = object ## ```
## ! \file exif-mem.h
## \brief Define the ExifMem data type and the associated functions.
## ExifMem defines the memory management functions used within libexif.
##
## exif-mem.h
##
## Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! Represents the entire EXIF data found in an image
## ```
ifd*: array[EXIF_IFD_COUNT, ptr ExifContent] ## ```
## ! Data for each IFD
## ```
data*: ptr uint8 ## ```
## ! Pointer to thumbnail image, or NULL if not available
## ```
size*: cuint ## ```
## ! Number of bytes in thumbnail image at \c data
## ```
priv*: ptr ExifDataPrivate
ExifDataPrivate* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifContent* {.importc, impexifdataHdr, bycopy.} = object
entries*: ptr ptr ExifEntry
count*: cuint
parent*: ptr ExifData ## ```
## ! Data containing this content
## ```
priv*: ptr ExifContentPrivate
ExifContentPrivate* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifEntry* {.importc, impexifdataHdr, bycopy.} = object ## ```
## ! \file exif-content.h
## \brief Handling EXIF IFDs
##
##
## Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! \file exif-format.h
## \brief Handling native EXIF data types
##
##
##
## Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! \file exif-mem.h
## \brief Define the ExifMem data type and the associated functions.
## ExifMem defines the memory management functions used within libexif.
##
## exif-mem.h
##
## Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! Data found in one EXIF tag
## ```
tag*: ExifTag ## ```
## ! EXIF tag for this entry
## ```
format*: ExifFormat ## ```
## ! Type of data in this entry
## ```
components*: culong ## ```
## ! Number of elements in the array, if this is an array entry.
## Contains 1 for non-array data types.
## ```
data*: ptr uint8 ## ```
## ! Pointer to the raw EXIF data for this entry. It is allocated
## by #exif_entry_initialize and is NULL beforehand. Data contained
## here may be manipulated using the functions in exif-utils.h
## ```
size*: cuint ## ```
## ! Number of bytes in the buffer at \c data. This must be no less
## than exif_format_get_size(format)*components
## ```
parent*: ptr ExifContent ## ```
## ! #ExifContent containing this entry.
## \see exif_entry_get_ifd
## ```
priv*: ptr ExifEntryPrivate ## ```
## ! Internal data to be used by libexif itself
## ```
ExifEntryPrivate* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifContentForeachEntryFunc* {.importc, impexifdataHdr.} = proc (
a1: ptr ExifEntry; user_data: pointer) {.cdecl.}
ExifMnoteData* {.importc, impexifdataHdr, incompleteStruct.} = object
ExifDataForeachContentFunc* {.importc, impexifdataHdr.} = proc (
a1: ptr ExifContent; user_data: pointer) {.cdecl.}
proc exif_byte_order_get_name*(order: ExifByteOrder): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a short, localized, textual name for the given byte order.
## \param[in] order byte order
## \return localized textual name of the byte order, or NULL if unknown
## ```
proc exif_ifd_get_name*(ifd: ExifIfd): cstring {.importc, cdecl, impexifdataDyn.}
## ```
## ! Return a textual name of the given IFD. The name is a short, unique,
## non-localized text string containing only US-ASCII alphanumeric
## characters.
##
## \param[in] ifd IFD
## \return textual name of the IFD, or NULL if unknown
## ```
proc exif_format_get_name*(format: ExifFormat): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a textual representation of the given EXIF data type.
##
## \param[in] format EXIF data format
## \return localized textual name, or NULL if unknown
## ```
proc exif_format_get_size*(format: ExifFormat): uint8 {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return the raw size of the given EXIF data type.
##
## \param[in] format EXIF data format
## \return size in bytes
## ```
proc exif_get_short*(b: ptr uint8; order: ExifByteOrder): ExifShort {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifShort value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_get_sshort*(b: ptr uint8; order: ExifByteOrder): ExifSShort {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifSShort value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_get_long*(b: ptr uint8; order: ExifByteOrder): ExifLong {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifLong value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_get_slong*(b: ptr uint8; order: ExifByteOrder): ExifSLong {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifSLong value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_get_rational*(b: ptr uint8; order: ExifByteOrder): ExifRational {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifRational value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_get_srational*(b: ptr uint8; order: ExifByteOrder): ExifSRational {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Retrieve an #ExifSRational value from memory.
##
## \param[in] b pointer to raw EXIF value in memory
## \param[in] order byte order of raw value
## \return value
## ```
proc exif_set_short*(b: ptr uint8; order: ExifByteOrder; value: ExifShort) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifShort value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_set_sshort*(b: ptr uint8; order: ExifByteOrder; value: ExifSShort) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifSShort value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_set_long*(b: ptr uint8; order: ExifByteOrder; value: ExifLong) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifLong value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_set_slong*(b: ptr uint8; order: ExifByteOrder; value: ExifSLong) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifSLong value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_set_rational*(b: ptr uint8; order: ExifByteOrder; value: ExifRational) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifRational value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_set_srational*(b: ptr uint8; order: ExifByteOrder;
value: ExifSRational) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Store an ExifSRational value into memory in EXIF format.
##
## \param[out] b buffer in which to write raw value
## \param[in] order byte order to use
## \param[in] value data value to store
## ```
proc exif_convert_utf16_to_utf8*(`out`: cstring; `in`: ptr uint8; maxlen: cint) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! \internal
## ```
proc exif_array_set_byte_order*(a1: ExifFormat; a2: ptr uint8; a3: cuint;
o_orig: ExifByteOrder; o_new: ExifByteOrder) {.
importc, cdecl, impexifdataDyn.}
## ```
## Please do not use this function outside of the library.
## ! \internal
## ```
proc exif_mem_new*(a: ExifMemAllocFunc; r: ExifMemReallocFunc;
f: ExifMemFreeFunc): ptr ExifMem {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Create a new ExifMem
##
## \param[in] a the allocator function
## \param[in] r the reallocator function
## \param[in] f the free function
## \return allocated #ExifMem, or NULL on error
## ```
proc exif_mem_ref*(a1: ptr ExifMem) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Refcount an ExifMem
## ```
proc exif_mem_unref*(a1: ptr ExifMem) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Unrefcount an ExifMem.
## If the refcount reaches 0, the ExifMem is freed
## ```
proc exif_mem_alloc*(m: ptr ExifMem; s: ExifLong): pointer {.importc, cdecl,
impexifdataDyn.}
proc exif_mem_realloc*(m: ptr ExifMem; p: pointer; s: ExifLong): pointer {.
importc, cdecl, impexifdataDyn.}
proc exif_mem_free*(m: ptr ExifMem; p: pointer) {.importc, cdecl, impexifdataDyn.}
proc exif_mem_new_default*(): ptr ExifMem {.importc, cdecl, impexifdataDyn.}
## ```
## ! Create a new ExifMem with default values for your convenience
##
## \return return a new default ExifMem
## ```
proc exif_log_new*(): ptr ExifLog {.importc, cdecl, impexifdataDyn.}
## ```
## ! Create a new logging instance.
## \see exif_log_free
##
## \return new instance of #ExifLog
## ```
proc exif_log_new_mem*(a1: ptr ExifMem): ptr ExifLog {.importc, cdecl,
impexifdataDyn.}
proc exif_log_ref*(log: ptr ExifLog) {.importc, cdecl, impexifdataDyn.}
proc exif_log_unref*(log: ptr ExifLog) {.importc, cdecl, impexifdataDyn.}
proc exif_log_free*(log: ptr ExifLog) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Delete instance of #ExifLog.
## \see exif_log_new
##
## \param[in] log #ExifLog
## \return new instance of #ExifLog
## ```
proc exif_log_code_get_title*(code: ExifLogCode): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a textual description of the given class of error log.
##
## \param[in] code logging message class
## \return textual description of the log class, or NULL if unknown
## ```
proc exif_log_code_get_message*(code: ExifLogCode): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a verbose description of the given class of error log.
##
## \param[in] code logging message class
## \return verbose description of the log class, or NULL if unknown
## ```
proc exif_log_set_func*(log: ptr ExifLog; `func`: ExifLogFunc; data: pointer) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Register log callback function.
## Calls to the log callback function are purely for diagnostic purposes.
##
## \param[in] log logging state variable
## \param[in] func callback function to set
## \param[in] data data to pass into callback function
## ```
proc exif_log*(log: ptr ExifLog; a2: ExifLogCode; domain: cstring;
format: cstring) {.importc, cdecl, impexifdataDyn, varargs.}
proc exif_logv*(log: ptr ExifLog; a2: ExifLogCode; domain: cstring;
format: cstring; args: va_list) {.importc, cdecl, impexifdataDyn.}
proc exif_tag_from_name*(name: cstring): ExifTag {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return the tag ID given its unique textual name.
##
## \param[in] name tag name
## \return tag ID, or 0 if tag not found
## \note The tag not found value cannot be distinguished from a legitimate
## tag number 0.
## ```
proc exif_tag_get_name_in_ifd*(tag: ExifTag; ifd: ExifIfd): cstring {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return a textual name of the given tag when found in the given IFD. The
## name is a short, unique, non-localized text string containing only
## US-ASCII alphanumeric characters.
##
## \param[in] tag EXIF tag
## \param[in] ifd IFD
## \return textual name of the tag, or NULL if the tag is unknown
## ```
proc exif_tag_get_title_in_ifd*(tag: ExifTag; ifd: ExifIfd): cstring {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return a textual title of the given tag when found in the given IFD.
## The title is a short, localized description of the tag.
##
## \param[in] tag EXIF tag
## \param[in] ifd IFD
## \return textual title of the tag, or NULL if the tag is unknown
## ```
proc exif_tag_get_description_in_ifd*(tag: ExifTag; ifd: ExifIfd): cstring {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Return a verbose textual description of the given tag when found in the
## given IFD. The description is a verbose, localized description of the tag.
##
## \param[in] tag EXIF tag
## \param[in] ifd IFD
## \return textual description of the tag, or NULL if the tag is unknown
## ```
proc exif_tag_get_support_level_in_ifd*(tag: ExifTag; ifd: ExifIfd;
t: ExifDataType): ExifSupportLevel {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Return whether the given tag is mandatory or not in the given IFD and
## data type according to the EXIF specification. If the IFD given is
## EXIF_IFD_COUNT, the result is EXIF_SUPPORT_LEVEL_UNKNOWN. If the data
## type is EXIF_DATA_TYPE_UNKNOWN, the result is
## EXIF_SUPPORT_LEVEL_UNKNOWN unless the support level is the same for
## all data types.
##
## \param[in] tag EXIF tag
## \param[in] ifd IFD or EXIF_IFD_COUNT
## \param[in] t data type or EXIF_DATA_TYPE_UNKNOWN
## \return the level of support for this tag
## ```
proc exif_tag_get_name*(tag: ExifTag): cstring {.importc, cdecl, impexifdataDyn.}
## ```
## Don't use these functions. They are here for compatibility only.
## ! \deprecated Use #exif_tag_get_name_in_ifd instead
## ```
proc exif_tag_get_title*(tag: ExifTag): cstring {.importc, cdecl, impexifdataDyn.}
## ```
## ! \deprecated Use #exif_tag_get_title_in_ifd instead
## ```
proc exif_tag_get_description*(tag: ExifTag): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! \deprecated Use #exif_tag_get_description_in_ifd instead
## ```
proc exif_tag_table_get_tag*(n: cuint): ExifTag {.importc, cdecl, impexifdataDyn.}
## ```
## For now, do not use these functions.
## ! \internal
## ```
proc exif_tag_table_get_name*(n: cuint): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! \internal
## ```
proc exif_tag_table_count*(): cuint {.importc, cdecl, impexifdataDyn.}
## ```
## ! \internal
## ```
proc exif_entry_new*(): ptr ExifEntry {.importc, cdecl, impexifdataDyn.}
## ```
## Lifecycle
## ! Reserve memory for and initialize a new #ExifEntry.
## No memory is allocated for the \c data element of the returned #ExifEntry.
##
## \return new allocated #ExifEntry, or NULL on error
##
## \see exif_entry_new_mem, exif_entry_unref
## ```
proc exif_entry_new_mem*(a1: ptr ExifMem): ptr ExifEntry {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Reserve memory for and initialize new #ExifEntry using the specified
## memory allocator.
## No memory is allocated for the \c data element of the returned #ExifEntry.
##
## \return new allocated #ExifEntry, or NULL on error
##
## \see exif_entry_new, exif_entry_unref
## ```
proc exif_entry_ref*(entry: ptr ExifEntry) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Increase reference counter for #ExifEntry.
##
## \param[in] entry #ExifEntry
##
## \see exif_entry_unref
## ```
proc exif_entry_unref*(entry: ptr ExifEntry) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Decrease reference counter for #ExifEntry.
## When the reference count drops to zero, free the entry.
##
## \param[in] entry #ExifEntry
## ```
proc exif_entry_free*(entry: ptr ExifEntry) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Actually free the #ExifEntry.
##
## \deprecated Should not be called directly. Use #exif_entry_ref and
## #exif_entry_unref instead.
##
## \param[in] entry EXIF entry
## ```
proc exif_entry_initialize*(e: ptr ExifEntry; tag: ExifTag) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Initialize an empty #ExifEntry with default data in the correct format
## for the given tag. If the entry is already initialized, this function
## does nothing.
## This call allocates memory for the \c data element of the given #ExifEntry.
## That memory is freed at the same time as the #ExifEntry.
##
## \param[out] e entry to initialize
## \param[in] tag tag number to initialize as
## ```
proc exif_entry_fix*(entry: ptr ExifEntry) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Fix the type or format of the given EXIF entry to bring it into spec.
## If the data for this EXIF tag is in of the wrong type or is in an invalid
## format according to the EXIF specification, then it is converted to make it
## valid. This may involve, for example, converting an EXIF_FORMAT_LONG into a
## EXIF_FORMAT_SHORT. If the tag is unknown, its value is untouched.
##
## \note Unfortunately, some conversions are to a type with a more restricted
## range, which could have the side effect that the converted data becomes
## invalid. This is unlikely as the range of each tag in the standard is
## designed to encompass all likely data.
##
## \param[in,out] entry EXIF entry
## ```
proc exif_entry_get_value*(entry: ptr ExifEntry; val: cstring; maxlen: cuint): cstring {.
importc, cdecl, impexifdataDyn.}
## ```
## For your convenience
## ! Return a localized textual representation of the value of the EXIF entry.
## This is meant for display to the user. The format of each tag is subject
## to change between locales and in newer versions of libexif. Users who
## require the tag data in an unambiguous form should access the data members
## of the #ExifEntry structure directly.
##
## \warning The character set of the returned string may be in
## the encoding of the current locale or the native encoding
## of the camera.
## \bug The EXIF_TAG_XP_* tags are currently always returned in UTF-8,
## regardless of locale, and code points above U+FFFF are not
## supported.
##
## \param[in] entry EXIF entry
## \param[out] val buffer in which to store value; if entry is valid and
## maxlen > 0 then this string will be NUL-terminated
## \param[in] maxlen length of the buffer val
## \return val pointer
## ```
proc exif_entry_dump*(entry: ptr ExifEntry; indent: cuint) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Dump text representation of #ExifEntry to stdout.
## This is intended for diagnostic purposes only.
##
## \param[in] entry EXIF tag data
## \param[in] indent how many levels deep to indent the data
## ```
proc exif_content_new*(): ptr ExifContent {.importc, cdecl, impexifdataDyn.}
## ```
## Lifecycle
## ! Reserve memory for and initialize a new #ExifContent.
##
## \return new allocated #ExifContent, or NULL on error
##
## \see exif_content_new_mem, exif_content_unref
## ```
proc exif_content_new_mem*(a1: ptr ExifMem): ptr ExifContent {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Reserve memory for and initialize new #ExifContent using the specified
## memory allocator.
##
## \return new allocated #ExifContent, or NULL on error
##
## \see exif_content_new, exif_content_unref
## ```
proc exif_content_ref*(content: ptr ExifContent) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Increase reference counter for #ExifContent.
##
## \param[in] content #ExifContent
##
## \see exif_content_unref
## ```
proc exif_content_unref*(content: ptr ExifContent) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Decrease reference counter for #ExifContent.
## When the reference count drops to zero, free the content.
##
## \param[in] content #ExifContent
## ```
proc exif_content_free*(content: ptr ExifContent) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Actually free the #ExifContent.
##
## \deprecated Should not be called directly. Use #exif_content_ref and
## #exif_content_unref instead.
##
## \param[in] content #ExifContent
## ```
proc exif_content_add_entry*(c: ptr ExifContent; entry: ptr ExifEntry) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Add an EXIF tag to an IFD.
## If this tag already exists in the IFD, this function does nothing.
## \pre The "tag" member of the entry must be set on entry.
##
## \param[out] c IFD
## \param[in] entry EXIF entry to add
## ```
proc exif_content_remove_entry*(c: ptr ExifContent; e: ptr ExifEntry) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Remove an EXIF tag from an IFD.
## If this tag does not exist in the IFD, this function does nothing.
##
## \param[out] c IFD
## \param[in] e EXIF entry to remove
## ```
proc exif_content_get_entry*(content: ptr ExifContent; tag: ExifTag): ptr ExifEntry {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Return the #ExifEntry in this IFD corresponding to the given tag.
## This is a pointer into a member of the #ExifContent array and must NOT be
## freed or unrefed by the caller.
##
## \param[in] content EXIF content for an IFD
## \param[in] tag EXIF tag to return
## \return #ExifEntry of the tag, or NULL on error
## ```
proc exif_content_fix*(c: ptr ExifContent) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Fix the IFD to bring it into specification. Call #exif_entry_fix on
## each entry in this IFD to fix existing entries, create any new entries
## that are mandatory in this IFD but do not yet exist, and remove any
## entries that are not allowed in this IFD.
##
## \param[in,out] c EXIF content for an IFD
## ```
proc exif_content_foreach_entry*(content: ptr ExifContent;
`func`: ExifContentForeachEntryFunc;
user_data: pointer) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Executes function on each EXIF tag in this IFD in turn.
## The tags will not necessarily be visited in numerical order.
##
## \param[in,out] content IFD over which to iterate
## \param[in] func function to call for each entry
## \param[in] user_data data to pass into func on each call
## ```
proc exif_content_get_ifd*(c: ptr ExifContent): ExifIfd {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return the IFD number in which the given #ExifContent is found.
##
## \param[in] c an #ExifContent*
## \return IFD number, or #EXIF_IFD_COUNT on error
## ```
proc exif_content_dump*(content: ptr ExifContent; indent: cuint) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Dump contents of the IFD to stdout.
## This is intended for diagnostic purposes only.
##
## \param[in] content IFD data
## \param[in] indent how many levels deep to indent the data
## ```
proc exif_content_log*(content: ptr ExifContent; log: ptr ExifLog) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Set the log message object for this IFD.
##
## \param[in] content IFD
## \param[in] log #ExifLog*
## ```
proc exif_mnote_data_ref*(a1: ptr ExifMnoteData) {.importc, cdecl,
impexifdataDyn.}
proc exif_mnote_data_unref*(a1: ptr ExifMnoteData) {.importc, cdecl,
impexifdataDyn.}
proc exif_mnote_data_load*(d: ptr ExifMnoteData; buf: ptr uint8; buf_size: cuint) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Load the MakerNote data from a memory buffer.
##
## \param[in] d MakerNote data
## \param[in] buf pointer to raw MakerNote tag data
## \param[in] buf_size number of bytes of data at buf
## ```
proc exif_mnote_data_save*(d: ptr ExifMnoteData; buf: ptr ptr uint8;
buf_size: ptr cuint) {.importc, cdecl, impexifdataDyn.}
## ```
## !
## Save the raw MakerNote data into a memory buffer. The buffer is
## allocated by this function and must subsequently be freed by the
## caller.
##
## \param[in,out] d extract the data from this structure
## \param[out] buf pointer to buffer pointer containing MakerNote data on return
## \param[out] buf_size pointer to the size of the buffer
## ```
proc exif_mnote_data_count*(d: ptr ExifMnoteData): cuint {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return the number of tags in the MakerNote.
##
## \param[in] d MakerNote data
## \return number of tags, or 0 if no MakerNote or the type is not supported
## ```
proc exif_mnote_data_get_id*(d: ptr ExifMnoteData; n: cuint): cuint {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return the MakerNote tag number for the tag at the specified index within
## the MakerNote.
##
## \param[in] d MakerNote data
## \param[in] n index of the entry within the MakerNote data
## \return MakerNote tag number
## ```
proc exif_mnote_data_get_name*(d: ptr ExifMnoteData; n: cuint): cstring {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Returns textual name of the given MakerNote tag. The name is a short,
## unique (within this type of MakerNote), non-localized text string
## containing only US-ASCII alphanumeric characters.
##
## \param[in] d MakerNote data
## \param[in] n index of the entry within the MakerNote data
## \return textual name of the tag or NULL on error
## ```
proc exif_mnote_data_get_title*(d: ptr ExifMnoteData; n: cuint): cstring {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Returns textual title of the given MakerNote tag.
## The title is a short, localized textual description of the tag.
##
## \param[in] d MakerNote data
## \param[in] n index of the entry within the MakerNote data
## \return textual name of the tag or NULL on error
## ```
proc exif_mnote_data_get_description*(d: ptr ExifMnoteData; n: cuint): cstring {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Returns verbose textual description of the given MakerNote tag.
##
## \param[in] d MakerNote data
## \param[in] n index of the entry within the MakerNote data
## \return textual description of the tag or NULL on error
## ```
proc exif_mnote_data_get_value*(d: ptr ExifMnoteData; n: cuint; val: cstring;
maxlen: cuint): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a textual representation of the value of the MakerNote entry.
##
## \warning The character set of the returned string may be in
## the encoding of the current locale or the native encoding
## of the camera.
##
## \param[in] d MakerNote data
## \param[in] n index of the entry within the MakerNote data
## \param[out] val buffer in which to store value
## \param[in] maxlen length of the buffer val
## \return val pointer, or NULL on error
## ```
proc exif_mnote_data_log*(a1: ptr ExifMnoteData; a2: ptr ExifLog) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! \file exif-mem.h
## \brief Define the ExifMem data type and the associated functions.
## ExifMem defines the memory management functions used within libexif.
##
## exif-mem.h
##
## Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net>
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
## Boston, MA 02110-1301 USA.
##
## ! Represents the entire EXIF data found in an image
## ```
proc exif_data_new*(): ptr ExifData {.importc, cdecl, impexifdataDyn.}
## ```
## ! Allocate a new #ExifData. The #ExifData contains an empty
## #ExifContent for each IFD and the default set of options,
## which has #EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS
## and #EXIF_DATA_OPTION_FOLLOW_SPECIFICATION set.
##
## \return allocated #ExifData, or NULL on error
## ```
proc exif_data_new_mem*(a1: ptr ExifMem): ptr ExifData {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Allocate a new #ExifData using the given memory allocator.
## The #ExifData contains an empty #ExifContent for each IFD and the default
## set of options, which has #EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS and
## #EXIF_DATA_OPTION_FOLLOW_SPECIFICATION set.
##
## \return allocated #ExifData, or NULL on error
## ```
proc exif_data_new_from_file*(path: cstring): ptr ExifData {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Allocate a new #ExifData and load EXIF data from a JPEG file.
## Uses an #ExifLoader internally to do the loading.
##
## \param[in] path filename including path
## \return allocated #ExifData, or NULL on error
## ```
proc exif_data_new_from_data*(data: ptr uint8; size: cuint): ptr ExifData {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Allocate a new #ExifData and load EXIF data from a memory buffer.
##
## \param[in] data pointer to raw JPEG or EXIF data
## \param[in] size number of bytes of data at data
## \return allocated #ExifData, or NULL on error
## ```
proc exif_data_load_data*(data: ptr ExifData; d: ptr uint8; size: cuint) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Load the #ExifData structure from the raw JPEG or EXIF data in the given
## memory buffer. If the EXIF data contains a recognized MakerNote, it is
## loaded and stored as well for later retrieval by #exif_data_get_mnote_data.
## If the #EXIF_DATA_OPTION_FOLLOW_SPECIFICATION option has been set on this
## #ExifData, then the tags are automatically fixed after loading (by calling
## #exif_data_fix).
##
## \param[in,out] data EXIF data
## \param[in] d pointer to raw JPEG or EXIF data
## \param[in] size number of bytes of data at d
## ```
proc exif_data_save_data*(data: ptr ExifData; d: ptr ptr uint8; ds: ptr cuint) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Store raw EXIF data representing the #ExifData structure into a memory
## buffer. The buffer is allocated by this function and must subsequently be
## freed by the caller using the matching free function as used by the #ExifMem
## in use by this #ExifData.
##
## \param[in] data EXIF data
## \param[out] d pointer to buffer pointer containing raw EXIF data on return
## \param[out] ds pointer to variable to hold the number of bytes of
## data at d, or set to 0 on error
## ```
proc exif_data_ref*(data: ptr ExifData) {.importc, cdecl, impexifdataDyn.}
proc exif_data_unref*(data: ptr ExifData) {.importc, cdecl, impexifdataDyn.}
proc exif_data_free*(data: ptr ExifData) {.importc, cdecl, impexifdataDyn.}
proc exif_data_get_byte_order*(data: ptr ExifData): ExifByteOrder {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return the byte order in use by this EXIF structure.
##
## \param[in] data EXIF data
## \return byte order
## ```
proc exif_data_set_byte_order*(data: ptr ExifData; order: ExifByteOrder) {.
importc, cdecl, impexifdataDyn.}
## ```
## ! Set the byte order to use for this EXIF data. If any tags already exist
## (including MakerNote tags) they are are converted to the specified byte
## order.
##
## \param[in,out] data EXIF data
## \param[in] order byte order
## ```
proc exif_data_get_mnote_data*(d: ptr ExifData): ptr ExifMnoteData {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return the MakerNote data out of the EXIF data. Only certain
## MakerNote formats that are recognized by libexif are supported.
## The pointer references a member of the #ExifData structure and must NOT be
## freed by the caller.
##
## \param[in] d EXIF data
## \return MakerNote data, or NULL if not found or not supported
## ```
proc exif_data_fix*(d: ptr ExifData) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Fix the EXIF data to bring it into specification. Call #exif_content_fix
## on each IFD to fix existing entries, create any new entries that are
## mandatory but do not yet exist, and remove any entries that are not
## allowed.
##
## \param[in,out] d EXIF data
## ```
proc exif_data_foreach_content*(data: ptr ExifData;
`func`: ExifDataForeachContentFunc;
user_data: pointer) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Execute a function on each IFD in turn.
##
## \param[in] data EXIF data over which to iterate
## \param[in] func function to call for each entry
## \param[in] user_data data to pass into func on each call
## ```
proc exif_data_option_get_name*(o: ExifDataOption): cstring {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return a short textual description of the given #ExifDataOption.
##
## \param[in] o option
## \return localized textual description of the option,
## or NULL if unknown
## ```
proc exif_data_option_get_description*(o: ExifDataOption): cstring {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Return a verbose textual description of the given #ExifDataOption.
##
## \param[in] o option
## \return verbose localized textual description of the option,
## or NULL if unknown
## ```
proc exif_data_set_option*(d: ptr ExifData; o: ExifDataOption) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Set the given option on the given #ExifData.
##
## \param[in] d EXIF data
## \param[in] o option
## ```
proc exif_data_unset_option*(d: ptr ExifData; o: ExifDataOption) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Clear the given option on the given #ExifData.
##
## \param[in] d EXIF data
## \param[in] o option
## ```
proc exif_data_set_data_type*(d: ptr ExifData; dt: ExifDataType) {.importc,
cdecl, impexifdataDyn.}
## ```
## ! Set the data type for the given #ExifData.
##
## \param[in] d EXIF data
## \param[in] dt data type
## ```
proc exif_data_get_data_type*(d: ptr ExifData): ExifDataType {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Return the data type for the given #ExifData.
##
## \param[in] d EXIF data
## \return data type, or #EXIF_DATA_TYPE_UNKNOWN on error
## ```
proc exif_data_dump*(data: ptr ExifData) {.importc, cdecl, impexifdataDyn.}
## ```
## ! Dump all EXIF data to stdout.
## This is intended for diagnostic purposes only.
##
## \param[in] data EXIF data
## ```
proc exif_data_log*(data: ptr ExifData; log: ptr ExifLog) {.importc, cdecl,
impexifdataDyn.}
## ```
## ! Set the log message object for all IFDs.
##
## \param[in] data EXIF data
## \param[in] log #ExifLog
## ```
{.pop.}