home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / postscri / 6108 < prev    next >
Encoding:
Text File  |  1992-12-28  |  1.6 KB  |  34 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!umn.edu!femto!cahoon
  3. From: cahoon@femto.cs.umn.edu (Forrest Clinton Cahoon)
  4. Subject: problem manipulating binary data in postscript
  5. Message-ID: <1992Dec28.171257.27785@news2.cis.umn.edu>
  6. Sender: news@news2.cis.umn.edu (Usenet News Administration)
  7. Nntp-Posting-Host: femto.cs.umn.edu
  8. Organization: University of Minnesota, Minneapolis, CSci dept.
  9. Date: Mon, 28 Dec 1992 17:12:57 GMT
  10. Lines: 22
  11.  
  12. I'm trying to write some postscript which will color a hexagonal grid,
  13. reading the color data from the end of my ps file.  I'm reading one
  14. byte for each hexagon, then doing some bit-twiddling to get values to call
  15. setrgbcolor with before filling the hexagon.
  16.  
  17. I've got a version using "read" which works, but since "read" treats my
  18. newline characters as valid binary data, it's not entirely
  19. satisfactory.
  20.  
  21. What I want to use is "readhexstring", but since what this reads in is
  22. treated as a string rather than an integer, I'm having trouble.  I
  23. need to convert my one-byte string into an integer having the same
  24. binary representation.  I don't want "cvi", because this parses a
  25. string which represents an integer to us humans, and puts that value
  26. on the stack -- cvi would read (1) and put the integer value 1 on the
  27. stack, but what I need would take (1) and put the integer value 49 --
  28. the ASCII value of the character 1 -- on the stack.
  29.  
  30. --
  31. |  Forrest Cahoon      | cahoon@cs.umn.edu |------------------------------|
  32. |  850 21st Ave SE     |-------------------| Only unbalanced people       |
  33. |  Mpls MN  55414-2514 |                   |        can tip the scales... |
  34.