home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / g / gs252src.zip / GS252 / ZHT2.C < prev    next >
C/C++ Source or Header  |  1992-07-26  |  3KB  |  112 lines

  1. /* Copyright (C) 1992 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* zht2.c */
  21. /* Level 2 halftone operators for Ghostscript */
  22. #include "ghost.h"
  23. #include "errors.h"
  24. #include "oper.h"
  25. #include "dict.h"
  26. #include "dparam.h"
  27. #include "name.h"        /* for name_eq */
  28. #include "state.h"
  29. #include "store.h"
  30.  
  31. /* Keys in halftone dictionaries: */
  32. static ref name_HalftoneType;
  33. static ref name_TransferFunction;
  34. /* Types 1 and 2 only: */
  35. static ref name_Frequency;
  36. static ref name_Angle;
  37. static ref name_SpotFunction;
  38. static ref name_AccurateScreens;
  39. static ref name_ActualFrequency;
  40. /* Types 3 and 4 only: */
  41. static ref name_Width;
  42. static ref name_Height;
  43. static ref name_Thresholds;
  44. /* Type 5 only: */
  45. static ref color_names[8];
  46. #define name_Gray color_names[0]
  47. #define name_Red color_names[1]
  48. #define name_Green color_names[2]
  49. #define name_Blue color_names[3]
  50. #define name_Cyan color_names[4]
  51. #define name_Magenta color_names[5]
  52. #define name_Yellow color_names[6]
  53. #define name_Black color_names[7]
  54. static ref name_Default;
  55.  
  56. /* Initialization */
  57. private void
  58. zht2_init()
  59. {    static const names_def htn[] = {
  60.  
  61.     /* Create the names of the halftone dictionary keys. */
  62.        { "HalftoneType", &name_HalftoneType },
  63.        { "TransferFunction", &name_TransferFunction },
  64.         /* Types 1 and 2 only: */
  65.        { "Frequency", &name_Frequency },
  66.        { "Angle", &name_Angle },
  67.        { "SpotFunction", &name_SpotFunction },
  68.        { "AccurateScreens", &name_AccurateScreens },
  69.        { "ActualFrequency", &name_ActualFrequency },
  70.         /* Types 3 and 4 only: */
  71.        { "Width", &name_Width },
  72.        { "Height", &name_Height },
  73.        { "Thresholds", &name_Thresholds },
  74.         /* Type 5 only: */
  75.        { "Gray", &name_Gray },
  76.        { "Red", &name_Red },
  77.        { "Green", &name_Green },
  78.        { "Blue", &name_Blue },
  79.        { "Cyan", &name_Cyan },
  80.        { "Magenta", &name_Magenta },
  81.        { "Yellow", &name_Yellow },
  82.        { "Black", &name_Black },
  83.        { "Default", &name_Default },
  84.  
  85.     /* Mark the end of the initalized name list. */
  86.        names_def_end
  87.     };
  88.  
  89.     init_names(htn);
  90. }
  91.  
  92.  
  93. /* currenthalftone */
  94. private int
  95. zcurrenthalftone(register os_ptr op)
  96. {    return e_undefined;
  97. }
  98.  
  99. /* sethalftone */
  100. private int
  101. zsethalftone(register os_ptr op)
  102. {    return e_undefined;
  103. }
  104.  
  105. /* ------ Initialization procedure ------ */
  106.  
  107. op_def zht2_op_defs[] = {
  108.     {"0currenthalftone", zcurrenthalftone},
  109.     {"1sethalftone", zsethalftone},
  110.     op_def_end(zht2_init)
  111. };
  112.