![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Reading the tags of a TIFF structured buffer. More...
#include "nilorea/n_tiff.h"#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include <string.h>Go to the source code of this file.
Macros | |
| #define | N_TIFF_MAX_ENTRIES 4096 |
| Most entries a directory is read for: a real TIFF directory holds tens, a DCP a few dozen; a count past this is a corrupt or hostile file. | |
Functions | |
| static size_t | _n_tiff_type_size (uint16_t type) |
| Bytes one value of a field type takes. | |
| static uint16_t | _n_tiff_u16 (const N_TIFF *tiff, const unsigned char *p) |
| Read a 16 bit value in the buffer's byte order. | |
| static uint32_t | _n_tiff_u32 (const N_TIFF *tiff, const unsigned char *p) |
| Read a 32 bit value in the buffer's byte order. | |
| static uint64_t | _n_tiff_u64 (const N_TIFF *tiff, const unsigned char *p) |
| Read a 64 bit value in the buffer's byte order. | |
| size_t | n_tiff_count (const N_TIFF *tiff, uint16_t tag) |
| How many values a tag has. | |
| const N_TIFF_ENTRY * | n_tiff_find (const N_TIFF *tiff, uint16_t tag) |
| Find an entry by tag. | |
| void | n_tiff_free (N_TIFF **tiff) |
| Release a parse, and set the pointer to NULL. | |
| int | n_tiff_get_ascii (const N_TIFF *tiff, uint16_t tag, char *out, size_t out_len) |
| Read an ASCII tag. | |
| size_t | n_tiff_get_doubles (const N_TIFF *tiff, uint16_t tag, double *out, size_t max) |
| Read a numeric tag as doubles. | |
| N_TIFF * | n_tiff_parse (const unsigned char *data, size_t len) |
| Parse the first directory of a TIFF structured buffer. | |
Reading the tags of a TIFF structured buffer.
Definition in file n_tiff.c.
| #define N_TIFF_MAX_ENTRIES 4096 |
Most entries a directory is read for: a real TIFF directory holds tens, a DCP a few dozen; a count past this is a corrupt or hostile file.
Definition at line 36 of file n_tiff.c.
Referenced by n_tiff_parse().
|
static |
Bytes one value of a field type takes.
| type | TIFF field type |
Definition at line 41 of file n_tiff.c.
References type().
Referenced by n_tiff_get_doubles(), and n_tiff_parse().
|
static |
Read a 16 bit value in the buffer's byte order.
| tiff | the parse, for the byte order |
| p | where, already checked to be inside the buffer |
Definition at line 68 of file n_tiff.c.
References N_TIFF::big_endian.
Referenced by n_tiff_get_doubles(), and n_tiff_parse().
|
static |
Read a 32 bit value in the buffer's byte order.
| tiff | the parse, for the byte order |
| p | where, already checked to be inside the buffer |
Definition at line 78 of file n_tiff.c.
References N_TIFF::big_endian.
Referenced by _n_tiff_u64(), n_tiff_get_doubles(), and n_tiff_parse().
|
static |
Read a 64 bit value in the buffer's byte order.
| tiff | the parse, for the byte order |
| p | where, already checked to be inside the buffer |
Definition at line 88 of file n_tiff.c.
References _n_tiff_u32(), and N_TIFF::big_endian.
Referenced by n_tiff_get_doubles().