1 /* Copyright (C) 1998 Aladdin Enterprises. All rights reserved.
2
3 This software is provided AS-IS with no warranty, either express or
4 implied.
5
6 This software is distributed under license and may not be copied,
7 modified or distributed except as expressly authorized under the terms
8 of the license contained in the file LICENSE in this distribution.
9
10 For more information about licensing, please refer to
11 http://www.ghostscript.com/licensing/. For information on
12 commercial licensing, go to http://www.artifex.com/licensing/ or
13 contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14 San Rafael, CA 94903, U.S.A., +1(415)492-9861.
15 */
16
17 /* $Id: gsnorop.c,v 1.4 2002/02/21 22:24:52 giles Exp $ */
18 /* Stubs for unimplemented RasterOp */
19 #include "gx.h"
20 #include "gserrors.h"
21 #include "gsrop.h"
22 #include "gxdevcli.h"
23 #include "gxdevice.h" /* for gx_default_*copy_rop prototypes */
24 #include "gxdevmem.h" /* for gdevmem.h */
25 #include "gdevmem.h" /* for mem_*_strip_copy_rop prototypes */
26 #include "gdevmrop.h"
27
28 /* Stub accessors to logical operation in graphics state. */
29
30 gs_logical_operation_t
gs_current_logical_op(const gs_state * pgs)31 gs_current_logical_op(const gs_state * pgs)
32 {
33 return lop_default;
34 }
35
36 int
gs_set_logical_op(gs_state * pgs,gs_logical_operation_t lop)37 gs_set_logical_op(gs_state * pgs, gs_logical_operation_t lop)
38 {
39 return (lop == lop_default ? 0 : gs_note_error(gs_error_rangecheck));
40 }
41
42 /* Stub RasterOp implementations for memory devices. */
43
44 int
mem_mono_strip_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_strip_bitmap * textures,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)45 mem_mono_strip_copy_rop(gx_device * dev,
46 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
47 const gx_color_index * scolors,
48 const gx_strip_bitmap * textures, const gx_color_index * tcolors,
49 int x, int y, int width, int height,
50 int phase_x, int phase_y, gs_logical_operation_t lop)
51 {
52 return_error(gs_error_rangecheck);
53 }
54
55 int
mem_gray_strip_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_strip_bitmap * textures,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)56 mem_gray_strip_copy_rop(gx_device * dev,
57 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
58 const gx_color_index * scolors,
59 const gx_strip_bitmap * textures, const gx_color_index * tcolors,
60 int x, int y, int width, int height,
61 int phase_x, int phase_y, gs_logical_operation_t lop)
62 {
63 return_error(gs_error_rangecheck);
64 }
65
66 int
mem_gray8_rgb24_strip_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_strip_bitmap * textures,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)67 mem_gray8_rgb24_strip_copy_rop(gx_device * dev,
68 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
69 const gx_color_index * scolors,
70 const gx_strip_bitmap * textures, const gx_color_index * tcolors,
71 int x, int y, int width, int height,
72 int phase_x, int phase_y, gs_logical_operation_t lop)
73 {
74 return_error(gs_error_rangecheck);
75 }
76
77 /* Stub default implementations of device procedures. */
78
79 int
gx_default_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_tile_bitmap * texture,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)80 gx_default_copy_rop(gx_device * dev,
81 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
82 const gx_color_index * scolors,
83 const gx_tile_bitmap * texture, const gx_color_index * tcolors,
84 int x, int y, int width, int height,
85 int phase_x, int phase_y, gs_logical_operation_t lop)
86 {
87 return_error(gs_error_unknownerror); /* not implemented */
88 }
89
90 int
gx_default_strip_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_strip_bitmap * textures,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)91 gx_default_strip_copy_rop(gx_device * dev,
92 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
93 const gx_color_index * scolors,
94 const gx_strip_bitmap * textures, const gx_color_index * tcolors,
95 int x, int y, int width, int height,
96 int phase_x, int phase_y, gs_logical_operation_t lop)
97 {
98 return_error(gs_error_unknownerror); /* not implemented */
99 }
100
101 int
mem_default_strip_copy_rop(gx_device * dev,const byte * sdata,int sourcex,uint sraster,gx_bitmap_id id,const gx_color_index * scolors,const gx_strip_bitmap * textures,const gx_color_index * tcolors,int x,int y,int width,int height,int phase_x,int phase_y,gs_logical_operation_t lop)102 mem_default_strip_copy_rop(gx_device * dev,
103 const byte * sdata, int sourcex, uint sraster, gx_bitmap_id id,
104 const gx_color_index * scolors,
105 const gx_strip_bitmap * textures, const gx_color_index * tcolors,
106 int x, int y, int width, int height,
107 int phase_x, int phase_y, gs_logical_operation_t lop)
108 {
109 return_error(gs_error_unknownerror); /* not implemented */
110 }
111
112 /* Stub RasterOp source devices. */
113
114 int
gx_alloc_rop_texture_device(gx_device_rop_texture ** prsdev,gs_memory_t * mem,client_name_t cname)115 gx_alloc_rop_texture_device(gx_device_rop_texture ** prsdev, gs_memory_t * mem,
116 client_name_t cname)
117 {
118 return_error(gs_error_rangecheck);
119 }
120
121 void
gx_make_rop_texture_device(gx_device_rop_texture * dev,gx_device * target,gs_logical_operation_t log_op,const gx_device_color * texture)122 gx_make_rop_texture_device(gx_device_rop_texture * dev, gx_device * target,
123 gs_logical_operation_t log_op, const gx_device_color * texture)
124 { /* Never called. */
125 }
126