gdevmrop.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* Copyright (C) 1995, 2000 Aladdin Enterprises. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gdevmrop.h,v 1.6 2002/06/16 07:25:26 lpd Exp $ */
  14. /* Definitions for device RasterOp implementations. */
  15. /* Requires gxdevmem.h, gsropt.h */
  16. #ifndef gdevmrop_INCLUDED
  17. # define gdevmrop_INCLUDED
  18. /*
  19. * Compute the effective RasterOp for the 1-bit case,
  20. * taking transparency into account.
  21. */
  22. gs_rop3_t gs_transparent_rop(gs_logical_operation_t lop);
  23. #ifdef DEBUG
  24. /* Trace a [strip_]copy_rop call. */
  25. void trace_copy_rop(const char *cname, gx_device * dev,
  26. const byte * sdata, int sourcex, uint sraster,
  27. gx_bitmap_id id, const gx_color_index * scolors,
  28. const gx_strip_bitmap * textures,
  29. const gx_color_index * tcolors,
  30. int x, int y, int width, int height,
  31. int phase_x, int phase_y, gs_logical_operation_t lop);
  32. #endif
  33. /*
  34. * PostScript colors normally act as the texture for RasterOp, with a null
  35. * (all zeros) source. For images with CombineWithColor = true, we need
  36. * a way to use the image data as the source. We implement this with a
  37. * device that applies RasterOp with a specified texture to drawing
  38. * operations, treating the drawing color as source rather than texture.
  39. * The texture is a gx_device_color; it may be any type of color, even a
  40. * pattern.
  41. */
  42. #ifndef gx_device_color_DEFINED
  43. # define gx_device_color_DEFINED
  44. typedef struct gx_device_color_s gx_device_color;
  45. #endif
  46. #ifndef gx_device_rop_texture_DEFINED
  47. # define gx_device_rop_texture_DEFINED
  48. typedef struct gx_device_rop_texture_s gx_device_rop_texture;
  49. #endif
  50. struct gx_device_rop_texture_s {
  51. gx_device_forward_common;
  52. gs_logical_operation_t log_op;
  53. gx_device_color texture;
  54. };
  55. #define private_st_device_rop_texture() /* in gdevrops.c */\
  56. gs_private_st_composite_use_final(st_device_rop_texture,\
  57. gx_device_rop_texture, "gx_device_rop_texture",\
  58. device_rop_texture_enum_ptrs, device_rop_texture_reloc_ptrs,\
  59. gx_device_finalize)
  60. /* Create a RasterOp source device. */
  61. int gx_alloc_rop_texture_device(gx_device_rop_texture ** prsdev,
  62. gs_memory_t * mem,
  63. client_name_t cname);
  64. /* Initialize a RasterOp source device. */
  65. void gx_make_rop_texture_device(gx_device_rop_texture * rsdev,
  66. gx_device * target,
  67. gs_logical_operation_t lop,
  68. const gx_device_color * texture);
  69. #endif /* gdevmrop_INCLUDED */