1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
14
/* $Id: sjpx.h 8818 2008-07-03 18:25:55Z giles $ */
15
/* Definitions for JPXDecode filter (JPEG 2000) */
16
/* we link to the JasPer library for the actual decoding */
19
# define sjpx_INCLUDED
21
/* Requires scommon.h; strimpl.h if any templates are referenced */
24
#include <jasper/jasper.h>
26
/* define colorspace enumeration for the input image data */
28
gs_jpx_cs_unset, /* colorspace hasn't been set */
29
gs_jpx_cs_gray, /* single component grayscale image */
30
gs_jpx_cs_rgb, /* three component (s)RGB image */
31
gs_jpx_cs_cmyk, /* four component CMYK image */
32
gs_jpx_cs_indexed /* PDF image wants raw index values */
35
/* Our local state consists of pointers to the JasPer library's
36
* stream and image structs for sending and retrieving the
37
* image data. There's no way to feed a jasper stream with
38
* incremental buffers, so we also must spool the entire
39
* compressed stream into our own buffer before handing it
40
* to the library. We also keep track of how much of the
41
* decoded image we have returned.
43
typedef struct stream_jpxd_state_s
45
stream_state_common; /* a define from scommon.h */
47
long offset; /* offset into the image bitmap of the next
48
byte to be returned */
49
const gs_memory_t *jpx_memory;
50
unsigned char *buffer; /* temporary buffer for compressed data */
51
long bufsize; /* total size of the buffer */
52
long buffill; /* number of bytes written into the buffer */
53
gs_jpx_cs colorspace; /* external colorspace setting */
57
#define private_st_jpxd_state() \
58
gs_private_st_simple(st_jpxd_state, stream_jpxd_state,\
59
"JPXDecode filter state")
60
extern const stream_template s_jpxd_template;
62
#endif /* sjpx_INCLUDED */