commit c01ab3532975370c3b35b1056f52d02c7df616e0
parent 19b1f6e289e5c5804b72f3bdcc2b73328b1b8b0f
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 29 Jan 2022 11:50:28 +0100
parent 19b1f6e289e5c5804b72f3bdcc2b73328b1b8b0f
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 29 Jan 2022 11:50:28 +0100
add prewrapped libexif
1 file changed, 1404 insertions(+), 0 deletions(-)
A
|
1404
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/nimexif/libexif_prewrapped.nim b/nimexif/libexif_prewrapped.nim @@ -0,0 +1,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.}