home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 580a.lha / HDFView_v3.01 / hdfview.doc.pp / hdfview.doc
Text File  |  1991-12-05  |  11KB  |  282 lines

  1. ImageView v3.0
  2. : A Utility for viewing HDF image files.
  3. (c) 1991 Richard A. Gerber
  4.  
  5. This program is freely distributable. Do with it whatever you wish.
  6. However, be warned, this program is not meant to be more that a quick
  7. and dirty way to view NCSA image files on the Amiga. Hopefully, this
  8. viewer will produce a good representation of the image and be nice
  9. to the Amiga system, but I make no guarantees. (I am not, after all,
  10. a programmer.)
  11. (NOTE: This program is in no way associated with the National
  12. Center for Supercomputing Applications (NCSA), although the HDF
  13. routines are theirs.  Direct all complaints to me.)
  14.  
  15. All that said, I wanted to be able to view NCSA HDF image files on my
  16. Amiga. Since I had already ported most of the HDF library, the only
  17. problem was that HDF RIS8 images use 256 colors from a
  18. palette of (256)^3 colors. My solution: HAM-E by Black Belt Systems.
  19. The HAM-E unit produces a very nice rendering of the HDF image files,
  20. the main disadvantage being its resolution limit of 320x400.
  21.  
  22. This program now demands AmigaOS 2.04 (probably it can get away with
  23. any 2.0x). I have no documentation for 2.0, however, so it will still
  24. be a while until I get a handle on all the available screen sizes and 
  25. resolutions. (What is this autoscrolling feature?). In any case, images
  26. large than the screen resolution will be truncated, ie. no scrolling.
  27. However, in principle, you can save the image as an IFF file and then
  28. use a viewer (like Mostra) to scroll around in the picture. (I have found
  29. a slight bug in the iff.library routines that save some screen
  30. sizes incorrectly).
  31.  
  32. You can start HDFView from either the Workbench or Shell
  33.  
  34. NOTES:
  35. You need iff.library (included) to be in your libs: directory.
  36. You need hame.library in your libs: directory if you want to use 
  37. the HAM-E modes.
  38.  
  39. I've tested this only on my A2000 w/GVP 68030/68882. The binaries
  40. have been compiled for any 68xxx processor. As there are virtually no
  41. floating point operations in the current version, I have not included
  42. any 68030/68882 version.
  43.  
  44. No attempt is made to preserve aspect ratios, etc. (However, aspect
  45. ratios in the postscript output file should be correct.) One pixel is
  46. drawn for every entry in the image array. Therefore a 250x250 image
  47. will be 250x250 pixels.
  48.  
  49.  
  50. PROGRAM OPERATION:
  51. When you start the program from either the Workbench or from the CLI 
  52. the program opens two screens: one where the images will be rendered
  53. and a second screen with gadgets to control the program. The title screen
  54. (if available) is shown on the image screen. 
  55.  
  56. Once you have both screens open you can use the right mouse button (RMB)
  57. to send them to the front/back. Click the RMB anywhere on the gadget screen
  58. to make it go away. Click the RMB anywhere in the image screen to make
  59. the gadget screen reappear. You can slide the screens around by using
  60. the 2.0 keypress/left mouse button trick.
  61.  
  62. There is one (kind of) wierd thing about the way the HDF library
  63. operates: If you try to open a file (be it an image or a palette) twice
  64. in a row, the function call to open it a second time will fail. Remember
  65. this if you open a palette, fiddle with it, then try to reload it again.
  66. You will have to load a different palette, then reload the original
  67. one. 
  68.  
  69. Further interaction with the program takes place via the gadgets, which
  70. are described below:
  71.  
  72. QUIT:
  73.     Quits.
  74. INFO:
  75.     Gives me credit. Also shows image size and free memory.
  76.     Use the close gadget on the window to continue.
  77. FILE:
  78.     Presents you with 5 new gadgets:
  79.     
  80.     Open:
  81.         Brings up a file requester for you to choose an image
  82.         file. By default, only files with an .hdf extension are
  83.         shown. To see all files, rub out the #?.hdf pattern
  84.         in the file requester. If the open call is successful
  85.         the image will be rendered using the palette (if
  86.         available) stored with the image. 
  87.     Next:
  88.         Loads and displays the next image in an hdf file.
  89.         If there are no more images in the file, you are informed
  90.         of this by a requester and the Next gadget is then ghosted.
  91.     SaveIFF:
  92.         Brings up a file requester to allow you to save whatever's
  93.         on the image screen to an IFF file. I am using the
  94.             PD iff.library. It usually seems to work well, but I
  95.         have noticed a few screen sizes that it saves incorrectly. 
  96.     SavePS:
  97.         Brings up a file requester to allow you to save whatever
  98.         image you have loaded as a 256-gray shade postscript
  99.         image. I haven't included any bells and whistles here,
  100.         but try this option if you have a postscript printer. You
  101.         can always edit the postscript file yourself if you want
  102.         more control over the output.
  103.     Main:
  104.         Takes you back to the main deck of gadgets. 
  105.     
  106. Palette:
  107.     Takes you to a another deck of gadgets.
  108.     Show:
  109.         Shows the current palette in a window on the image screen.
  110.         Clicking Show again removes the window.
  111.         You can drag the palette window around. However, if you have
  112.         a HAM-E screen open this can cause problems in two ways.
  113.         (1) If you place the window on an odd pixel it will display
  114.         incorrectly. The program will fix this problem itself if
  115.         you activate any window other than the palette window. 
  116.         (2) It's possible that you could place the window such
  117.         that the HAM-E unit will turn off. HAM-E turns itself off
  118.         if it detects a full scan line of color 0. The fix for
  119.         this is to try to move the palette window such that there
  120.         never is  a full line of color 0. Usually this can be
  121.         accomplished by moving the window away from the left
  122.         hand edge of the screen.
  123.     Load:
  124.         Brings up a file requester for you to load an HDF palette
  125.         file. By default the requester looks for the file extension
  126.         .pal. The program will only load HDF files that contain
  127.         palettes. It seems that many NCSA HDF utility programs like
  128.         to produce 768-byte raw palettes. If you have one of these
  129.         use the utility "paltohdf" to convert them to HDF files.
  130.     Save:
  131.         I haven't implemented this yet. Sorry.
  132.     
  133.     Next there are three slider gadgets to show you the color levels and
  134.     let you fiddle with them. The three gadgets represent the 
  135.     standard RGB color levels. If you click anywhere in the image
  136.     screen, the color underneath the pointer will be reported by
  137.     these gadgets. If you are using standard Amiga screens, the 
  138.     Color Level values will range from 0-15 or 0-31 depending on the
  139.     screen resolution. The intensity, reported to the right of each
  140.     RGB gadget, ranges from 0-15.
  141.     If you are using HAM-E the Color Level will range from 0-255. The
  142.     intensity will range from 0-255 for each of R,G,B.
  143.     Once you have chosen a color level by clicking on the image screen
  144.     you can change the colors by using the slider gadgets.
  145.  
  146.     Main:
  147.         Takes you back to the main deck of gadgets.
  148. Screen:
  149.     Takes you to another deck of gadgets from which you choose
  150.     screen resolutions.
  151.     LORES:
  152.         A 32-color low-resolution Amiga screen. 
  153.     LACE:    
  154.         A 32-color low-resolution interlaced Amiga screen.
  155.     HIRES:
  156.         A 16-color high-resolution Amiga screen.
  157.     HILACE:
  158.         A 16-color high-resolution interlaced Amiga screen.
  159.     Ham-E:
  160.         A 256-color low-resolution HAM-E screen. You won't see
  161.         this gadget unless you have hame.library in your LIBS:
  162.         directory.
  163.     HELACE:
  164.         A 256-color low-resolution interlaced HAM-E screen.
  165.         You won't seen this one either unless you have 
  166.         hame.library.
  167.     Main:
  168.         Back to the main deck of gadgets.
  169.     
  170.  
  171. ERROR MESSAGES:
  172.     I've tried to do adequate error checking in the program. If
  173. the program won't run, it should tell you what the problem is.  
  174.  
  175. KNOWN BUGS:
  176. * Some PS files will not print on our Apple Personal LaserWriter. These
  177.   files print OK, however, on a SparcPrinter and the PD program Post
  178.   shows the source to be OK. I think it's a memory management problem
  179.   with the printer, but since it does not have an interactive mode
  180.   and Apple tries to hide the inner workings of everything they make,
  181.   I don't know what is going on.
  182.  
  183. FUTURE:
  184. * Color postscript printing
  185. * Background printing
  186. * Animations
  187. * User aborts of print and drawing jobs while in progress
  188. * Saving of palettes
  189. * Contour plots (including color)
  190. * Ability to print contour plots
  191. * Preferences printer support
  192. * Screen scaling to preserve aspect ratio
  193. * Screen scrolling
  194. * User definable scaling
  195.  
  196. MORE NOTES:
  197. Please let me know if something about the program doesn't work. Also
  198. let me hear any suggestions you may have as to how to improve the
  199. program. I have made a very consious effort to conform to Amiga programming
  200. guidelines with the program.
  201.  
  202. The source code is available if you want it. Just ask (see address
  203. below). The source code for the HDF routines is available from NCSA
  204. by anonymous ftp at ftp.ncsa.uiuc.edu. The Amiga-ized (SAS/C v5.10a)
  205. HDF source is available either from NCSA or me. I also have available
  206. the compiled HDF library for the Amiga.
  207.  
  208.  
  209. Regards,
  210. Richard Gerber
  211. Physics grad student
  212. University of Illinos at Urbana-Champaign
  213. gerber@rigel.astro.uiuc.edu
  214. u12696@u2.ncsa.uiuc.edu
  215.  
  216. Revision History:
  217. v1.01
  218. * Fixed bug that crashed system if non-HDF chosen from file requester.
  219. * Fixed bug that crashed system if file requester chosen while info
  220.   window was open.
  221. * Fixed bug that didn't return 40 bytes of memory on error exit.
  222.  
  223. v1.02
  224. * Fixed another nasty bug that crashed machine if a non-HDF image file
  225.   was chosen from file requester.
  226. * Added interlace option for 256 and 32 color screens.
  227. * Reduced drawing time a bit for some images.
  228.  
  229. v1.03
  230. * Added contour window
  231. * Initial screen is now 32-color lo-res.
  232.  
  233. v1.04
  234. * Added postscript greyscale printing support
  235.  
  236. v1.04a
  237. * Sped up postscript file writing routine
  238.  
  239. v1.04b
  240. * Made postscript output look nicer
  241. * Added menu item to read next image from a file
  242. * Fixed bug that crashed system if invalid postscript filename given
  243.  
  244. v1.05
  245. * Added ability to read scaling info if accompanied by SDS min/max info.
  246. * Added scale to postscript output
  247. * Generally cleaned a few things up
  248.  
  249. v1.06
  250. * Fixed bug in postscript dump routine that couldn't handle images
  251.   that weren't integral multiples of 256.
  252.  
  253. v2.0
  254. * Added HAM-E support.
  255.     - Removed menus and added gadgets.
  256.     - created two separate screens.
  257. * Removed contour plot option (use hdfcontour program)
  258.  
  259. v2.01
  260. * Added support for HDF palettes.
  261. * Added gadgets to manipulate colors.
  262.  
  263. v2.02
  264. * Added support to save images as IFF files.
  265. * Deleted command-line options and filename passing.
  266.  
  267. v3.0
  268. * Updated program to use 2.04 functions.
  269.     - standard file requesters 
  270.     - new window look
  271. * Now writes error messages to requesters rather to stderr.
  272. * Creates screens as large as the images (unfortunately I don't know
  273.     how to implement the autoscroll feature of 2.0 yet).
  274. v3.01
  275. * Fixed bug that fouled up system upon exit when started from interlaced screen
  276.   and using HAM-E.
  277. * Fixed font problem related to color gadgets
  278. * Removed enforcer hits when click LMB on HAM-E "cookie"
  279.  
  280.  
  281.  
  282.