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

« back to all changes in this revision

Viewing changes to src/sjbig2_luratech.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_luratech.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: sjbig2_luratech.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* jbig2decode filter implementation -- hooks in luratech JBIG2 */
16
16
 
17
17
#include "memory_.h"
59
59
} s_jbig2decode_global_data;
60
60
 
61
61
/* create a global data struct and copy data into it */
62
 
public int
 
62
int
63
63
s_jbig2decode_make_global_data(byte *data, uint size, void **result)
64
64
{
65
65
    s_jbig2decode_global_data *global = NULL;
80
80
}
81
81
 
82
82
/* free a global data struct and its data */
83
 
public void
 
83
void
84
84
s_jbig2decode_free_global_data(void *data)
85
85
{
86
86
    s_jbig2decode_global_data *global = (s_jbig2decode_global_data*)data;
93
93
}
94
94
 
95
95
/* store a global ctx pointer in our state structure */
96
 
public int
 
96
int
97
97
s_jbig2decode_set_global_data(stream_state *ss, void *data)
98
98
{
99
99
    stream_jbig2decode_state *state = (stream_jbig2decode_state*)ss;
117
117
/* invert the bits in a buffer */
118
118
/* jbig2 and postscript have different senses of what pixel
119
119
   value is black, so we must invert the image */
120
 
private void
 
120
static void
121
121
s_jbig2_invert_buffer(unsigned char *buf, int length)
122
122
{
123
123
    int i;
129
129
/** callbacks passed to the luratech library */
130
130
 
131
131
/* memory allocator */
132
 
private void * JB2_Callback
 
132
static void * JB2_Callback
133
133
s_jbig2_alloc(unsigned long size, void *userdata)
134
134
{
135
135
    void *result = malloc(size);
137
137
}
138
138
 
139
139
/* memory release */
140
 
private JB2_Error JB2_Callback
 
140
static JB2_Error JB2_Callback
141
141
s_jbig2_free(void *ptr, void *userdata)
142
142
{
143
143
    free(ptr);
145
145
}
146
146
 
147
147
/* error callback for jbig2 codec */
148
 
private void JB2_Callback
 
148
static void JB2_Callback
149
149
s_jbig2_message(const char *message, JB2_Message_Level level, void *userdata)
150
150
{
151
151
    const char *type;
174
174
}
175
175
 
176
176
/* compressed read callback for jbig2 codec */
177
 
private JB2_Size_T JB2_Callback
 
177
static JB2_Size_T JB2_Callback
178
178
s_jbig2_read(unsigned char *buffer, 
179
179
        JB2_Size_T offset, JB2_Size_T size, void *userdata)
180
180
{
200
200
}
201
201
 
202
202
/* uncompressed write callback for jbig2 codec */
203
 
private JB2_Error JB2_Callback
 
203
static JB2_Error JB2_Callback
204
204
s_jbig2_write(unsigned char *buffer,
205
205
                unsigned long row, unsigned long width,
206
206
                unsigned long bbp, void *userdata)
221
221
}
222
222
 
223
223
 
224
 
private int
 
224
static int
225
225
s_jbig2decode_inbuf(stream_jbig2decode_state *state, stream_cursor_read * pr)
226
226
{
227
227
    long in_size = pr->limit - pr->ptr;
262
262
}
263
263
 
264
264
/* initialize the steam. */
265
 
private int
 
265
static int
266
266
s_jbig2decode_init(stream_state * ss)
267
267
{
268
268
    stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
285
285
/* process a section of the input and return any decoded data.
286
286
   see strimpl.h for return codes.
287
287
 */
288
 
private int
 
288
static int
289
289
s_jbig2decode_process(stream_state * ss, stream_cursor_read * pr,
290
290
                  stream_cursor_write * pw, bool last)
291
291
{
365
365
}
366
366
 
367
367
/* stream release. free all our decoder state. */
368
 
private void
 
368
static void
369
369
s_jbig2decode_release(stream_state *ss)
370
370
{
371
371
    stream_jbig2decode_state *const state = (stream_jbig2decode_state *) ss;
398
398
private_st_jbig2encode_state();
399
399
 
400
400
/* helper - start up the compression context */
401
 
private int
 
401
static int
402
402
s_jbig2encode_start(stream_jbig2encode_state *state)
403
403
{
404
404
    JB2_Error err;
431
431
}
432
432
 
433
433
/* callback for compressed data output */
434
 
private JB2_Size_T JB2_Callback
 
434
static JB2_Size_T JB2_Callback
435
435
s_jbig2encode_write(const unsigned char *buffer,
436
436
                JB2_Size_T pos, JB2_Size_T size, void *userdata)
437
437
{
468
468
 
469
469
 
470
470
/* initialize the steam. */
471
 
private int
 
471
static int
472
472
s_jbig2encode_init(stream_state * ss)
473
473
{
474
474
    stream_jbig2encode_state *state = (stream_jbig2encode_state *)ss;
497
497
/* process a section of the input and return any encoded data.
498
498
   see strimpl.h for return codes.
499
499
 */
500
 
private int
 
500
static int
501
501
s_jbig2encode_process(stream_state * ss, stream_cursor_read * pr,
502
502
                  stream_cursor_write * pw, bool last)
503
503
{
581
581
 
582
582
/* stream release. free all our decoder state.
583
583
 */
584
 
private void
 
584
static void
585
585
s_jbig2encode_release(stream_state *ss)
586
586
{
587
587
    stream_jbig2encode_state *state = (stream_jbig2encode_state *)ss;