]> git.ipfire.org Git - thirdparty/cups.git/blob - pstoraster/zpaint.c
Import cups.org releases
[thirdparty/cups.git] / pstoraster / zpaint.c
1 /* Copyright (C) 1997, 1998 Aladdin Enterprises. All rights reserved.
2
3 This file is part of GNU Ghostscript.
4
5 GNU Ghostscript is distributed in the hope that it will be useful, but
6 WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
7 to anyone for the consequences of using it or for whether it serves any
8 particular purpose or works at all, unless he says so in writing. Refer
9 to the GNU General Public License for full details.
10
11 Everyone is granted permission to copy, modify and redistribute GNU
12 Ghostscript, but only under the conditions described in the GNU General
13 Public License. A copy of this license is supposed to have been given
14 to you along with GNU Ghostscript so you can know your rights and
15 responsibilities. It should be in a file named COPYING. Among other
16 things, the copyright notice and this notice must be preserved on all
17 copies.
18
19 Aladdin Enterprises supports the work of the GNU Project, but is not
20 affiliated with the Free Software Foundation or the GNU Project. GNU
21 Ghostscript, as distributed by Aladdin Enterprises, does not require any
22 GNU software to build or run it.
23 */
24
25 /*$Id$ */
26 /* Painting operators */
27 #include "ghost.h"
28 #include "oper.h"
29 #include "gspaint.h"
30 #include "igstate.h"
31
32 /* - fill - */
33 private int
34 zfill(register os_ptr op)
35 {
36 return gs_fill(igs);
37 }
38
39 /* - eofill - */
40 private int
41 zeofill(register os_ptr op)
42 {
43 return gs_eofill(igs);
44 }
45
46 /* - stroke - */
47 private int
48 zstroke(register os_ptr op)
49 {
50 return gs_stroke(igs);
51 }
52
53 /* ------ Non-standard operators ------ */
54
55 /* - .fillpage - */
56 private int
57 zfillpage(register os_ptr op)
58 {
59 return gs_fillpage(igs);
60 }
61
62 /* <width> <height> <data> .imagepath - */
63 private int
64 zimagepath(register os_ptr op)
65 {
66 int code;
67
68 check_type(op[-2], t_integer);
69 check_type(op[-1], t_integer);
70 check_read_type(*op, t_string);
71 if (r_size(op) < ((op[-2].value.intval + 7) >> 3) * op[-1].value.intval)
72 return_error(e_rangecheck);
73 code = gs_imagepath(igs,
74 (int)op[-2].value.intval, (int)op[-1].value.intval,
75 op->value.const_bytes);
76 if (code >= 0)
77 pop(3);
78 return code;
79 }
80
81 /* ------ Initialization procedure ------ */
82
83 const op_def zpaint_op_defs[] =
84 {
85 {"0eofill", zeofill},
86 {"0fill", zfill},
87 {"0stroke", zstroke},
88 /* Non-standard operators */
89 {"0.fillpage", zfillpage},
90 {"3.imagepath", zimagepath},
91 op_def_end(0)
92 };