EXIF library (libexif) API: libexif/exif-utils.h Source File

- Main Page
- Files
- Directories
- Related Pages

- File List
- Globals

# exif-utils.h

    00001 /* exif-utils.h
    00002  *
    00003  * Copyright © 2001 Lutz Müller <lutz@users.sourceforge.net>
    00004  *
    00005  * This library is free software; you can redistribute it and/or
    00006  * modify it under the terms of the GNU Lesser General Public
    00007  * License as published by the Free Software Foundation; either
    00008  * version 2 of the License, or (at your option) any later version.
    00009  *
    00010  * This library is distributed in the hope that it will be useful,
    00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013  * Lesser General Public License for more details.
    00014  *
    00015  * You should have received a copy of the GNU Lesser General Public
    00016  * License along with this library; if not, write to the
    00017  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00018  * Boston, MA 02111-1307, USA.
    00019  */
    00020
    00021 #ifndef __EXIF_UTILS_H__
    00022 #define __EXIF_UTILS_H__
    00023
    00024 #ifdef __cplusplus
    00025 extern "C" {
    00026 #endif /* __cplusplus */
    00027
    00028 #include <libexif/exif-byte-order.h>
    00029 #include <libexif/exif-format.h>
    00030 #include <libexif/_stdint.h>
    00031
    00032
    00033 /* If these definitions don't work for you, please let us fix the
    00034  * macro generating _stdint.h */
    00035
    00036 typedef unsigned char   ExifByte;          /* 1 byte  */
    00037 typedef signed char     ExifSByte;         /* 1 byte  */
    00038 typedef char *          ExifAscii;
    00039 typedef uint16_t        ExifShort;         /* 2 bytes */
    00040 typedef int16_t         ExifSShort;        /* 2 bytes */
    00041 typedef uint32_t        ExifLong;          /* 4 bytes */
    00042 typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational;
    00043 typedef char            ExifUndefined;     /* 1 byte  */
    00044 typedef int32_t         ExifSLong;         /* 4 bytes */
    00045 typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational;
    00046
    00047
    00048 ExifShort     exif_get_short     (const unsigned char *b, ExifByteOrder order);
    00049 ExifSShort    exif_get_sshort    (const unsigned char *b, ExifByteOrder order);
    00050 ExifLong      exif_get_long      (const unsigned char *b, ExifByteOrder order);
    00051 ExifSLong     exif_get_slong     (const unsigned char *b, ExifByteOrder order);
    00052 ExifRational  exif_get_rational  (const unsigned char *b, ExifByteOrder order);
    00053 ExifSRational exif_get_srational (const unsigned char *b, ExifByteOrder order);
    00054
    00055 void exif_set_short     (unsigned char *b, ExifByteOrder order,
    00056                          ExifShort value);
    00057 void exif_set_sshort    (unsigned char *b, ExifByteOrder order,
    00058                          ExifSShort value);
    00059 void exif_set_long      (unsigned char *b, ExifByteOrder order,
    00060                          ExifLong value);
    00061 void exif_set_slong     (unsigned char *b, ExifByteOrder order,
    00062                          ExifSLong value);
    00063 void exif_set_rational  (unsigned char *b, ExifByteOrder order,
    00064                          ExifRational value);
    00065 void exif_set_srational (unsigned char *b, ExifByteOrder order,
    00066                          ExifSRational value);
    00067
    00068 void exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int maxlen);
    00069
    00070 /* Please do not use this function outside of the library. */
    00071 void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int,
    00072                 ExifByteOrder o_orig, ExifByteOrder o_new);
    00073
    00074 #undef  MIN
    00075 #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
    00076
    00077 #undef  MAX
    00078 #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
    00079
    00080 /* For compatibility with older versions */
    00081 #define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME
    00082
    00083 #ifdef __cplusplus
    00084 }
    00085 #endif /* __cplusplus */
    00086
    00087 #endif /* __EXIF_UTILS_H__ */