home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / util / wb / procurepens / grabcmap.doc < prev    next >
Text File  |  1993-12-26  |  4KB  |  105 lines

  1.  
  2. GrabCMAP
  3. ~~~~~~~~
  4. Support utility for ProcurePens/SetPens.
  5.  
  6.  
  7. Copyright ©1993 by Joseph Luk.  All rights reserved.
  8.  
  9. ----------------------------------------------------------- MAIN DOCUMENTATION
  10.  
  11. Introduction
  12. ~~~~~~~~~~~~
  13.    I was amazed at the amount of feedback I received after the inital release
  14. of the ProcurePens package.  I had no idea that so many people would be using
  15. the utilities, and thus didn't build much "user-friendliness" into them.  Thus
  16. it was somewhat inconvenient to set colors by hand.  GrabCMAP is a small
  17. part of addressing this issue.
  18.  
  19. What is it?
  20. ~~~~~~~~~~~
  21.    GrabCMAP reads the color palette from an IFF ILBM picture, and writes out
  22. a configuration file for use with ProcurePens.  Thanks to Zak Jarvis for this
  23. great suggestion!  All you need is any IFF ILBM picture with a CMAP chunk
  24. (color map).  Just about all of them posess this chunk, with the exception
  25. of 24-bit IFFs (you can't open a 16M color Workbench yet anyway).
  26.  
  27. Usage
  28. ~~~~~
  29.    Like most of my programs, GrabCMAP uses the system standard way of parsing
  30. CLI arguments.  Thus, type GrabCMAP ? for the template:
  31.    
  32.    IFFINPUT/A,CONFIGOUTPUT/A,OFFSET/N,HELP/S:
  33.    
  34. Arguments:
  35.  
  36.    IFFINPUT - (always required)  The name of the IFF ILBM picture file to
  37.       read.  GrabCMAP will read the color of each pen defined in its color
  38.       map chunk, and write them out sequentially.
  39.       
  40.    CONFIGOUTPUT - (always required)  The name of the config file to write.
  41.       GrabCMAP will create a new config file or overwrite an already existing
  42.       one without prompting you.  This config file is immediately ready to
  43.       use with ProcurePens.
  44.       
  45.    OFFSET - (numeric quantity)  Frequently, you won't want to use ProcurePens
  46.       to attempt to change and lock the first four colors, since these are
  47.       defined by Workbench.  Also defined by Workbench are the last four
  48.       colors of the palette, so also make sure you don't mess with those
  49.       either.  This provides the option of "offsetting" each of the pens
  50.       in the IFF input file by a certain amount.  That is, each of the pen
  51.       numbers in the input file becomes written out as (pen number + offset).
  52.       For example, if your offset is 3, pen 0 in the IFF picture becomes pen 3
  53.       in the ProcurePens config file, pen 1 becomes pen 4, and so on.  You
  54.       will usually want to edit the resulting config file to get the total
  55.       number of pens you want ProcurePens to lock.
  56.    
  57.    HELP - (switch)  Provides limited online help.
  58.    
  59.       
  60.  
  61. Example Session
  62. ~~~~~~~~~~~~~~~
  63.    I have a 64-color IFF file called "Beastie.pic" containing a picture of an
  64.    icon I want to use on my Workbench.  I already have a utility to convert
  65.    this picture to an icon form, but obviously the palette on my Workbench
  66.    must be the same as the one in the icon for it to look right.  The first
  67.    and the last four colors of my icon's palette are already identical to
  68.    those already set by Workbench's Palette Preferences.
  69.    
  70.    I open a Shell, and type:
  71.  
  72.       GrabCMAP Beastie.pic MyWBPalette.config
  73.       
  74.    After quickly confirming that GrabCMAP read the correct color values and
  75.    wrote the right pen numbers out, I edit MyWBPalette.config.
  76.    
  77.    I delete the first four color entries (the ones beginning with 0, 1, 2,
  78.    and 3) in the configuration file, being careful to preserve the one-line
  79.    header.  It now reads:
  80.       
  81.       ProcurePens Config File
  82.       4
  83.       232
  84.       135
  85.       14
  86.       ---
  87.    And so on.
  88.   
  89.    Now I jump to the end of the file, and delete the last four entries.  Then
  90.    I change the three dashes ending the file to "END".  It now looks like:
  91.   
  92.       (lots of stuff above)
  93.       ---
  94.       59
  95.       142
  96.       100
  97.       84
  98.       END
  99.    
  100.    Now I'm all ready to go.  I've made sure that the pens I want ProcurePens
  101.    to lock are not needed for anything else, and now edit my startup-sequence
  102.    so that ProcurePens reads MyWBPalette.config and sets up the colors
  103.    so that the icon looks correct.
  104.    
  105.