EXIF library (libexif) API
0.6.20
|
00001 00004 /* 00005 * Copyright (c) 2001 Lutz Mueller <lutz@users.sourceforge.net> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the 00019 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 * Boston, MA 02110-1301 USA. 00021 */ 00022 00023 #ifndef __EXIF_UTILS_H__ 00024 #define __EXIF_UTILS_H__ 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif /* __cplusplus */ 00029 00030 #include <libexif/exif-byte-order.h> 00031 #include <libexif/exif-format.h> 00032 #include <libexif/_stdint.h> 00033 00034 00035 /* If these definitions don't work for you, please let us fix the 00036 * macro generating _stdint.h */ 00037 00039 typedef unsigned char ExifByte; /* 1 byte */ 00040 00042 typedef signed char ExifSByte; /* 1 byte */ 00043 00045 typedef char * ExifAscii; 00046 00048 typedef uint16_t ExifShort; /* 2 bytes */ 00049 00051 typedef int16_t ExifSShort; /* 2 bytes */ 00052 00054 typedef uint32_t ExifLong; /* 4 bytes */ 00055 00057 typedef int32_t ExifSLong; /* 4 bytes */ 00058 00060 typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational; 00061 00062 typedef char ExifUndefined; /* 1 byte */ 00063 00065 typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational; 00066 00067 00074 ExifShort exif_get_short (const unsigned char *b, ExifByteOrder order); 00075 00082 ExifSShort exif_get_sshort (const unsigned char *b, ExifByteOrder order); 00083 00090 ExifLong exif_get_long (const unsigned char *b, ExifByteOrder order); 00091 00098 ExifSLong exif_get_slong (const unsigned char *b, ExifByteOrder order); 00099 00106 ExifRational exif_get_rational (const unsigned char *b, ExifByteOrder order); 00107 00114 ExifSRational exif_get_srational (const unsigned char *b, ExifByteOrder order); 00115 00122 void exif_set_short (unsigned char *b, ExifByteOrder order, 00123 ExifShort value); 00124 00131 void exif_set_sshort (unsigned char *b, ExifByteOrder order, 00132 ExifSShort value); 00133 00140 void exif_set_long (unsigned char *b, ExifByteOrder order, 00141 ExifLong value); 00142 00149 void exif_set_slong (unsigned char *b, ExifByteOrder order, 00150 ExifSLong value); 00151 00158 void exif_set_rational (unsigned char *b, ExifByteOrder order, 00159 ExifRational value); 00160 00167 void exif_set_srational (unsigned char *b, ExifByteOrder order, 00168 ExifSRational value); 00169 00171 void exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int maxlen); 00172 00173 /* Please do not use this function outside of the library. */ 00174 00176 void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int, 00177 ExifByteOrder o_orig, ExifByteOrder o_new); 00178 00179 #undef MIN 00180 #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 00181 00182 #undef MAX 00183 #define MAX(a, b) (((a) > (b)) ? (a) : (b)) 00184 00185 /* For compatibility with older versions */ 00186 00188 #define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME 00189 00190 #ifdef __cplusplus 00191 } 00192 #endif /* __cplusplus */ 00193 00194 #endif /* __EXIF_UTILS_H__ */