📄 exif.h
字号:
/*-----------------------------------------------------------------------------\
@ModuleName :: EXIF.h
@Description :: EXIF 2.1 wrapper for JPEG bitstream
For more info on EXIF refer EXIF 2.1 specification
Assumptions :
EXIF Writer
1. Image JPEG
2. No thumbnail
3. Support all Mandatory tags and few optional tags.
4. Make provision to extend support for thumbnails, other optional tags.
5. Generates Big Endian Data
EXIF Reader
1. Parse all tags.
2. Evaluate all mandatory tags and the few optional tags supported by EXIF writer.
3. Make provision to extend evaluation for thumbnails, other optional tags.
4. Will parse both Big and Little Endian Exif Files
@Copyright :: Copyright 2001- Texas Instruments, Inc.
@History ::
-------------------------------------------------------------------------------
Jan. 02, 2002 Kedar C (kedarc@ti.com) Start
\-----------------------------------------------------------------------------*/
#ifndef __EXIF_H__
#define __EXIF_H__
/* include files */
#include <util/util.h>
/* consts and externs */
/* EXIF IFD types */
typedef enum {
IFD_0, IFD_1, IFD_EXIF, IFD_GPS, IFD_INTEROPERABILTY
} IFD_TYPE;
/* EXIF data format types */
typedef enum {
EXIF_BYTE=1 , EXIF_ASCII , EXIF_SHORT , EXIF_LONG , EXIF_RATIONAL ,
EXIF_RESERVED0 , EXIF_UNDEFINED, EXIF_RESERVED1, EXIF_SLONG, EXIF_SRATIONAL
} EXIF_TYPE;
/* EXIF Tag values */
#define EXIF_MAKE "Rerun"
#define EXIF_MODEL "DM270 EVM"
#define EXIF_COPYRIGHT "Texas Instruments Inc. , DM270 EVM Copyright 2001-2002"
#define EXIF_SOFTWARE "DM270 Demo Software "
#define EXIF_XRES 72
#define EXIF_YRES 72
#define EXIF_RES_UNIT 2 /* inches */
#define EXIF_YCrCb_POS 1 /* centered */
#define EXIF_VERSION MAKE_TAG('0','2','1','0')
#define EXIF_COMP_CONF 0x01020300 /* Y Cb Cr */
#define EXIF_COLOR_SPACE 0x1 /* sRGB */
/* TIFF Header Offset from start of APP1 marker */
#define TIFF_HEADER_OFFSET 10
/* EXIF tags */
#define EXIF_APP1_TAG 0xFFE1
#define EXIF_MAKE_TAG 0x10F
#define EXIF_MODEL_TAG 0x110
#define EXIF_XRES_TAG 0x11A
#define EXIF_YRES_TAG 0x11B
#define EXIF_RES_UNIT_TAG 0x128
#define EXIF_SOFTWARE_TAG 0x131
#define EXIF_YCBCR_POSITION_TAG 0x213
#define EXIF_COPYRIGHT_TAG 0x8298
#define EXIF_EXIF_IFD_PTR_TAG 0x8769
#define EXIF_EXIF_VERSION_TAG 0x9000
#define EXIF_COMP_CONF_TAG 0x9101
#define EXIF_COLOR_SPACE_TAG 0xA001
#define EXIF_PIX_X_DIM_TAG 0xA002
#define EXIF_PIX_Y_DIM_TAG 0xA003
/* Added by Manoj */
#define EXIF_COMPRESSION_TAG 0x103
#define EXIF_JPEGINTER_FORMAT_TAG 0x201
#define EXIF_JPEGINTER_FORMAT_LENGTH_TAG 0x202
/* structs */
typedef struct {
Uint16 tag;
Uint16 type;
Uint32 count;
Uint32 offset;
} EXIF_TAG;
/* EXIF Configuration structure */
typedef struct {
BOOL bswap; /* by default big Endian code is generated */
Uint8 *make;
Uint8 *model;
Uint8 *copyright;
Uint8 *software;
Uint32 XRes;
Uint32 YRes;
Uint16 ResUnit;
Uint16 YCbCrPosition;
Uint32 EXIFVersion; /* '0210' */
Uint32 CompConf;
Uint16 ColorSpace;
Uint16 PixXDim;
Uint16 PixYDim;
/* Added by Manoj */
BOOL thumbPresent;
Uint32 IFD1OffsetField;
Uint32 thumbDataOffsetField;
Uint32 thumbDataOffset;
Uint16 compression;
Uint8 *thumbAddr;
Uint32 thumbSize;
} EXIFParams;
/* function prototypes */
STATUS EXIFInitParams( EXIFParams *prmExif, Uint8 *jpegAddr, Uint32 size,Uint8 *thumbAddr, Uint32 thumbSize);
STATUS EXIFShowParams( EXIFParams *prmExif);
STATUS EXIFFreeParams( EXIFParams *prmExif);
STATUS EXIFMakeHeader( EXIFParams *prmExif, Uint8 *exifHeader, Uint32 *exifSize);
STATUS EXIFMakeIFD0(EXIFParams *prmExif, WordStream *exif );
STATUS EXIFMakeIFD1(EXIFParams *prmExif, WordStream *exif );
STATUS EXIFMakeIFDExif(EXIFParams *prmExif, WordStream *exif );
STATUS ExifMakeTag(WordStream *exif, Uint16 tag, EXIF_TYPE type, Uint32 count, Uint32 offset);
STATUS EXIFParseHeader( EXIFParams *prmExif, Uint8 *exifHeader);
STATUS EXIFParseIFD( EXIFParams *prmExif, Uint8 *exifHeader, Uint8 *ifd, IFD_TYPE ifdType);
STATUS EXIFParseIFD0Tag(EXIFParams *prmExif, Uint8 *tiff, EXIF_TAG *tag);
STATUS EXIFParseIFDExifTag(EXIFParams *prmExif, Uint8 *tiff, EXIF_TAG *tag);
STATUS EXIFParseIFD1Tag(EXIFParams *prmExif, Uint8 *tiff, EXIF_TAG *tag);
#endif /* __EXIF_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -