| 1 |
#ifndef EXIF_H_INCLUDED |
| 2 |
#define EXIF_H_INCLUDED |
| 3 |
|
| 4 |
#include <stdio.h> |
| 5 |
#include "netpbm/pm_c_util.h" |
| 6 |
|
| 7 |
#define MAX_COMMENT 2000 |
| 8 |
|
| 9 |
#if MSVCRT |
| 10 |
#define PATH_MAX _MAX_PATH |
| 11 |
#endif |
| 12 |
|
| 13 |
typedef struct { |
| 14 |
/*-------------------------------------------------------------------------- |
| 15 |
A structure of this type contains the information from an EXIF header |
| 16 |
Image File Directory (IFD). |
| 17 |
|
| 18 |
It appears that some of these members are possible only for certain kinds of |
| 19 |
IFD (e.g. ThumbnailSize does not appear in a legal IFD for a main image), |
| 20 |
but we recognize all tags in all IFDs all the same. |
| 21 |
--------------------------------------------------------------------------*/ |
| 22 |
/* In all of the following members, a null pointer means "not present," |
| 23 |
which normally means the tag from which the information comes was |
| 24 |
not present in the IFD. |
| 25 |
|
| 26 |
The EXIF format might require certain tags to be present, but we |
| 27 |
don't. |
| 28 |
*/ |
| 29 |
const char * cameraMake; |
| 30 |
const char * cameraModel; |
| 31 |
const char * dateTime; |
| 32 |
float * xResolutionP; |
| 33 |
float * yResolutionP; |
| 34 |
int * orientationP; |
| 35 |
int * isColorP; |
| 36 |
int * flashP; |
| 37 |
float * focalLengthP; |
| 38 |
float * exposureTimeP; |
| 39 |
unsigned int * shutterSpeedP; /* e.g. 128 for 1/128 second */ |
| 40 |
float * apertureFNumberP; |
| 41 |
float * distanceP; |
| 42 |
float * exposureBiasP; |
| 43 |
int * whiteBalanceP; |
| 44 |
int * meteringModeP; |
| 45 |
int * exposureProgramP; |
| 46 |
int * isoEquivalentP; |
| 47 |
int * compressionLevelP; |
| 48 |
const char * comments; |
| 49 |
unsigned int * thumbnailOffsetP; |
| 50 |
unsigned int * thumbnailLengthP; |
| 51 |
unsigned int * exifImageLengthP; |
| 52 |
unsigned int * exifImageWidthP; |
| 53 |
double * focalPlaneXResP; |
| 54 |
double * focalPlaneUnitsP; |
| 55 |
|
| 56 |
const unsigned char * thumbnail; /* Pointer at the thumbnail */ |
| 57 |
unsigned thumbnailSize; /* Size of thumbnail. */ |
| 58 |
} exif_ifd; |
| 59 |
|
| 60 |
|
| 61 |
typedef struct { |
| 62 |
/*-------------------------------------------------------------------------- |
| 63 |
A structure of this type contains the information from an EXIF header. |
| 64 |
--------------------------------------------------------------------------*/ |
| 65 |
exif_ifd mainImage; /* aka IFD0 */ |
| 66 |
exif_ifd thumbnailImage; /* aka IFD1 */ |
| 67 |
float * ccdWidthP; /* NULL means none */ |
| 68 |
} exif_ImageInfo; |
| 69 |
|
| 70 |
|
| 71 |
/* Prototypes for exif.c functions. */ |
| 72 |
|
| 73 |
void |
| 74 |
exif_parse(const unsigned char * const exifSection, |
| 75 |
unsigned int const length, |
| 76 |
exif_ImageInfo * const imageInfoP, |
| 77 |
bool const wantTagTrace, |
| 78 |
const char ** const errorP); |
| 79 |
|
| 80 |
void |
| 81 |
exif_showImageInfo(const exif_ImageInfo * const imageInfoP); |
| 82 |
|
| 83 |
void |
| 84 |
exif_terminateImageInfo(exif_ImageInfo * const imageInfoP); |
| 85 |
|
| 86 |
#endif |