home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / GSHT.H < prev    next >
C/C++ Source or Header  |  1994-07-27  |  3KB  |  84 lines

  1. /* Copyright (C) 1993 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gsht.h */
  20. /* Public interface to halftone functionality */
  21.  
  22. #ifndef gsht_INCLUDED
  23. #  define gsht_INCLUDED
  24.  
  25. /* Client definition of (Type 1) halftones */
  26. typedef struct gs_screen_halftone_s {
  27.     float frequency;
  28.     float angle;
  29.     float (*spot_function)(P2(floatp, floatp));
  30.         /* setscreen or sethalftone sets these: */
  31.         /* (a Level 2 feature, but we include them in Level 1) */
  32.     float actual_frequency;
  33.     float actual_angle;
  34. } gs_screen_halftone;
  35. #define st_screen_halftone_max_ptrs 0
  36.  
  37. /* Client definition of color (Type 2) halftones */
  38. typedef struct gs_colorscreen_halftone_s {
  39.     union _css {
  40.         gs_screen_halftone indexed[4];
  41.         struct _csc {
  42.             gs_screen_halftone red, green, blue, gray;
  43.         } colored;
  44.     } screens;
  45. } gs_colorscreen_halftone;
  46. #define st_colorscreen_halftone_max_ptrs 0
  47.  
  48. /* Opaque definition of general halftones */
  49. #ifndef gs_halftone_DEFINED
  50. #  define gs_halftone_DEFINED
  51. typedef struct gs_halftone_s gs_halftone;
  52. #endif
  53.  
  54. /* Procedural interface */
  55. int    gs_setscreen(P2(gs_state *, gs_screen_halftone *));
  56. int    gs_currentscreen(P2(gs_state *, gs_screen_halftone *));
  57. int    gs_setcolorscreen(P2(gs_state *, gs_colorscreen_halftone *));
  58. int    gs_currentcolorscreen(P2(gs_state *, gs_colorscreen_halftone *));
  59.  
  60. /*
  61.  * Enumeration-style definition of a single screen.  The client must:
  62.  *    - probably, call gs_screen_enum_alloc;
  63.  *    - call gs_screen_init;
  64.  *    - in a loop,
  65.  *        - call gs_screen_currentpoint; if it returns 1, exit;
  66.  *        - call gs_screen_next;
  67.  *    - if desired, call gs_screen_install to install the screen.
  68.  */
  69. typedef struct gs_screen_enum_s gs_screen_enum;
  70. gs_screen_enum *gs_screen_enum_alloc(P2(gs_memory_t *, client_name_t));
  71. int    gs_screen_init(P3(gs_screen_enum *, gs_state *,
  72.               gs_screen_halftone *));
  73. int    gs_screen_currentpoint(P2(gs_screen_enum *, gs_point *));
  74. int    gs_screen_next(P2(gs_screen_enum *, floatp));
  75. int    gs_screen_install(P1(gs_screen_enum *));
  76.  
  77. /* Procedural interface for Level 2 functionality. */
  78. /* We include it here because it turns out to be convenient */
  79. /* to define setcolorscreen using sethalftone. */
  80. int    gs_sethalftone(P2(gs_state *, gs_halftone *));
  81. int    gs_currenthalftone(P2(gs_state *, gs_halftone *));
  82.  
  83. #endif                    /* gsht_INCLUDED */
  84.