[gs-cvs] rev 8447 - in trunk/gs: doc src

giles at ghostscript.com giles at ghostscript.com
Mon Dec 17 19:40:37 PST 2007


Author: giles
Date: 2007-12-17 19:40:36 -0800 (Mon, 17 Dec 2007)
New Revision: 8447

Removed:
   trunk/gs/src/gsropc.c
   trunk/gs/src/gsropc.h
   trunk/gs/src/gxropc.h
Modified:
   trunk/gs/doc/Develop.htm
   trunk/gs/src/lib.mak
Log:
Remove the unused composite_rop device.

DETAILS:

This was an attempt to implement PCL raster operations as an interposed 
device which first rendered to an intermediate buffer and them 
composited with the underlying device buffer, similar to how the
"PDF 1.4 Transparency" device works.

While this would be a nice approach, allowing raster operations to 
function in more color spaces, it was never completed, and presents
a maintenance burden for ongoing clist improvements. We are therefore
removing it. It can be reinstated later as a starting point for further 
development if needed.


Modified: trunk/gs/doc/Develop.htm
===================================================================
--- trunk/gs/doc/Develop.htm	2007-12-17 21:33:35 UTC (rev 8446)
+++ trunk/gs/doc/Develop.htm	2007-12-18 03:40:36 UTC (rev 8447)
@@ -1278,12 +1278,9 @@
 <a href="../src/gsnorop.c">src/gsnorop.c</a>,
 <a href="../src/gsrop.c">src/gsrop.c</a>,
 <a href="../src/gsrop.h">src/gsrop.h</a>,
-<a href="../src/gsropc.c">src/gsropc.c</a>,
-<a href="../src/gsropc.h">src/gsropc.h</a>,
 <a href="../src/gsropt.h">src/gsropt.h</a>,
 <a href="../src/gsroptab.c">src/gsroptab.c</a>,
-<a href="../src/gxdevrop.h">src/gxdevrop.h</a>,
-<a href="../src/gxropc.h">src/gxropc.h</a>.
+<a href="../src/gxdevrop.h">src/gxdevrop.h</a>.
 
 <dt>
 Alpha channel and compositing:

Deleted: trunk/gs/src/gsropc.c
===================================================================
--- trunk/gs/src/gsropc.c	2007-12-17 21:33:35 UTC (rev 8446)
+++ trunk/gs/src/gsropc.c	2007-12-18 03:40:36 UTC (rev 8447)
@@ -1,305 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
-   All Rights Reserved.
-  
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* RasterOp-compositing implementation */
-#include "gx.h"
-#include "gserrors.h"
-#include "gsutil.h"		/* for gs_next_ids */
-#include "gxdcolor.h"
-#include "gxdevice.h"
-#include "gxdevmem.h"
-#include "gxropc.h"
-
-/* ------ Object definition and creation ------ */
-
-/* Define RasterOp-compositing objects. */
-static composite_create_default_compositor_proc(c_rop_create_default_compositor);
-static composite_equal_proc(c_rop_equal);
-static composite_write_proc(c_rop_write);
-static composite_read_proc(c_rop_read);
-static const gs_composite_type_t gs_composite_rop_type =
-{
-    {
-	c_rop_create_default_compositor,
-	c_rop_equal,
-	c_rop_write,
-	c_rop_read,
-	gx_default_composite_adjust_ctm,
-	gx_default_composite_clist_write_update,
-	gx_default_composite_clist_read_update
-    }
-};
-
-private_st_composite_rop();
-
-/* Create a RasterOp-compositing object. */
-int
-gs_create_composite_rop(gs_composite_t ** ppcte,
-		const gs_composite_rop_params_t * params, gs_memory_t * mem)
-{
-    gs_composite_rop_t *pcte;
-
-    pcte = gs_alloc_struct(mem, gs_composite_rop_t, &st_composite_rop,
-			     "gs_create_composite_rop");
-    if (pcte == NULL)
-	return_error(gs_error_VMerror);
-    pcte->type = &gs_composite_rop_type;
-    pcte->id = gs_next_ids(1);
-    pcte->params = *params;
-    *ppcte = (gs_composite_t *) pcte;
-    return 0;
-}
-
-/* ------ Object implementation ------ */
-
-#define prcte ((const gs_composite_rop_t *)pcte)
-
-static bool
-c_rop_equal(const gs_composite_t * pcte, const gs_composite_t * pcte2)
-{
-    return (pcte2->type == pcte->type &&
-#define prcte2 ((const gs_composite_rop_t *)pcte2)
-	    prcte2->params.log_op == prcte->params.log_op &&
-	    (prcte->params.texture == 0 ? prcte2->params.texture == 0 :
-	     prcte2->params.texture != 0 &&
-	     gx_device_color_equal(prcte->params.texture,
-				   prcte2->params.texture)));
-#undef prcte2
-}
-
-static int
-c_rop_write(const gs_composite_t * pcte, byte * data, uint * psize)
-{
-/****** NYI ******/
-    if_debug('v', "[v]c_rop_write\n");
-}
-
-static int
-c_rop_read(gs_composite_t ** ppcte, const byte * data, uint size,
-	   gs_memory_t * mem)
-{
-    if_debug('v', "[v]c_rop_read)\n");
-/****** NYI ******/
-}
-
-/* ---------------- RasterOp-compositing device ---------------- */
-
-/* Define the default RasterOp-compositing device. */
-typedef struct gx_device_composite_rop_s {
-    gx_device_forward_common;
-    gs_composite_rop_params_t params;
-} gx_device_composite_rop;
-
-gs_private_st_suffix_add1_final(st_device_composite_rop,
-			 gx_device_composite_rop, "gx_device_composite_rop",
-	device_c_rop_enum_ptrs, device_c_rop_reloc_ptrs, gx_device_finalize,
-				st_device_forward, params.texture);
-/* The device descriptor. */
-static dev_proc_close_device(dcr_close);
-static dev_proc_fill_rectangle(dcr_fill_rectangle);
-static dev_proc_copy_mono(dcr_copy_mono);
-static dev_proc_copy_color(dcr_copy_color);
-static dev_proc_copy_alpha(dcr_copy_alpha);
-static const gx_device_composite_rop gs_composite_rop_device =
-{std_device_std_body_open(gx_device_composite_rop, 0,
-			  "RasterOp compositor", 0, 0, 1, 1),
- {gx_default_open_device,
-  gx_forward_get_initial_matrix,
-  gx_forward_sync_output,
-  gx_forward_output_page,
-  dcr_close,
-  gx_forward_map_rgb_color,
-  gx_forward_map_color_rgb,
-  dcr_fill_rectangle,
-  gx_default_tile_rectangle,
-  dcr_copy_mono,
-  dcr_copy_color,
-  gx_default_draw_line,
-  gx_default_get_bits,
-  gx_forward_get_params,
-  gx_forward_put_params,
-  gx_forward_map_cmyk_color,
-  gx_forward_get_xfont_procs,
-  gx_forward_get_xfont_device,
-  gx_forward_map_rgb_alpha_color,
-  gx_forward_get_page_device,
-  gx_forward_get_alpha_bits,
-  dcr_copy_alpha,
-  gx_forward_get_band,
-  gx_default_copy_rop,
-  gx_default_fill_path,
-  gx_default_stroke_path,
-  gx_default_fill_mask,
-  gx_default_fill_trapezoid,
-  gx_default_fill_parallelogram,
-  gx_default_fill_triangle,
-  gx_default_draw_thin_line,
-  gx_default_begin_image,
-  gx_default_image_data,
-  gx_default_end_image,
-  gx_default_strip_tile_rectangle,
-  gx_default_strip_copy_rop,
-  gx_forward_get_clipping_box,
-  gx_default_begin_typed_image,
-  gx_forward_get_bits_rectangle,
-  gx_forward_map_color_rgb_alpha,
-  gx_no_create_compositor
- }
-};
-
-/* Create a RasterOp compositor. */
-int
-c_rop_create_default_compositor(const gs_composite_t * pcte,
-	gx_device ** pcdev, gx_device * dev, gs_imager_state * pis,
-	gs_memory_t * mem)
-{
-    gs_logical_operation_t log_op = prcte->params.log_op;
-    const gx_device_color *texture = prcte->params.texture;
-    gx_device_composite_rop *cdev;
-
-#if 0				/*************** */
-    if (<<operation is identity >>) {
-	/* Just use the original device. */
-	*pcdev = dev;
-	return 0;
-    }
-#endif /*************** */
-    cdev =
-	gs_alloc_struct_immovable(mem, gx_device_composite_rop,
-				  &st_device_composite_rop,
-				  "create default RasterOp compositor");
-    *pcdev = (gx_device *) cdev;
-    if (cdev == 0)
-	return_error(gs_error_VMerror);
-    gx_device_init((gx_device *)cdev,
-		   (const gx_device *)&gs_composite_rop_device, mem, true);
-    gx_device_copy_params((gx_device *)cdev, dev);
-    /*
-     * Check for memory devices, and select the correct RasterOp
-     * implementation based on depth and device color space.
-     ****** NYI ******
-     */
-    gx_device_set_target((gx_device_forward *)cdev, dev);
-    cdev->params = prcte->params;
-    return 0;
-}
-
-/* Close the device and free its storage. */
-static int
-dcr_close(gx_device * dev)
-{				/*
-				 * Finalization will call close again: avoid a recursion loop.
-				 */
-    set_dev_proc(dev, close_device, gx_default_close_device);
-    gs_free_object(dev->memory, dev, "dcr_close");
-    return 0;
-}
-
-/* ------ Imaging ------ */
-
-/* Import the existing RasterOp implementations. */
-extern dev_proc_strip_copy_rop(gx_default_strip_copy_rop);
-
-static int
-dcr_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
-		   gx_color_index color)
-{
-    gx_device_composite_rop *rdev = (gx_device_composite_rop *) dev;
-
-    /*
-     * This is where all the work gets done right now.
-     * Sooner or later, we'll have to do the right thing here....
-     */
-    gs_logical_operation_t log_op = rdev->params.log_op;
-    const gx_device_color *texture = rdev->params.texture;
-    gx_color_index colors[2];
-    gx_color_index tcolors[2];
-
-    dev_proc_strip_copy_rop((*copy)) = gx_default_strip_copy_rop;
-
-    colors[0] = colors[1] = color;
-    if (gs_device_is_memory(dev)) {
-/****** SHOULD CHECK FOR STANDARD COLOR REPRESENTATION ******/
-	switch (dev->color_info.depth) {
-	    case 1:
-		copy = mem_mono_strip_copy_rop;
-		break;
-	    case 2:
-	    case 4:
-		copy = mem_gray_strip_copy_rop;
-		break;
-	    case 8:
-	    case 24:
-		copy = mem_gray8_rgb24_strip_copy_rop;
-		break;
-	    case 16:
-	    case 32:
-/****** NOT IMPLEMENTED ******/
-	}
-    }
-    if (texture == 0) {
-	return (*copy)
-	    (dev, (const byte *)0, 0, 0, gx_no_bitmap_id,
-	     (const gx_color_index *)0, (const gx_strip_bitmap *)0, colors,
-	     x, y, w, h, 0, 0, log_op);
-    }
-    /* Apply the texture, whatever it may be. */
-    if (gx_dc_is_pure(texture)) {
-	tcolors[0] = tcolors[1] = texture->colors.pure;
-	return (*copy)
-	    (dev, (const byte *)0, 0, 0, gx_no_bitmap_id, colors,
-	     (const gx_strip_bitmap *)0, tcolors,
-	     x, y, w, h, 0, 0, log_op);
-    } else if (gx_dc_is_binary_halftone(texture)) {
-	tcolors[0] = texture->colors.binary.color[0];
-	tcolors[1] = texture->colors.binary.color[1];
-	return (*copy)
-	    (dev, (const byte *)0, 0, 0, gx_no_bitmap_id, colors,
-	     &texture->colors.binary.b_tile->tiles, tcolors,
-	     x, y, w, h, texture->phase.x, texture->phase.y, log_op);
-    } else if (gx_dc_is_colored_halftone(texture)) {
-/****** NO CAN DO ******/
-    } else
-/****** WHAT ABOUT PATTERNS? ******/
-	return_error(gs_error_rangecheck);
-}
-
-static int
-dcr_copy_mono(gx_device * dev, const byte * data,
-	    int dx, int raster, gx_bitmap_id id, int x, int y, int w, int h,
-	      gx_color_index zero, gx_color_index one)
-{
-/****** TEMPORARY ******/
-    return gx_default_copy_mono(dev, data, dx, raster, id, x, y, w, h,
-				zero, one);
-}
-
-static int
-dcr_copy_color(gx_device * dev, const byte * data,
-	       int dx, int raster, gx_bitmap_id id,
-	       int x, int y, int w, int h)
-{
-/****** TEMPORARY ******/
-    return gx_default_copy_color(dev, data, dx, raster, id, x, y, w, h);
-}
-
-static int
-dcr_copy_alpha(gx_device * dev, const byte * data, int data_x,
-	   int raster, gx_bitmap_id id, int x, int y, int width, int height,
-	       gx_color_index color, int depth)
-{
-/****** TEMPORARY ******/
-    return gx_default_copy_alpha(dev, data, data_x, raster, id, x, y,
-				 width, height, color, depth);
-}

Deleted: trunk/gs/src/gsropc.h
===================================================================
--- trunk/gs/src/gsropc.h	2007-12-17 21:33:35 UTC (rev 8446)
+++ trunk/gs/src/gsropc.h	2007-12-18 03:40:36 UTC (rev 8447)
@@ -1,49 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
-   All Rights Reserved.
-  
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* RasterOp-compositing interface */
-
-#ifndef gsropc_INCLUDED
-#  define gsropc_INCLUDED
-
-#include "gscompt.h"
-#include "gsropt.h"
-
-/*
- * Define parameters for RasterOp-compositing.
- * There are two kinds of RasterOp compositing operations.
- * If texture == 0, the input data are the texture, and the source is
- * implicitly all 0 (black).  If texture != 0, it defines the texture,
- * and the input data are the source.  Note that in the latter case,
- * the client (the caller of gs_create_composite_rop) promises that
- * *texture will not change.
- */
-
-#ifndef gx_device_color_DEFINED
-#  define gx_device_color_DEFINED
-typedef struct gx_device_color_s gx_device_color;
-
-#endif
-
-typedef struct gs_composite_rop_params_s {
-    gs_logical_operation_t log_op;
-    const gx_device_color *texture;
-} gs_composite_rop_params_t;
-
-/* Create a RasterOp-compositing object. */
-int gs_create_composite_rop(gs_composite_t ** ppcte,
-			    const gs_composite_rop_params_t * params,
-			    gs_memory_t * mem);
-
-#endif /* gsropc_INCLUDED */

Deleted: trunk/gs/src/gxropc.h
===================================================================
--- trunk/gs/src/gxropc.h	2007-12-17 21:33:35 UTC (rev 8446)
+++ trunk/gs/src/gxropc.h	2007-12-18 03:40:36 UTC (rev 8447)
@@ -1,42 +0,0 @@
-/* Copyright (C) 2001-2006 Artifex Software, Inc.
-   All Rights Reserved.
-  
-   This software is provided AS-IS with no warranty, either express or
-   implied.
-
-   This software is distributed under license and may not be copied, modified
-   or distributed except as expressly authorized under the terms of that
-   license.  Refer to licensing information at http://www.artifex.com/
-   or contact Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134,
-   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* $Id$ */
-/* Internals for RasterOp compositing */
-
-#ifndef gxropc_INCLUDED
-#  define gxropc_INCLUDED
-
-#include "gsropc.h"
-#include "gxcomp.h"
-
-/* Define RasterOp-compositing objects. */
-typedef struct gs_composite_rop_s {
-    gs_composite_common;
-    gs_composite_rop_params_t params;
-} gs_composite_rop_t;
-
-#define private_st_composite_rop() /* in gsropc.c */\
-  gs_private_st_ptrs1(st_composite_rop, gs_composite_rop_t,\
-    "gs_composite_rop_t", composite_rop_enum_ptrs, composite_rop_reloc_ptrs,\
-    params.texture)
-
-/*
- * Initialize a RasterOp compositing function from parameters.
- * We make this visible so that clients can allocate gs_composite_rop_t
- * objects on the stack, to reduce memory manager overhead.
- */
-void gx_init_composite_rop(gs_composite_rop_t * pcte,
-			   const gs_composite_rop_params_t * params);
-
-#endif /* gxropc_INCLUDED */

Modified: trunk/gs/src/lib.mak
===================================================================
--- trunk/gs/src/lib.mak	2007-12-17 21:33:35 UTC (rev 8446)
+++ trunk/gs/src/lib.mak	2007-12-18 03:40:36 UTC (rev 8447)
@@ -1826,9 +1826,6 @@
 # ---------------- RasterOp et al ---------------- #
 # Note that noroplib is a default, roplib replaces it.
 
-gsropc_h=$(GLSRC)gsropc.h $(gscompt_h) $(gsropt_h)
-gxropc_h=$(GLSRC)gxropc.h $(gsropc_h) $(gxcomp_h)
-
 noroplib_=$(GLOBJ)gsnorop.$(OBJ)
 $(GLD)noroplib.dev : $(LIB_MAK) $(ECHOGS_XE) $(noroplib_)
 	$(SETMOD) $(GLD)noroplib $(noroplib_)
@@ -1884,11 +1881,6 @@
 $(GLOBJ)gsroptab.$(OBJ) : $(GLSRC)gsroptab.c $(stdpre_h) $(gsropt_h)
 	$(GLCC) $(GLO_)gsroptab.$(OBJ) $(C_) $(GLSRC)gsroptab.c
 
-# The following is not used yet.
-$(GLOBJ)gsropc.$(OBJ) : $(GLSRC)gsropc.c $(GXERR)\
- $(gsutil_h) $(gxdcolor_h) $(gxdevice_h) $(gxdevmem_h) $(gxropc_h)
-	$(GLCC) $(GLO_)gsropc.$(OBJ) $(C_) $(GLSRC)gsropc.c
-
 # ---------------- Async rendering ---------------- #
 
 gxpageq_h=$(GLSRC)gxpageq.h $(gsmemory_h) $(gxband_h) $(gxsync_h)



More information about the gs-cvs mailing list