home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libexif / exif-utils.h < prev   
Encoding:
C/C++ Source or Header  |  2007-06-13  |  3.2 KB  |  88 lines

  1. /* exif-utils.h
  2.  *
  3.  * Copyright ⌐ 2001 Lutz Mⁿller <lutz@users.sourceforge.net>
  4.  *
  5.  * This library is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU Lesser General Public
  7.  * License as published by the Free Software Foundation; either
  8.  * version 2 of the License, or (at your option) any later version.
  9.  *
  10.  * This library is distributed in the hope that it will be useful, 
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  * Lesser General Public License for more details. 
  14.  *
  15.  * You should have received a copy of the GNU Lesser General Public
  16.  * License along with this library; if not, write to the
  17.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18.  * Boston, MA 02111-1307, USA.
  19.  */
  20.  
  21. #ifndef __EXIF_UTILS_H__
  22. #define __EXIF_UTILS_H__
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif /* __cplusplus */
  27.  
  28. #include <libexif/exif-byte-order.h>
  29. #include <libexif/exif-format.h>
  30. #include <libexif/_stdint.h>
  31.  
  32.  
  33. /* If these definitions don't work for you, please let us fix the 
  34.  * macro generating _stdint.h */
  35.     
  36. typedef unsigned char    ExifByte;          /* 1 byte  */
  37. typedef signed char    ExifSByte;         /* 1 byte  */
  38. typedef char *        ExifAscii;
  39. typedef uint16_t    ExifShort;         /* 2 bytes */
  40. typedef int16_t         ExifSShort;        /* 2 bytes */
  41. typedef uint32_t    ExifLong;          /* 4 bytes */
  42. typedef struct {ExifLong numerator; ExifLong denominator;} ExifRational;
  43. typedef char        ExifUndefined;     /* 1 byte  */
  44. typedef int32_t        ExifSLong;         /* 4 bytes */
  45. typedef struct {ExifSLong numerator; ExifSLong denominator;} ExifSRational;
  46.  
  47.  
  48. ExifShort     exif_get_short     (const unsigned char *b, ExifByteOrder order);
  49. ExifSShort    exif_get_sshort    (const unsigned char *b, ExifByteOrder order);
  50. ExifLong      exif_get_long      (const unsigned char *b, ExifByteOrder order);
  51. ExifSLong     exif_get_slong     (const unsigned char *b, ExifByteOrder order);
  52. ExifRational  exif_get_rational  (const unsigned char *b, ExifByteOrder order);
  53. ExifSRational exif_get_srational (const unsigned char *b, ExifByteOrder order);
  54.  
  55. void exif_set_short     (unsigned char *b, ExifByteOrder order,
  56.              ExifShort value);
  57. void exif_set_sshort    (unsigned char *b, ExifByteOrder order,
  58.              ExifSShort value);
  59. void exif_set_long      (unsigned char *b, ExifByteOrder order,
  60.              ExifLong value);
  61. void exif_set_slong     (unsigned char *b, ExifByteOrder order,
  62.              ExifSLong value);
  63. void exif_set_rational  (unsigned char *b, ExifByteOrder order,
  64.              ExifRational value);
  65. void exif_set_srational (unsigned char *b, ExifByteOrder order,
  66.              ExifSRational value);
  67.  
  68. void exif_convert_utf16_to_utf8 (char *out, const unsigned short *in, int maxlen);
  69.  
  70. /* Please do not use this function outside of the library. */
  71. void exif_array_set_byte_order (ExifFormat, unsigned char *, unsigned int,
  72.         ExifByteOrder o_orig, ExifByteOrder o_new);
  73.  
  74. #undef  MIN
  75. #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
  76.  
  77. #undef  MAX
  78. #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
  79.  
  80. /* For compatibility with older versions */
  81. #define EXIF_TAG_SUBSEC_TIME EXIF_TAG_SUB_SEC_TIME
  82.  
  83. #ifdef __cplusplus
  84. }
  85. #endif /* __cplusplus */
  86.  
  87. #endif /* __EXIF_UTILS_H__ */
  88.