Pillow/src/libImaging/Jpeg2K.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
2.5 KiB
C
Raw Normal View History

/*
* The Python Imaging Library
* $Id$
*
* declarations for the OpenJPEG codec interface.
*
* Copyright (c) 2014 by Coriolis Systems Limited
* Copyright (c) 2014 by Alastair Houghton
*/
2014-05-27 15:43:54 +04:00
#include <openjpeg.h>
/* 1MB for now */
#define BUFFER_SIZE OPJ_J2K_STREAM_CHUNK_SIZE
/* -------------------------------------------------------------------- */
2020-05-01 15:08:57 +03:00
/* Decoder */
2014-03-13 22:27:16 +04:00
/* -------------------------------------------------------------------- */
typedef struct {
/* CONFIGURATION */
/* File descriptor, if available; otherwise, -1 */
int fd;
/* File pointer, when opened */
FILE *pfile;
2014-05-27 15:43:54 +04:00
/* Length of data, if available; otherwise, -1 */
off_t length;
/* Specify the desired format */
OPJ_CODEC_FORMAT format;
/* Set to divide image resolution by 2**reduce. */
int reduce;
/* Set to limit the number of quality layers to decode (0 = all layers) */
int layers;
/* PRIVATE CONTEXT (set by decoder) */
const char *error_msg;
2016-09-03 05:23:42 +03:00
2014-03-13 22:27:16 +04:00
} JPEG2KDECODESTATE;
/* -------------------------------------------------------------------- */
2020-05-01 15:08:57 +03:00
/* Encoder */
2014-03-13 22:27:16 +04:00
/* -------------------------------------------------------------------- */
typedef struct {
/* CONFIGURATION */
/* File descriptor, if available; otherwise, -1 */
int fd;
/* File pointer, when opened */
FILE *pfile;
2014-03-13 22:27:16 +04:00
/* Specify the desired format */
OPJ_CODEC_FORMAT format;
/* Image offset */
int offset_x, offset_y;
/* Tile information */
int tile_offset_x, tile_offset_y;
int tile_size_x, tile_size_y;
/* Quality layers (a sequence of numbers giving *either* rates or dB) */
int quality_is_in_db;
PyObject *quality_layers;
/* Number of resolutions (DWT decompositions + 1 */
int num_resolutions;
/* Code block size */
int cblk_width, cblk_height;
/* Precinct size */
int precinct_width, precinct_height;
2014-03-13 22:27:16 +04:00
/* Compression style */
int irreversible;
/* Set multiple component transformation */
char mct;
/* Signed */
int sgnd;
2014-03-13 22:27:16 +04:00
/* Progression order (LRCP/RLCP/RPCL/PCRL/CPRL) */
OPJ_PROG_ORDER progression;
/* Cinema mode */
OPJ_CINEMA_MODE cinema_mode;
/* PRIVATE CONTEXT (set by decoder) */
const char *error_msg;
/* Custom comment */
2023-01-31 14:24:52 +03:00
char *comment;
/* Include PLT marker segment */
2023-03-27 14:38:29 +03:00
int plt;
2014-03-13 22:27:16 +04:00
} JPEG2KENCODESTATE;
/*
* Local Variables:
* c-basic-offset: 4
* End:
*
*/