gdevplnx.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 1998 Aladdin Enterprises. All rights reserved.
  2. This file is part of AFPL Ghostscript.
  3. AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND. No author or
  4. distributor accepts any responsibility for the consequences of using it, or
  5. for whether it serves any particular purpose or works at all, unless he or
  6. she says so in writing. Refer to the Aladdin Free Public License (the
  7. "License") for full details.
  8. Every copy of AFPL Ghostscript must include a copy of the License, normally
  9. in a plain ASCII text file named PUBLIC. The License grants you the right
  10. to copy, modify and redistribute AFPL Ghostscript, but only under certain
  11. conditions described in the License. Among other things, the License
  12. requires that the copyright notice and this notice be preserved on all
  13. copies.
  14. */
  15. /*$Id: gdevplnx.h,v 1.2 2000/09/19 19:00:20 lpd Exp $*/
  16. /* Definitions and API for plane extraction device */
  17. /* Requires gxdevcli.h */
  18. #ifndef gdevplnx_INCLUDED
  19. # define gdevplnx_INCLUDED
  20. #include "gxrplane.h"
  21. /*
  22. * A plane-extraction device appears to its client to be a color-capable
  23. * device, like its target; but it actually extracts a single color plane
  24. * for rendering to yet another device, called the plane device (normally,
  25. * but not necessarily, a memory device). Clients must know the pixel
  26. * representation in detail, since the plane is specified as a particular
  27. * group of bits within the pixel.
  28. *
  29. * The original purpose of plane-extraction devices is for band list
  30. * rendering for plane-oriented color printers. Each per-plane rasterizing
  31. * pass over the band list sends the output to a plane-extraction device for
  32. * the plane being printed. There is one special optimization to support
  33. * this: on the theory that even bands containing output for multiple bands
  34. * are likely to have many objects that only write white into that band, we
  35. * remember whether any (non-white) marks have been made on the page so far,
  36. * and if not, we simply skip any rendering operations that write white.
  37. *
  38. * The depth of the plane_extract device and its target are limited to 32
  39. * bits; the depth of each plane is limited to 8 bits. We could raise these
  40. * without too much trouble if necessary, as long as each plane didn't
  41. * exceed 32 bits.
  42. */
  43. typedef struct gx_device_plane_extract_s {
  44. gx_device_forward_common;
  45. /* The following are set by the client before opening the device. */
  46. gx_device *plane_dev; /* the drawing device for the plane */
  47. gx_render_plane_t plane;
  48. /* The following are set by open_device. */
  49. gx_color_index plane_white;
  50. uint plane_mask;
  51. bool plane_dev_is_memory;
  52. /* The following change dynamically. */
  53. bool any_marks;
  54. } gx_device_plane_extract;
  55. extern_st(st_device_plane_extract);
  56. #define public_st_device_plane_extract() /* in gdevplnx.c */\
  57. gs_public_st_complex_only(st_device_plane_extract, gx_device_plane_extract,\
  58. "gx_device_plane_extract", 0, device_plane_extract_enum_ptrs,\
  59. device_plane_extract_reloc_ptrs, gx_device_finalize)
  60. /* Initialize a plane extraction device. */
  61. int plane_device_init(P5(gx_device_plane_extract *edev, gx_device *target,
  62. gx_device *plane_dev,
  63. const gx_render_plane_t *render_plane,
  64. bool clear));
  65. #endif /* gdevplnx_INCLUDED */