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

« back to all changes in this revision

Viewing changes to src/gdevpsds.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: gdevpsds.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: gdevpsds.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* Image processing streams for PostScript and PDF writers */
16
16
#include "gx.h"
17
17
#include "memory_.h"
37
37
}
38
38
 
39
39
/* Initialize the state. */
40
 
private int
 
40
static int
41
41
s_1_init(stream_state * st)
42
42
{
43
43
    stream_1248_state *const ss = (stream_1248_state *) st;
46
46
    ss->bits_per_sample = 1;
47
47
    return 0;
48
48
}
49
 
private int
 
49
static int
50
50
s_2_init(stream_state * st)
51
51
{
52
52
    stream_1248_state *const ss = (stream_1248_state *) st;
55
55
    ss->bits_per_sample = 2;
56
56
    return 0;
57
57
}
58
 
private int
 
58
static int
59
59
s_4_init(stream_state * st)
60
60
{
61
61
    stream_1248_state *const ss = (stream_1248_state *) st;
64
64
    ss->bits_per_sample = 4;
65
65
    return 0;
66
66
}
67
 
private int
 
67
static int
68
68
s_12_init(stream_state * st)
69
69
{
70
70
    stream_1248_state *const ss = (stream_1248_state *) st;
105
105
#define END_FOREACH_N_8\
106
106
          }\
107
107
        }
108
 
private int
 
108
static int
109
109
s_N_8_process(stream_state * st, stream_cursor_read * pr,
110
110
              stream_cursor_write * pw, bool last)
111
111
{
176
176
}
177
177
 
178
178
/* 12-to-8 "expansion" */
179
 
private int
 
179
static int
180
180
s_12_8_process(stream_state * st, stream_cursor_read * pr,
181
181
               stream_cursor_write * pw, bool last)
182
182
{
222
222
            q[1] = out;\
223
223
          }\
224
224
        }
225
 
private int
 
225
static int
226
226
s_8_N_process(stream_state * st, stream_cursor_read * pr,
227
227
              stream_cursor_write * pw, bool last)
228
228
{
321
321
}
322
322
 
323
323
/* Set default parameter values (actually, just clear pointers). */
324
 
private void
 
324
static void
325
325
s_C2R_set_defaults(stream_state * st)
326
326
{
327
327
    stream_C2R_state *const ss = (stream_C2R_state *) st;
330
330
}
331
331
 
332
332
/* Process one buffer. */
333
 
private int
 
333
static int
334
334
s_C2R_process(stream_state * st, stream_cursor_read * pr,
335
335
              stream_cursor_write * pw, bool last)
336
336
{
362
362
/* ------ Convert any color space to Indexed ------ */
363
363
 
364
364
private_st_IE_state();
365
 
private
 
365
static
366
366
ENUM_PTRS_WITH(ie_state_enum_ptrs, stream_IE_state *st) return 0;
367
367
case 0: return ENUM_OBJ(st->Decode);
368
368
case 1: return ENUM_BYTESTRING(&st->Table);
369
369
ENUM_PTRS_END
370
 
private
 
370
static
371
371
RELOC_PTRS_WITH(ie_state_reloc_ptrs, stream_IE_state *st)
372
372
{
373
373
    RELOC_VAR(st->Decode);
376
376
RELOC_PTRS_END
377
377
 
378
378
/* Set defaults. */
379
 
private void
 
379
static void
380
380
s_IE_set_defaults(stream_state * st)
381
381
{
382
382
    stream_IE_state *const ss = (stream_IE_state *) st;
386
386
}
387
387
 
388
388
/* Initialize the state. */
389
 
private int
 
389
static int
390
390
s_IE_init(stream_state * st)
391
391
{
392
392
    stream_IE_state *const ss = (stream_IE_state *) st;
409
409
}
410
410
 
411
411
/* Process a buffer. */
412
 
private int
 
412
static int
413
413
s_IE_process(stream_state * st, stream_cursor_read * pr,
414
414
             stream_cursor_write * pw, bool last)
415
415
{
580
580
    return ((pad ? size_in + factor - 1 : size_in) / factor);
581
581
}
582
582
 
583
 
private void
 
583
static void
584
584
s_Downsample_set_defaults(register stream_state * st)
585
585
{
586
586
    stream_Downsample_state *const ss = (stream_Downsample_state *)st;
594
594
                     "stream_Subsample_state");
595
595
 
596
596
/* Initialize the state. */
597
 
private int
 
597
static int
598
598
s_Subsample_init(stream_state * st)
599
599
{
600
600
    stream_Subsample_state *const ss = (stream_Subsample_state *) st;
604
604
}
605
605
 
606
606
/* Process one buffer. */
607
 
private int
 
607
static int
608
608
s_Subsample_process(stream_state * st, stream_cursor_read * pr,
609
609
                    stream_cursor_write * pw, bool last)
610
610
{
660
660
private_st_Average_state();
661
661
 
662
662
/* Set default parameter values (actually, just clear pointers). */
663
 
private void
 
663
static void
664
664
s_Average_set_defaults(stream_state * st)
665
665
{
666
666
    stream_Average_state *const ss = (stream_Average_state *) st;
671
671
}
672
672
 
673
673
/* Initialize the state. */
674
 
private int
 
674
static int
675
675
s_Average_init(stream_state * st)
676
676
{
677
677
    stream_Average_state *const ss = (stream_Average_state *) st;
690
690
}
691
691
 
692
692
/* Release the state. */
693
 
private void
 
693
static void
694
694
s_Average_release(stream_state * st)
695
695
{
696
696
    stream_Average_state *const ss = (stream_Average_state *) st;
699
699
}
700
700
 
701
701
/* Process one buffer. */
702
 
private int
 
702
static int
703
703
s_Average_process(stream_state * st, stream_cursor_read * pr,
704
704
                  stream_cursor_write * pw, bool last)
705
705
{
763
763
private_st_compr_chooser_state();
764
764
 
765
765
/* Initialize the state. */
766
 
private int
 
766
static int
767
767
s_compr_chooser_init(stream_state * st)
768
768
{
769
769
    stream_compr_chooser_state *const ss = (stream_compr_chooser_state *) st;
795
795
}
796
796
 
797
797
/* Release state. */
798
 
private void
 
798
static void
799
799
s_compr_chooser_release(stream_state * st)
800
800
{
801
801
    stream_compr_chooser_state *const ss = (stream_compr_chooser_state *) st;
804
804
}
805
805
 
806
806
/* Estimate a row for photo/lineart recognition. */
807
 
private void
 
807
static void
808
808
s_compr_chooser__estimate_row(stream_compr_chooser_state *const ss, byte *p)
809
809
{   
810
810
    /*  This function uses a statistical algorithm being not well defined.
901
901
}
902
902
 
903
903
/* Recognize photo/lineart. */
904
 
private void
 
904
static void
905
905
s_compr_chooser__recognize(stream_compr_chooser_state * ss)
906
906
{
907
907
    int i;
913
913
}
914
914
 
915
915
/* Uppack data and recognize photo/lineart. */
916
 
private void
 
916
static void
917
917
s_compr_chooser__unpack_and_recognize(stream_compr_chooser_state *const ss, 
918
918
                                      const byte *data, int length)
919
919
{   
962
962
}
963
963
 
964
964
/* Process a buffer. */
965
 
private int
 
965
static int
966
966
s_compr_chooser_process(stream_state * st, stream_cursor_read * pr,
967
967
             stream_cursor_write * pw, bool last)
968
968
{
1002
1002
private_st_image_colors_state();
1003
1003
 
1004
1004
/* Initialize the state. */
1005
 
private int
 
1005
static int
1006
1006
s_image_colors_init(stream_state * st)
1007
1007
{
1008
1008
    stream_image_colors_state *const ss = (stream_image_colors_state *) st;
1029
1029
    return 0;
1030
1030
}
1031
1031
 
1032
 
private int 
 
1032
static int 
1033
1033
s_image_colors_convert_color_to_mask(stream_image_colors_state *ss)
1034
1034
{
1035
1035
    int i, ii;
1042
1042
    return 0;
1043
1043
}
1044
1044
 
1045
 
private int
 
1045
static int
1046
1046
s_image_colors_convert_to_device_color(stream_image_colors_state * ss)
1047
1047
{
1048
1048
    gs_client_color cc;
1107
1107
 
1108
1108
 
1109
1109
/* Process a buffer. */
1110
 
private int
 
1110
static int
1111
1111
s_image_colors_process(stream_state * st, stream_cursor_read * pr,
1112
1112
             stream_cursor_write * pw, bool last)
1113
1113
{