diff options
author | Dan Coby <dan.coby@artifex.com> | 2002-09-21 00:26:04 +0000 |
---|---|---|
committer | Dan Coby <dan.coby@artifex.com> | 2002-09-21 00:26:04 +0000 |
commit | 212f2e5e7080aa9048d46126a1545c8031659f34 (patch) | |
tree | c0b80fb00f418ddcf8a02966dc0fb8be1a62701a /gs/src/gdevdbit.c | |
parent | c51d14784c208a1ce474c038af484923f8e77f85 (diff) |
The attached code generalizes the sample_load_* and sample_store_* macros
in gsbitops.h to handle depths up to 64 bits. In addition to providing
64 bit versions of these macros, we also added the macros sample_load_any,
sample_load_next_any, and sample_store_next_any. These macros are intended
to be used in situations in which any supported depth may be used. All of
the invocations of the sample_load32, sample_load_next32, etc. macros have
been changed to invoke the *_any version of these macros instead. In
addition, a few minor changes have been made to silence compiler warning
messages.
Modified files:
src/gdevalph.c
Changed invocations of the sample_{load|store}_next32 macro to be
invocations of sample_{load|store}_next_any instead. Also made various
changes to allow the code to be compiled with the DeviceN system (the
file has apparently not been compiled for some time).
src/gdevdbit.c
Made a couple of minor changes to silence compiler warning messages.
src/gdevdgbr.c
Changed invocations of the sample_{load|store}_next32 macro to be
invocations of sample_{load|store}_next_any instead.
src/gdevmpla.c
Changed invocations of the sample_{load|store}_next32 macro to be
invocations of sample_{load|store}_next_any instead.
src/gsbitops.c
Changed invocations of the sample_{load|store}_next32 macro to be
invocations of sample_{load|store}_next_any instead. Also made the
value being read/written be of type gx_color_index rather than
type bits32.
src/gsbitops.h
Added 64-bit versions of the sample_load* and sample_store* macros.
Also added *_any versions of these macros, to be used in situations
where any supported color depth may be encountered.
src/gxcindex.h
Changed an invocation of the sample_store_next32 macro to be an
invocation of sample_store_next_any instead. Also updated a comment.
src/lib.mak
Updated the dependency list for gsbitops.c.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@3071 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevdbit.c')
-rw-r--r-- | gs/src/gdevdbit.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gs/src/gdevdbit.c b/gs/src/gdevdbit.c index a91bcd9f0..01826c1c5 100644 --- a/gs/src/gdevdbit.c +++ b/gs/src/gdevdbit.c @@ -223,13 +223,17 @@ gx_default_copy_alpha(gx_device * dev, const byte * data, int data_x, previous = 0; switch (bpp >> 3) { case 8: - previous += (gx_color_index) * src++ << 56; + previous += (gx_color_index) * src++ + << sample_bound_shift(previous, 56); case 7: - previous += (gx_color_index) * src++ << 48; + previous += (gx_color_index) * src++ + << sample_bound_shift(previous, 48); case 6: - previous += (gx_color_index) * src++ << 40; + previous += (gx_color_index) * src++ + << sample_bound_shift(previous, 40); case 5: - previous += (gx_color_index) * src++ << 32; + previous += (gx_color_index) * src++ + << sample_bound_shift(previous, 32); case 4: previous += (gx_color_index) * src++ << 24; case 3: @@ -395,7 +399,7 @@ gx_default_strip_tile_rectangle(gx_device * dev, const gx_strip_bitmap * tiles, int code; if (color0 == gx_no_color_index && color1 == gx_no_color_index) - proc_color = dev_proc(dev, copy_color); + proc_color = dev_proc(dev, copy_color), proc_mono = 0; else proc_color = 0, proc_mono = dev_proc(dev, copy_mono); |