45#ifndef N_TIFF_HEADER_GUARD
46#define N_TIFF_HEADER_GUARD
61#define N_TIFF_MAGIC 42
63#define N_TIFF_MAGIC_DCP 0x4352
size_t offset
where the values start in the buffer, already checked to hold them
N_TIFF_ENTRY * entries
the entries whose values lie inside the buffer, in file order
uint16_t type
TIFF field type, 1 BYTE to 12 DOUBLE.
const unsigned char * data
the buffer, borrowed
uint32_t count
number of values
int big_endian
1 for "MM" (Motorola, big endian), 0 for "II"
uint16_t magic
the 16 bit value after the byte order mark
N_TIFF * n_tiff_parse(const unsigned char *data, size_t len)
Parse the first directory of a TIFF structured buffer.
size_t n_tiff_count(const N_TIFF *tiff, uint16_t tag)
How many values a tag has.
size_t n_tiff_get_doubles(const N_TIFF *tiff, uint16_t tag, double *out, size_t max)
Read a numeric tag as doubles.
const N_TIFF_ENTRY * n_tiff_find(const N_TIFF *tiff, uint16_t tag)
Find an entry by tag.
int n_tiff_get_ascii(const N_TIFF *tiff, uint16_t tag, char *out, size_t out_len)
Read an ASCII tag.
void n_tiff_free(N_TIFF **tiff)
Release a parse, and set the pointer to NULL.
The first directory of a TIFF structured buffer.