home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsp / palgen / !PalGen / HelpGen / HelpText < prev   
Encoding:
Text File  |  1995-03-08  |  12.8 KB  |  351 lines

  1. @#Reason
  2.                   Documentation for !PalGen
  3.  
  4.                       By Ian Nichols
  5.  
  6.  
  7. Purpose of this program:  Edit/Generate 256 colour palettes
  8.  
  9.   Machine compatibility:  Anything with RiscOS 3.1 or higher
  10.                           Looks better on a RiscPC.
  11.  
  12.      @%Instructions#  <- Click on this button for instructions on how to use
  13.             this help system.
  14.  
  15. Like many freeware programs, !PalGen was written partly as a programming
  16. exercise and partly to do something the way that the programmer wants it to
  17. be done rather than the way everyone else seems to do it.  In this case, the
  18. task in question is the generation and editing of 256 colour palettes,
  19. primarily for use with images created by !Fractal, but the palettes can also
  20. be used with any RISC OS 256-colour sprite.  Though it was developed on an
  21. ageing A310 with no more graphics enhancement than a VIDC enhancer, it is
  22. intended to be used on a machine with VIDC20, which allows the 256 colours to
  23. be selected from a 24-bit palette.  It has been tried on a RiscPC (someone
  24. else's - I'm still saving!) and seems to work as expected.
  25.  
  26. !PalGen can also save and load 256 colour palettes in the form used by the PC
  27. freeware program FractInt.
  28.  
  29.      @%RiscOS#     RiscOS palette format
  30.     
  31.      @%Fractint#     FractInt palette format
  32.  
  33. !PalGen has been written to be fully RISC OS compliant, and considering that
  34. it is only my second Wimp program I am quite pleased with its behaviour.  It
  35. supports both the file and RAM transfer protocols, although you do get some
  36. strange error messages when saving palettes into sprites in !Paint. I am told
  37. that this is almost certainly due to a bug in !Paint, but if there is someone
  38. out there who can find a bug in !PalGen which is causing this, please could
  39. they tell me!.
  40.  
  41.  
  42.  
  43. @#Use
  44. Using !PalGen
  45. -------------
  46.  
  47. The way in which !PalGen works is somewhat different from other palette
  48. editors you may have seen.  Instead of setting colours individually or
  49. setting groups of colours by interpolating between two endpoints, !PalGen
  50. represents the whole palette as a set of 3 histograms; one for the red
  51. intensities, one for the green and one for the blue.  These histograms can be
  52. altered using the mouse or by means of 3 equations.
  53.  
  54.      @%MouseOps#     Mouse operations
  55.     
  56.      @%Equations#     Alter With Equations
  57.  
  58. Starting the application and opening the main window are all done in the
  59. usual RISC OS way.  I have not set up a run action for palette files (type
  60. &FED), so to load them you will have to drag their icons onto the !PalGen
  61. icon bar icon or the main window if it is open.  The default 256 colour
  62. palette is automatically loaded when the program starts (this is the same
  63. on a RiscPC as on the older machines).
  64.  
  65.  
  66.  
  67. @#MouseOps
  68. Clicking on the icon bar icon, or dragging a palette file onto it will open
  69. the main window and the palette window. By default the main window will
  70. display the histogram for red intensities.  You can view and edit the green
  71. or blue intensities by clicking on the appropriate radio button. Please be
  72. patient, it is interpreted BASIC after all.  Each column of the histogram
  73. represents the intensity (0-255) of a logical colour (also 0-255).  As you
  74. move the mouse pointer over the histogram, the logical colour number and
  75. intensity corresponding to the mouse pointer position are displayed to the
  76. right of the radio buttons.
  77.  
  78. Clicking with...
  79.  
  80. Select: Will set the intensity of the red, green or blue component of the
  81.         logical colour corresponding to the pointer position.
  82.  
  83. Adjust: Will set the intensity of the red, green or blue component of the
  84.         logical colour correspoding to the pointer position and interpolate
  85.         all the colours between the current pointer position and the last
  86.         pointer position where a mouse click took place.
  87.  
  88. Note that if you hold down the mouse button, both of these actions will
  89. auto-repeat as fast as the program can keep up.  The palette display (if
  90. open) will update immediately.
  91.  
  92.  
  93.  
  94. @#Menu
  95. Clicking with Menu whilst over the main window will open a menu with the
  96. following items:
  97.  
  98. @%Save#   Save            Opens a save box
  99.  
  100. @%Equations#   Equations       Opens the 'Alter with equations' dialogue box.
  101.  
  102.      Show Palette    Opens the palette display if it is closed.
  103.  
  104.  
  105.  
  106. @#Save
  107. The Save Box
  108. ------------
  109. The Save box is not quite the standard RISC OS item - it has two radio
  110. buttons to select the type of file you wish to save the palette as (see later
  111. for brief description of the two types.  The palette is saved in the usual
  112. RISC OS way, i.e. you drag the file icon to a filer window (or the
  113. appropriate window of whatever other application you want to save it into).
  114.  
  115.  
  116.  
  117. @#Equations
  118. Alter With Equations
  119. --------------------
  120. The 'Alter With Equations' dialogue box contains 3 writable icons into which
  121. you can type equations to alter the red, green and blue components of the
  122. colours in the palette.  If you press RETURN or click on the 'Alter Palette'
  123. icon, the program will execute a FOR...NEXT loop for each logical colour
  124. (0-255), applying the expressions to the appropriate colour component.
  125.  
  126.  
  127.  
  128. @#EquationVars
  129. There are 2 variables which you can use in the expressions you type: LCN% and
  130. CV%.  LCN% is simply the logical colour number.  CV% is used to store the
  131. current value of each colour component for each logical colour just before
  132. the expression is evaluated, i.e. leaving the expression as 'CV%' (the
  133. default) will not change that component of the palette.  CV%/2 will divide
  134. the intensities of a colour component by 2 for the whole palette.
  135. Intensities greater than 255 or less than 0 are checked for and clipped if
  136. necessary.
  137.  
  138. By using this facility it is possible to do some rudimentary colour
  139. processing.  Load a 256 colour sprite into !Paint and make sure it has its
  140. own palette.  Save the palette into !PalGen and alter it, then save it back
  141. into the sprite window in !Paint.
  142.  
  143. Some useful ones to try might be:
  144.  
  145.      255-CV% will invert a primary colour.  Using this for all 3
  146.           primaries will produce a colour negative of the image.
  147.  
  148.      CV%+x or CV%*x will increase the amount of a primary (can be
  149.           used to lighten/darken an image or create/correct a colour cast).
  150.  
  151.      CV%/x + y will compress the range of tones used in the image
  152.  
  153.      (CV%-x)*y will expand the mid-tones of the image to fill the full
  154.           tonal range (if the image contained tones at the extremities,
  155.           these will be clipped).
  156.  
  157. You can also use boolean expressions to limit the range of logical colours to
  158. be altered.
  159.  
  160.      CV%+(50*-(LCN%>128 AND LCN%<192))
  161.  
  162. will add 50 to the logical colours from 129 to 191 (inclusive).
  163.  
  164. This works because a boolean expression such as (LCN%>128 AND LCN%<192) gives
  165. a result of TRUE or FALSE; TRUE has a numerical value of -1 and FALSE has a
  166. numerical value of 0.
  167.  
  168.  
  169.  
  170.  
  171. File Types Supported
  172. --------------------
  173.  
  174. Two file types are supported: the standard RISC OS 256 colour palette, as
  175. exported by !Paint and as used by !Fractal, and the 256 colour palette files
  176. used by the PC freeware program FractInt.
  177.  
  178.  
  179. @#RiscOS
  180. The RISC OS palette files contain a sequence of 6 bytes for each colour as
  181. follows:
  182.  
  183.     19 <logical colour number> 16 <Red> <green> <blue>
  184.  
  185. This sequence corresponds to the BASIC command
  186.  
  187.            VDU  19,l,p,r,g,b
  188.  
  189. Which is used to set the physical colour of logical colour 'l'.  These files
  190. are identified by having the file type &FED and being 1536 bytes long.  When
  191. files of type &FED are loaded into !PalGen, the length of the file is checked
  192. and the first 3 bytes are tested (they will always be 19 0 16 if all is
  193. well).
  194.  
  195.  
  196.  
  197. @#Fractint
  198. The files used by FractInt are plain ASCII text files and should have the
  199. type &FFF (text) or &FE4 (DOS) before you try to import them.  When you
  200. export this type of file, remember to give them the extension .MAP before you
  201. try to load them into FractInt.  They consist of red, green and blue values
  202. (separated by spaces) for each logical colour in order, starting with 0, one
  203. line for each logical colour. They may also contain embedded comments on any
  204. line, after the colour information.
  205.  
  206. Because they are constructed in this way, these files do not have a fixed
  207. length, which makes them slightly trickier to deal with.  If you have
  208. problems importing these, load them into your favourite text editor and
  209. examine them, bearing in mind the following points.
  210.  
  211. 1)   !PalGen checks that the first 3 bytes of the file give a valid
  212.      number in the range 0-255.  It does this by reading successive
  213.      bytes from the file until it finds a numeric character, then
  214.      assembles successive bytes into a string until it encounters a
  215.      non-numeric character.  If it has read more than four bytes
  216.      (i.e. 3 digits plus the next, non-numeric, character) then it
  217.      assumes that the file is not a valid palette file and reports
  218.      an error.
  219.  
  220. 2)   If the file contains any comments then they should be separated
  221.      from the colour information by at least one TAB character
  222.      (ASCII 9).  Note that any comments are ignored when !PalGen
  223.      imports these files and that !PalGen adds comments of its own
  224.      when exporting palettes in this format.
  225.  
  226.  
  227.  
  228.  
  229. Well, I hope someone out there finds this program useful.  If anyone is
  230. wondering why I have included some sort of  support for a PC program, the
  231. answer is this: I believe that if Acorn machines and RISC OS are to survive
  232. as a computing platform, it is important that we can exchange data with
  233. users of other platforms in both directions.  Especially when those 'users of
  234. other platforms' are also ourselves. Acorn users can import a variety of data
  235. types from other platforms (mostly the IBM PC clones), but this is almost an
  236. implicit admission that our platform is 'not good enough' - if it's any good,
  237. why can't we create our own masterpieces? Well we can, its just that we can't
  238. easily get them onto other types of computer....
  239.  
  240. I like to think that in some small way I am helping to spread the message of
  241. data portability by doing this.
  242.  
  243.  
  244.  
  245. @#Status
  246. !PalGen is freeware.  You can give it to whoever you like as long as you
  247. include this file don't charge them any money (except for the disc).  The
  248. author retains copyright of !PalGen.
  249.  
  250.  
  251.  
  252. @#Thanks
  253. Finally, thanks to...
  254. ---------------------
  255.  
  256. Mike Curnow et al for producing !Fractal, which led me to want to write this
  257. program in the first place, thereby forcing me to tackle the intricacies of
  258. RISC OS compliance, and also for encouragement, feedback and bug reports.
  259.  
  260. The Stone Soup group for producing FractInt, (even though they did have to do
  261. it on a PC clone) which, I believe, inspired !Fractal.
  262.  
  263. Ben Summers for writing HelpGen, which was used to produce this help system.
  264.  
  265. Whoever it was who designed the icon for filetype &FED (palette) which I have
  266. included with this program (it is loaded by the IconSprites command in the
  267. !Boot file).  Likewise the nice round radio buttons.
  268.  
  269. Dominic Symes for producing !Zap - the best text editor at the price (ha ha).
  270.  
  271. Dick Alstein for producing !TemplEd, which I used to generate my templates.
  272.  
  273.  
  274.  
  275. @#Author
  276. Ian Nichols
  277. 128 Westbury Road
  278. Westbury-on-Trym
  279. Bristol
  280. BS9 3AR
  281.  
  282. E-mail: i.a.nichols@bris.ac.uk
  283.  
  284. February 1995
  285.  
  286.  
  287.  
  288. @#Versions
  289. Version History
  290. ---------------
  291.  
  292. 1.00 December 1994
  293.  
  294. The first version which actually performed all the tasks that I wanted it to
  295. (i.e. loading, editing and saving RISC OS and FractInt palettes).  Also the
  296. first version to be released.
  297.  
  298.  
  299. 1.10 February 1995
  300.  
  301. A smartened up version with the following extra features:
  302.  
  303.      The application has a smart new icon.
  304.  
  305.      Histograms are displayed in the appropriate primary colour.
  306.  
  307.      Colour number and intensity information are blanked out when
  308.      the mouse pointer leaves the histogram.
  309.  
  310.      FractInt palettes can be loaded with the DOS filetype (&FE4),
  311.      so they can be loaded straight from DOS discs without changing
  312.      their type to text (&FFF).
  313.  
  314.      Warnings are issued before quitting or loading new data if
  315.      the current data has not been saved to permanent storage.
  316.  
  317.      Intensity values are now truncated properly when 'Alter With
  318.      Equations' generates a value <0 or >255.
  319.  
  320.  
  321.  
  322. 1.11 February 1995
  323.  
  324.      An asterisk is displayed after the file name in the title bars
  325.      of the main window and palette window to indicate that the
  326.      currently loaded palette has been altered.
  327.  
  328.      Last minute update: the above now works when the only changes
  329.      are made using the 'Alter With Equations' feature.
  330.  
  331.  
  332.  
  333.  
  334. @#Instructions
  335. How to use this help system.
  336. ----------------------------
  337.  
  338. At various places in the help file, you will see little buttons like this:
  339.  
  340.                 @%Instructions#
  341.                 
  342. with some text next to them.  Click on the button to go to the subject
  343. described by the text (as you may have done to get here).  Double-Click with
  344. adjust anywhere in this window to return to the point you jumped from.
  345.  
  346. Alternatively, use the Menu button of your mouse to bring up a menu of
  347. subjects which you can jump straight to.  If only all of life were this
  348. simple!
  349.  
  350.  
  351.