~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to src/sjbig2.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: sjbig2.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: sjbig2.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* jbig2decode filter implementation -- hooks in libjbig2dec */
16
16
 
17
17
#include "stdint_.h"
38
38
private_st_jbig2decode_state(); /* creates a gc object for our state, defined in sjbig2.h */
39
39
 
40
40
/* error callback for jbig2 decoder */
41
 
private int
 
41
static int
42
42
s_jbig2decode_error(void *error_callback_data, const char *msg, Jbig2Severity severity,
43
43
               int32_t seg_idx)
44
44
{
78
78
/* invert the bits in a buffer */
79
79
/* jbig2 and postscript have different senses of what pixel
80
80
   value is black, so we must invert the image */
81
 
private void
 
81
static void
82
82
s_jbig2decode_invert_buffer(unsigned char *buf, int length)
83
83
{
84
84
    int i;
89
89
 
90
90
/* parse a globals stream packed into a gs_bytestring for us by the postscript
91
91
   layer and stuff the resulting context into a pointer for use in later decoding */
92
 
public int
 
92
int
93
93
s_jbig2decode_make_global_data(byte *data, uint length, void **result)
94
94
{
95
95
    Jbig2Ctx *ctx = NULL;
122
122
}
123
123
 
124
124
/* release a global ctx pointer */
125
 
public void
 
125
void
126
126
s_jbig2decode_free_global_data(void *data)
127
127
{
128
128
    Jbig2GlobalCtx *global_ctx = (Jbig2GlobalCtx*)data;
131
131
}
132
132
 
133
133
/* store a global ctx pointer in our state structure */
134
 
public int
 
134
int
135
135
s_jbig2decode_set_global_data(stream_state *ss, void *data)
136
136
{
137
137
    stream_jbig2decode_state *state = (stream_jbig2decode_state*)ss;
143
143
   this involves allocating the context structures, and
144
144
   initializing the global context from the /JBIG2Globals object reference
145
145
 */
146
 
private int
 
146
static int
147
147
s_jbig2decode_init(stream_state * ss)
148
148
{
149
149
    stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
160
160
/* process a section of the input and return any decoded data.
161
161
   see strimpl.h for return codes.
162
162
 */
163
 
private int
 
163
static int
164
164
s_jbig2decode_process(stream_state * ss, stream_cursor_read * pr,
165
165
                  stream_cursor_write * pw, bool last)
166
166
{
212
212
/* stream release.
213
213
   free all our decoder state.
214
214
 */
215
 
private void
 
215
static void
216
216
s_jbig2decode_release(stream_state *ss)
217
217
{
218
218
    stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
229
229
   pointers. we use it similarly just to NULL all the pointers.
230
230
   (could just be done in _init?)
231
231
 */
232
 
private void
 
232
static void
233
233
s_jbig2decode_set_defaults(stream_state *ss)
234
234
{
235
235
    stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;