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

« back to all changes in this revision

Viewing changes to src/zupath.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: zupath.c 8061 2007-06-19 02:39:15Z alexcher $ */
 
14
/* $Id: zupath.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* Operators related to user paths */
16
16
#include "ghost.h"
17
17
#include "oper.h"
52
52
extern bool CPSI_mode;
53
53
 
54
54
/* Forward references */
55
 
private int upath_append(os_ptr, i_ctx_t *, bool);
56
 
private int upath_stroke(i_ctx_t *, gs_matrix *, bool);
 
55
static int upath_append(os_ptr, i_ctx_t *, bool);
 
56
static int upath_stroke(i_ctx_t *, gs_matrix *, bool);
57
57
 
58
58
/* ---------------- Insideness testing ---------------- */
59
59
 
60
60
/* Forward references */
61
 
private int in_test(i_ctx_t *, int (*)(gs_state *));
62
 
private int in_path(os_ptr, i_ctx_t *, gx_device *);
63
 
private int in_path_result(i_ctx_t *, int, int);
64
 
private int in_utest(i_ctx_t *, int (*)(gs_state *));
65
 
private int in_upath(i_ctx_t *, gx_device *);
66
 
private int in_upath_result(i_ctx_t *, int, int);
 
61
static int in_test(i_ctx_t *, int (*)(gs_state *));
 
62
static int in_path(os_ptr, i_ctx_t *, gx_device *);
 
63
static int in_path_result(i_ctx_t *, int, int);
 
64
static int in_utest(i_ctx_t *, int (*)(gs_state *));
 
65
static int in_upath(i_ctx_t *, gx_device *);
 
66
static int in_upath_result(i_ctx_t *, int, int);
67
67
 
68
68
/* <x> <y> ineofill <bool> */
69
69
/* <userpath> ineofill <bool> */
70
 
private int
 
70
static int
71
71
zineofill(i_ctx_t *i_ctx_p)
72
72
{
73
73
    return in_test(i_ctx_p, gs_eofill);
75
75
 
76
76
/* <x> <y> infill <bool> */
77
77
/* <userpath> infill <bool> */
78
 
private int
 
78
static int
79
79
zinfill(i_ctx_t *i_ctx_p)
80
80
{
81
81
    return in_test(i_ctx_p, gs_fill);
83
83
 
84
84
/* <x> <y> instroke <bool> */
85
85
/* <userpath> instroke <bool> */
86
 
private int
 
86
static int
87
87
zinstroke(i_ctx_t *i_ctx_p)
88
88
{
89
89
    return in_test(i_ctx_p, gs_stroke);
91
91
 
92
92
/* <x> <y> <userpath> inueofill <bool> */
93
93
/* <userpath1> <userpath2> inueofill <bool> */
94
 
private int
 
94
static int
95
95
zinueofill(i_ctx_t *i_ctx_p)
96
96
{
97
97
    return in_utest(i_ctx_p, gs_eofill);
99
99
 
100
100
/* <x> <y> <userpath> inufill <bool> */
101
101
/* <userpath1> <userpath2> inufill <bool> */
102
 
private int
 
102
static int
103
103
zinufill(i_ctx_t *i_ctx_p)
104
104
{
105
105
    return in_utest(i_ctx_p, gs_fill);
109
109
/* <x> <y> <userpath> <matrix> inustroke <bool> */
110
110
/* <userpath1> <userpath2> inustroke <bool> */
111
111
/* <userpath1> <userpath2> <matrix> inustroke <bool> */
112
 
private int
 
112
static int
113
113
zinustroke(i_ctx_t *i_ctx_p)
114
114
{       /* This is different because of the optional matrix operand. */
115
115
    os_ptr op = osp;
138
138
/* ------ Internal routines ------ */
139
139
 
140
140
/* Do the work of the non-user-path insideness operators. */
141
 
private int
 
141
static int
142
142
in_test(i_ctx_t *i_ctx_p, int (*paintproc)(gs_state *))
143
143
{
144
144
    os_ptr op = osp;
153
153
}
154
154
 
155
155
/* Set up a clipping path and device for insideness testing. */
156
 
private int
 
156
static int
157
157
in_path(os_ptr oppath, i_ctx_t *i_ctx_p, gx_device * phdev)
158
158
{
159
159
    int code = gs_gsave(igs);
208
208
}
209
209
 
210
210
/* Finish an insideness test. */
211
 
private int
 
211
static int
212
212
in_path_result(i_ctx_t *i_ctx_p, int npop, int code)
213
213
{
214
214
    os_ptr op = osp;
230
230
}
231
231
 
232
232
/* Do the work of the user-path insideness operators. */
233
 
private int
 
233
static int
234
234
in_utest(i_ctx_t *i_ctx_p, int (*paintproc)(gs_state *))
235
235
{
236
236
    gx_device hdev;
245
245
 
246
246
/* Set up a clipping path and device for insideness testing */
247
247
/* with a user path. */
248
 
private int
 
248
static int
249
249
in_upath(i_ctx_t *i_ctx_p, gx_device * phdev)
250
250
{
251
251
    os_ptr op = osp;
264
264
}
265
265
 
266
266
/* Finish an insideness test with a user path. */
267
 
private int
 
267
static int
268
268
in_upath_result(i_ctx_t *i_ctx_p, int npop, int code)
269
269
{
270
270
    gs_grestore(igs);           /* matches gsave in in_upath */
323
323
 
324
324
/* Declare operator procedures not declared in opextern.h. */
325
325
int zsetbbox(i_ctx_t *);
326
 
private int zucache(i_ctx_t *);
 
326
static int zucache(i_ctx_t *);
327
327
 
328
328
#undef zp
329
329
static const op_proc_t up_ops[UPATH_MAX_OP + 1] = {
333
333
};
334
334
 
335
335
/* - ucache - */
336
 
private int
 
336
static int
337
337
zucache(i_ctx_t *i_ctx_p)
338
338
{
339
339
    /* A no-op for now. */
341
341
}
342
342
 
343
343
/* <userpath> uappend - */
344
 
private int
 
344
static int
345
345
zuappend(i_ctx_t *i_ctx_p)
346
346
{
347
347
    os_ptr op = osp;
359
359
}
360
360
 
361
361
/* <userpath> ueofill - */
362
 
private int
 
362
static int
363
363
zueofill(i_ctx_t *i_ctx_p)
364
364
{
365
365
    os_ptr op = osp;
377
377
}
378
378
 
379
379
/* <userpath> ufill - */
380
 
private int
 
380
static int
381
381
zufill(i_ctx_t *i_ctx_p)
382
382
{
383
383
    os_ptr op = osp;
396
396
 
397
397
/* <userpath> ustroke - */
398
398
/* <userpath> <matrix> ustroke - */
399
 
private int
 
399
static int
400
400
zustroke(i_ctx_t *i_ctx_p)
401
401
{
402
402
    int code = gs_gsave(igs);
415
415
 
416
416
/* <userpath> ustrokepath - */
417
417
/* <userpath> <matrix> ustrokepath - */
418
 
private int
 
418
static int
419
419
zustrokepath(i_ctx_t *i_ctx_p)
420
420
{
421
421
    gx_path save;
452
452
/* the UnpaintedPath user path for ImageType 2 images. */
453
453
int make_upath(i_ctx_t *i_ctx_p, ref *rupath, gs_state *pgs, gx_path *ppath,
454
454
               bool with_ucache);
455
 
private int
 
455
static int
456
456
zupath(i_ctx_t *i_ctx_p)
457
457
{
458
458
    os_ptr op = osp;
462
462
}
463
463
 
464
464
/* Compute the path length for user path purposes. */
465
 
private int 
 
465
static int 
466
466
path_length_for_upath(const gx_path *ppath)
467
467
{
468
468
    gs_path_enum penum;
590
590
}
591
591
 
592
592
 
593
 
private int
 
593
static int
594
594
zgetpath(i_ctx_t *i_ctx_p)
595
595
{
596
596
    os_ptr op = osp;
667
667
/* ------ Internal routines ------ */
668
668
 
669
669
/* Append a user path to the current path. */
670
 
private inline int
 
670
static inline int
671
671
upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat)
672
672
{
673
673
    upath_state ups = UPS_INITIAL;
827
827
    }
828
828
    return 0;
829
829
}
830
 
private int
 
830
static int
831
831
upath_append(os_ptr oppath, i_ctx_t *i_ctx_p, bool upath_compat)
832
832
{
833
833
    int nargs = 0;
843
843
 
844
844
/* Append a user path to the current path, and then apply or return */
845
845
/* a transformation if one is supplied. */
846
 
private int
 
846
static int
847
847
upath_stroke(i_ctx_t *i_ctx_p, gs_matrix *pmat, bool upath_compat)
848
848
{
849
849
    os_ptr op = osp;