Leptonica  1.54
Файл src/jp2kheader.c
#include <string.h>
#include <math.h>
#include "allheaders.h"

Макросы

#define DEBUG_IHDR   0

Функции

l_int32 readHeaderJp2k (const char *filename, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp)
l_int32 freadHeaderJp2k (FILE *fp, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp)
l_int32 readHeaderMemJp2k (const l_uint8 *data, size_t size, l_int32 *pw, l_int32 *ph, l_int32 *pbps, l_int32 *pspp)
l_int32 fgetJp2kResolution (FILE *fp, l_int32 *pxres, l_int32 *pyres)

Переменные

static const l_int32 MAX_JP2K_WIDTH = 100000
static const l_int32 MAX_JP2K_HEIGHT = 100000

Макросы

#define DEBUG_IHDR   0

Функции

l_int32 fgetJp2kResolution ( FILE *  fp,
l_int32 pxres,
l_int32 pyres 
)
l_int32 freadHeaderJp2k ( FILE *  fp,
l_int32 pw,
l_int32 ph,
l_int32 pbps,
l_int32 pspp 
)

freadHeaderJp2k()

Input: stream opened for read &w (<optional return>="">) &h (<optional return>="">) &bps (<optional return>="">, bits/sample) &spp (<optional return>="">, samples/pixel) Return: 0 if OK, 1 on error

l_int32 readHeaderJp2k ( const char *  filename,
l_int32 pw,
l_int32 ph,
l_int32 pbps,
l_int32 pspp 
)

readHeaderJp2k()

Input: filename &w (<optional return>="">) &h (<optional return>="">) &bps (<optional return>="">, bits/sample) &spp (<optional return>="">, samples/pixel) Return: 0 if OK, 1 on error

l_int32 readHeaderMemJp2k ( const l_uint8 data,
size_t  size,
l_int32 pw,
l_int32 ph,
l_int32 pbps,
l_int32 pspp 
)

readHeaderMemJp2k()

Input: data size (at least 80) &w (<optional return>="">) &h (<optional return>="">) &bps (<optional return>="">, bits/sample) &spp (<optional return>="">, samples/pixel) Return: 0 if OK, 1 on error

Notes: (1) The ISO/IEC reference for jpeg2000 is http://www.jpeg.org/public/15444-1annexi.pdf and the file format syntax begins at page 127. (2) The Image Header Box begins with 'ihdr' = 0x69686472 in big-endian order. This typically, but not always, starts byte 44, with the big-endian data fields beginning at byte 48: h: 4 bytes w: 4 bytes spp: 2 bytes bps: 1 byte (contains bps - 1)


Переменные

const l_int32 MAX_JP2K_HEIGHT = 100000 [static]
const l_int32 MAX_JP2K_WIDTH = 100000 [static]