home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
util
/
wb
/
procurepens
/
grabcmap.doc
< prev
next >
Wrap
Text File
|
1993-12-26
|
4KB
|
105 lines
GrabCMAP
~~~~~~~~
Support utility for ProcurePens/SetPens.
Copyright ©1993 by Joseph Luk. All rights reserved.
----------------------------------------------------------- MAIN DOCUMENTATION
Introduction
~~~~~~~~~~~~
I was amazed at the amount of feedback I received after the inital release
of the ProcurePens package. I had no idea that so many people would be using
the utilities, and thus didn't build much "user-friendliness" into them. Thus
it was somewhat inconvenient to set colors by hand. GrabCMAP is a small
part of addressing this issue.
What is it?
~~~~~~~~~~~
GrabCMAP reads the color palette from an IFF ILBM picture, and writes out
a configuration file for use with ProcurePens. Thanks to Zak Jarvis for this
great suggestion! All you need is any IFF ILBM picture with a CMAP chunk
(color map). Just about all of them posess this chunk, with the exception
of 24-bit IFFs (you can't open a 16M color Workbench yet anyway).
Usage
~~~~~
Like most of my programs, GrabCMAP uses the system standard way of parsing
CLI arguments. Thus, type GrabCMAP ? for the template:
IFFINPUT/A,CONFIGOUTPUT/A,OFFSET/N,HELP/S:
Arguments:
IFFINPUT - (always required) The name of the IFF ILBM picture file to
read. GrabCMAP will read the color of each pen defined in its color
map chunk, and write them out sequentially.
CONFIGOUTPUT - (always required) The name of the config file to write.
GrabCMAP will create a new config file or overwrite an already existing
one without prompting you. This config file is immediately ready to
use with ProcurePens.
OFFSET - (numeric quantity) Frequently, you won't want to use ProcurePens
to attempt to change and lock the first four colors, since these are
defined by Workbench. Also defined by Workbench are the last four
colors of the palette, so also make sure you don't mess with those
either. This provides the option of "offsetting" each of the pens
in the IFF input file by a certain amount. That is, each of the pen
numbers in the input file becomes written out as (pen number + offset).
For example, if your offset is 3, pen 0 in the IFF picture becomes pen 3
in the ProcurePens config file, pen 1 becomes pen 4, and so on. You
will usually want to edit the resulting config file to get the total
number of pens you want ProcurePens to lock.
HELP - (switch) Provides limited online help.
Example Session
~~~~~~~~~~~~~~~
I have a 64-color IFF file called "Beastie.pic" containing a picture of an
icon I want to use on my Workbench. I already have a utility to convert
this picture to an icon form, but obviously the palette on my Workbench
must be the same as the one in the icon for it to look right. The first
and the last four colors of my icon's palette are already identical to
those already set by Workbench's Palette Preferences.
I open a Shell, and type:
GrabCMAP Beastie.pic MyWBPalette.config
After quickly confirming that GrabCMAP read the correct color values and
wrote the right pen numbers out, I edit MyWBPalette.config.
I delete the first four color entries (the ones beginning with 0, 1, 2,
and 3) in the configuration file, being careful to preserve the one-line
header. It now reads:
ProcurePens Config File
4
232
135
14
---
And so on.
Now I jump to the end of the file, and delete the last four entries. Then
I change the three dashes ending the file to "END". It now looks like:
(lots of stuff above)
---
59
142
100
84
END
Now I'm all ready to go. I've made sure that the pens I want ProcurePens
to lock are not needed for anything else, and now edit my startup-sequence
so that ProcurePens reads MyWBPalette.config and sets up the colors
so that the icon looks correct.