exif-mnote-data.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*! \file exif-mnote-data.h
  2. * \brief Handling EXIF MakerNote tags
  3. */
  4. /*
  5. * Copyright (c) 2003 Lutz Mueller <lutz@users.sourceforge.net>
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with this library; if not, write to the
  19. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. * Boston, MA 02110-1301 USA.
  21. */
  22. #ifndef __EXIF_MNOTE_DATA_H__
  23. #define __EXIF_MNOTE_DATA_H__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif /* __cplusplus */
  27. #include <libexif/exif-log.h>
  28. /*! Data found in the MakerNote tag */
  29. typedef struct _ExifMnoteData ExifMnoteData;
  30. void exif_mnote_data_ref (ExifMnoteData *);
  31. void exif_mnote_data_unref (ExifMnoteData *);
  32. /*! Load the MakerNote data from a memory buffer.
  33. *
  34. * \param[in] d MakerNote data
  35. * \param[in] buf pointer to raw MakerNote tag data
  36. * \param[in] buf_siz number of bytes of data at buf
  37. */
  38. void exif_mnote_data_load (ExifMnoteData *d, const unsigned char *buf,
  39. unsigned int buf_siz);
  40. /*!
  41. * Save the raw MakerNote data into a memory buffer. The buffer is
  42. * allocated by this function and must subsequently be freed by the
  43. * caller.
  44. *
  45. * \param[in,out] d extract the data from this structure
  46. * \param[out] buf pointer to buffer pointer containing MakerNote data on return
  47. * \param[out] buf_siz pointer to the size of the buffer
  48. */
  49. void exif_mnote_data_save (ExifMnoteData *d, unsigned char **buf,
  50. unsigned int *buf_siz);
  51. /*! Return the number of tags in the MakerNote.
  52. *
  53. * \param[in] d MakerNote data
  54. * \return number of tags, or 0 if no MakerNote or the type is not supported
  55. */
  56. unsigned int exif_mnote_data_count (ExifMnoteData *d);
  57. /*! Return the MakerNote tag number for the tag at the specified index within
  58. * the MakerNote.
  59. *
  60. * \param[in] d MakerNote data
  61. * \param[in] n index of the entry within the MakerNote data
  62. * \return MakerNote tag number
  63. */
  64. unsigned int exif_mnote_data_get_id (ExifMnoteData *d, unsigned int n);
  65. /*! Returns textual name of the given MakerNote tag. The name is a short,
  66. * unique (within this type of MakerNote), non-localized text string
  67. * containing only US-ASCII alphanumeric characters.
  68. *
  69. * \param[in] d MakerNote data
  70. * \param[in] n index of the entry within the MakerNote data
  71. * \return textual name of the tag
  72. */
  73. const char *exif_mnote_data_get_name (ExifMnoteData *d, unsigned int n);
  74. /*! Returns textual title of the given MakerNote tag.
  75. * The title is a short, localized textual description of the tag.
  76. *
  77. * \param[in] d MakerNote data
  78. * \param[in] n index of the entry within the MakerNote data
  79. * \return textual name of the tag
  80. */
  81. const char *exif_mnote_data_get_title (ExifMnoteData *d, unsigned int n);
  82. /*! Returns verbose textual description of the given MakerNote tag.
  83. *
  84. * \param[in] d MakerNote data
  85. * \param[in] n index of the entry within the MakerNote data
  86. * \return textual description of the tag
  87. */
  88. const char *exif_mnote_data_get_description (ExifMnoteData *d, unsigned int n);
  89. /*! Return a textual representation of the value of the MakerNote entry.
  90. *
  91. * \warning The character set of the returned string may be in
  92. * the encoding of the current locale or the native encoding
  93. * of the camera.
  94. *
  95. * \param[in] d MakerNote data
  96. * \param[in] n index of the entry within the MakerNote data
  97. * \param[out] val buffer in which to store value
  98. * \param[in] maxlen length of the buffer val
  99. * \return val pointer, or NULL on error
  100. */
  101. char *exif_mnote_data_get_value (ExifMnoteData *d, unsigned int n, char *val, unsigned int maxlen);
  102. void exif_mnote_data_log (ExifMnoteData *, ExifLog *);
  103. #ifdef __cplusplus
  104. }
  105. #endif /* __cplusplus */
  106. #endif /* __EXIF_MNOTE_DATA_H__ */