summaryrefslogtreecommitdiff
path: root/print/ghostscript8/files/patch-src:gdevdj9.c
blob: f58a6c7de7920cd4146125181713aabd83f15084 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
--- src/gdevdj9.c.orig	Fri Nov  8 06:15:08 2002
+++ src/gdevdj9.c	Sun Nov 10 22:00:45 2002
@@ -243,19 +243,19 @@
 };
 
 private int
-    rescale_byte_wise1x1(P4(int bytecount, const byte * inbytea,
-			    const byte * inbyteb, byte * outbyte));
+    rescale_byte_wise1x1(int bytecount, const byte * inbytea,
+			    const byte * inbyteb, byte * outbyte);
 private int
-    rescale_byte_wise2x1(P4(int bytecount, const byte * inbytea,
-			    const byte * inbyteb, byte * outbyte));
+    rescale_byte_wise2x1(int bytecount, const byte * inbytea,
+			    const byte * inbyteb, byte * outbyte);
 private int
-    rescale_byte_wise1x2(P4(int bytecount, const byte * inbytea,
-			    const byte * inbyteb, byte * outbyte));
+    rescale_byte_wise1x2(int bytecount, const byte * inbytea,
+			    const byte * inbyteb, byte * outbyte);
 private int
-    rescale_byte_wise2x2(P4(int bytecount, const byte * inbytea,
-			    const byte * inbyteb, byte * outbyte));
+    rescale_byte_wise2x2(int bytecount, const byte * inbytea,
+			    const byte * inbyteb, byte * outbyte);
 
-private int (* const rescale_color_plane[2][2]) (P4(int, const byte *, const byte *, byte *)) = {
+private int (* const rescale_color_plane[2][2]) (int, const byte *, const byte *, byte *) = {
     {
 	rescale_byte_wise1x1, rescale_byte_wise1x2
     },
@@ -264,7 +264,7 @@
     }
 };
 /*
-private int (* const rescale_color_plane[2][2]) (P4(int, const byte *, const byte *, byte *)) = {
+private int (* const rescale_color_plane[2][2]) (int, const byte *, const byte *, byte *) = {
     {
 	rescale_byte_wise1x1, rescale_byte_wise1x1
     },
@@ -273,8 +273,8 @@
     }
 };
 */
-private int cdj970_write_header(P2(gx_device *, FILE *));
-private int cdj970_write_trailer(P2(gx_device *, FILE *));
+private int cdj970_write_header(gx_device *, FILE *);
+private int cdj970_write_trailer(gx_device *, FILE *);
 
 /*
  * Drivers stuff.
@@ -422,16 +422,16 @@
 };
 
     /* function pointer typedefs for device driver struct */
-typedef void (*StartRasterMode) (P3(gx_device_printer * pdev, int paper_size,
-				    FILE * prn_stream));
-typedef void (*PrintNonBlankLines) (P6(gx_device_printer * pdev,
+typedef void (*StartRasterMode) (gx_device_printer * pdev, int paper_size,
+				    FILE * prn_stream);
+typedef void (*PrintNonBlankLines) (gx_device_printer * pdev,
 				       struct ptr_arrays *data_ptrs,
 				       struct misc_struct *misc_vars,
 				       struct error_val_field *error_values,
 				       const Gamma *gamma,
-				       FILE * prn_stream));
+				       FILE * prn_stream);
 
-typedef void (*TerminatePage) (P2(gx_device_printer * pdev, FILE * prn_stream));
+typedef void (*TerminatePage) (gx_device_printer * pdev, FILE * prn_stream);
 
 typedef struct gx_device_cdj970_s {
     gx_device_common;
@@ -529,18 +529,18 @@
 }
 
 private void
-     cdj970_start_raster_mode(P3(gx_device_printer * pdev,
-				 int papersize, FILE * prn_stream));
+     cdj970_start_raster_mode(gx_device_printer * pdev,
+				 int papersize, FILE * prn_stream);
 
 private void
-     cdj970_print_non_blank_lines(P6(gx_device_printer * pdev,
+     cdj970_print_non_blank_lines(gx_device_printer * pdev,
 				     struct ptr_arrays *data_ptrs,
 				     struct misc_struct *misc_vars,
 				     struct error_val_field *error_values,
 				     const Gamma *gamma,
-				     FILE * prn_stream));
+				     FILE * prn_stream);
 private void
-     cdj970_terminate_page(P2(gx_device_printer * pdev, FILE * prn_stream));
+     cdj970_terminate_page(gx_device_printer * pdev, FILE * prn_stream);
 
 
 private const gx_device_procs cdj970_procs =
@@ -555,12 +555,12 @@
 				cdj970_terminate_page);
 
 /* Forward references */
-private int cdj_put_param_int(P6(gs_param_list *, gs_param_name,
-				 int *, int, int, int));
-private int cdj_put_param_float(P6(gs_param_list *, gs_param_name, float
-				   *, float, float, int));
-private int cdj_put_param_bpp(P5(gx_device *, gs_param_list *, int, int, int));
-private int cdj_set_bpp(P3(gx_device *, int, int));
+private int cdj_put_param_int(gs_param_list *, gs_param_name,
+				 int *, int, int, int);
+private int cdj_put_param_float(gs_param_list *, gs_param_name, float
+				   *, float, float, int);
+private int cdj_put_param_bpp(gx_device *, gs_param_list *, int, int, int);
+private int cdj_set_bpp(gx_device *, int, int);
 
 static int PageCtr = 0;
 
@@ -692,70 +692,70 @@
 
 /* internal functions */
 private void
-     FSDlinebw(P7(int scan, int plane_size,
+     FSDlinebw(int scan, int plane_size,
 		  struct error_val_field *error_values,
 		  byte * kP,
-		  int n, int *ep, byte * dp));
+		  int n, int *ep, byte * dp);
 		  
 private void
-     FSDlinec2(P9(int scan, int plane_size,
+     FSDlinec2(int scan, int plane_size,
 		  struct error_val_field *error_values,
 		  byte * cPa, byte * mPa, byte * yPa, int n,
-		  byte * dp, int *ep));
+		  byte * dp, int *ep);
 		  
 private void
-     FSDlinec3(P12(int scan, int plane_size,
+     FSDlinec3(int scan, int plane_size,
 		   struct error_val_field *error_values,
 		   byte * cPa, byte * mPa, byte * yPa,
 		   byte * cPb, byte * mPb, byte * yPb,
-		   int n, byte * dp, int *ep));
+		   int n, byte * dp, int *ep);
 		   
 private void
-     FSDlinec4(P12(int scan, int plane_size,
+     FSDlinec4(int scan, int plane_size,
 		   struct error_val_field *error_values,
 		   byte * cPa, byte * mPa, byte * yPa,
 		   byte * cPb, byte * mPb, byte * yPb,
-		   int n, byte * dp, int *ep));
+		   int n, byte * dp, int *ep);
 
 private void
      init_error_buffer(struct misc_struct *misc_vars,
 		       struct ptr_arrays *data_ptrs);
 		       
 private void
-     do_floyd_steinberg(P8(int scan, int cscan, int plane_size,
+     do_floyd_steinberg(int scan, int cscan, int plane_size,
 			   int plane_size_c, int n,
 			   struct ptr_arrays *data_ptrs,
 			   gx_device_printer * pdev,
-			   struct error_val_field *error_values));
+			   struct error_val_field *error_values);
 
 			   	   
 private int
-    do_gcr(P7(int bytecount, byte * inbyte, const byte * kvalues,
+    do_gcr(int bytecount, byte * inbyte, const byte * kvalues,
 	      const byte * cvalues, const byte * mvalues,
-	      const byte * yvalues, const int *kcorrect));
+	      const byte * yvalues, const int *kcorrect);
 	      
 private void
-     send_scan_lines(P6(gx_device_printer * pdev,
+     send_scan_lines(gx_device_printer * pdev,
 			struct ptr_arrays *data_ptrs,
 			struct misc_struct *misc_vars,
 			struct error_val_field *error_values,
 			const Gamma *gamma,
-			FILE * prn_stream));
+			FILE * prn_stream);
 			
 private void
-     do_gamma(P3(float mastergamma, float gammaval, byte * values));
+     do_gamma(float mastergamma, float gammaval, byte * values);
      
 private void
-     do_black_correction(P2(float kvalue, int *kcorrect));
+     do_black_correction(float kvalue, int *kcorrect);
 
 private void
-     init_data_structure(P3(gx_device_printer * pdev,
+     init_data_structure(gx_device_printer * pdev,
 			    struct ptr_arrays *data_ptrs,
-			    struct misc_struct *misc_vars));
+			    struct misc_struct *misc_vars);
 			    
 private void
-     calculate_memory_size(P2(gx_device_printer * pdev,
-			      struct misc_struct *misc_vars));
+     calculate_memory_size(gx_device_printer * pdev,
+			      struct misc_struct *misc_vars);
 
 
 /* assign_dpi:  
@@ -2292,12 +2292,13 @@
 /* gdev_cmyk_map_cmyk_color: 
 ----------------------------------------------------------------------------------*/
 private gx_color_index gdev_cmyk_map_cmyk_color(gx_device 			*pdev,
-																								gx_color_value 	cyan, 
-																								gx_color_value 	magenta,
-																								gx_color_value 	yellow,
-																								gx_color_value 	black)
+																								const gx_color_value 	cv[])
 {
 	gx_color_index color;
+	gx_color_value cyan = cv[0];
+	gx_color_value magenta = cv[1];
+	gx_color_value yellow = cv[2];
+	gx_color_value black = cv[3];
 
 	switch (pdev->color_info.depth) {
 		case 1:
@@ -2331,10 +2332,11 @@
 /* gdev_cmyk_map_rgb_color: Mapping of RGB colors to gray values. 
 ----------------------------------------------------------------------------------*/
 private gx_color_index gdev_cmyk_map_rgb_color(	gx_device 			*pdev, 
-																								gx_color_value 	r, 
-																								gx_color_value 	g, 
-																								gx_color_value 	b)
+																								const gx_color_value 	cv[])
 {
+	gx_color_value r = cv[0];
+	gx_color_value g = cv[1];
+	gx_color_value b = cv[2];
 	if (gx_color_value_to_byte(r & g & b) == 0xff) {
 		return (gx_color_index) 0;	/* White */
 	} else {
@@ -2427,10 +2429,11 @@
 /* gdev_pcl_map_rgb_color: 
 ----------------------------------------------------------------------------------*/
 private gx_color_index gdev_pcl_map_rgb_color(	gx_device 			*pdev, 
-																								gx_color_value 	r,
-																								gx_color_value 	g, 
-																								gx_color_value 	b)
+																								const gx_color_value 	cv[])
 {
+	gx_color_value r = cv[0];
+	gx_color_value g = cv[1];
+	gx_color_value b = cv[2];
 	if (gx_color_value_to_byte(r & g & b) == 0xff)
 		return (gx_color_index) 0;	/* white */
 	else {