M4EXIFC_CommonAPI.h revision b5c7784c96a606890eb8a8b560153ef4a5d1a0d9
1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16/** 17 ****************************************************************************** 18 * @file M4EXIFC_CommonAPI.h 19 * @brief EXIF common data header 20 * @note The types, structures and macros defined in this file allow reading 21 * and writing EXIF JPEG images compliant spec EXIF 2.2 22 ****************************************************************************** 23*/ 24 25 26#ifndef __M4_EXIF_COMMON_API_H__ 27#define __M4_EXIF_COMMON_API_H__ 28 29#include "M4TOOL_VersionInfo.h" 30#include "M4Common_types.h" 31#include "M4OSA_Debug.h" 32#include "M4OSA_Error.h" 33#include "M4OSA_Types.h" 34#include "M4OSA_Memory.h" 35#include "M4OSA_CoreID.h" 36 37#ifdef __cplusplus 38extern "C" { 39#endif 40 41/** 42 ************************************************************************ 43 * type M4EXIFC_Context 44 ************************************************************************ 45*/ 46typedef M4OSA_Void* M4EXIFC_Context; 47 48/** 49 ****************************************************************************** 50 * Errors & Warnings 51 ****************************************************************************** 52*/ 53 54#define M4EXIFC_NO_ERR 0x00000000 /**< invalid parameter */ 55#define M4EXIFC_ERR_PARAMETER 0x00000001 /**< invalid parameter */ 56#define M4EXIFC_ERR_ALLOC 0x00000002 /**< allocation error */ 57#define M4EXIFC_ERR_BAD_CONTEXT 0x00000003 /**< invalid context */ 58#define M4EXIFC_ERR_NOT_COMPLIANT 0x00000004 /**< the image in buffer is not 59 JPEG compliant */ 60#define M4EXIFC_ERR_NO_APP_FOUND 0x00000005 /**< the JPEG image does not contain any APP1 61 Exif 2.2 compliant */ 62#define M4EXIFC_WAR_NO_THUMBNAIL 0x00000006 /**< the Exif part does not contain any 63 thumbnail */ 64#define M4EXIFC_ERR_APP_TRUNCATED 0x00000007 /**< The APP1 section in input buffer is 65 not complete */ 66 67 68/** 69 ****************************************************************************** 70 * structure M4EXIFC_BasicTags 71 * @brief This structure stores the basic tags values. 72 * @note This Exif reader focuses on a set of "Entry Tags". 73 * This structure contains the corresponding "Entry Values" of these tags. 74 * M4EXIFC_Char* fields of structure are Null terminated Strings. 75 ****************************************************************************** 76*/ 77typedef struct 78{ 79 M4OSA_Int32 width; /**< image width in pixels */ 80 M4OSA_Int32 height; /**< image height in pixels */ 81 M4OSA_Char *creationDateTime; /**< date and time original image was generated */ 82 M4OSA_Char *lastChangeDateTime; /**< file change date and time */ 83 M4OSA_Char *description; /**< image title */ 84 M4OSA_Char *make; /**< manufacturer of image input equipment */ 85 M4OSA_Char *model; /**< model of image input equipment */ 86 M4OSA_Char *software; /**< software used */ 87 M4OSA_Char *artist; /**< person who created the image */ 88 M4OSA_Char *copyright; /**< copyright holder */ 89 M4COMMON_Orientation orientation; /**< orientation of image */ 90 M4OSA_Int32 thumbnailSize; /**< size of the thumbnail */ 91 M4OSA_UInt8 *thumbnailImg; /**< pointer to the thumbnail in main image buffer*/ 92 M4OSA_Char *latitudeRef; /**< latitude reference */ 93 M4COMMON_Location latitude; /**< latitude */ 94 M4OSA_Char *longitudeRef; /**< longitude reference */ 95 M4COMMON_Location longitude; /**< longitude */ 96 97} M4EXIFC_BasicTags; 98 99 100/** 101 ****************************************************************************** 102 * M4OSA_ERR M4EXIFC_getVersion (M4_VersionInfo *pVersion) 103 * @brief get the version numbers of the exif library. 104 * @note This function retrieves the version numbers in a structure. 105 * @param pVersion: (OUT) the structure containing version numbers 106 * @return M4NO_ERROR: there is no error 107 * @return M4EXIFC_ERR_PARAMETER: (Debug only) the parameter is M4EXIFC_NULL. 108 ****************************************************************************** 109*/ 110M4OSA_ERR M4EXIFC_getVersion (M4_VersionInfo *pVersion); 111 112 113 114#ifdef __cplusplus 115} 116#endif /* __cplusplus*/ 117#endif /* __M4_EXIF_COMMON_API_H__ */ 118 119