ChangeBG  -  A ChangeFSI front end

by Thomas Down

This application cannot be run from the RISC User disc

ChangeBG provides a multitasking front end to Acorn's ChangeFSI
image processor. Unlike other such front ends (including the program
supplied with ChangeFSI on the RISC OS 3.1 support disc), ChangeBG
allows you to continue to work while it processes. This is achieved
using techniques described in the article Pre-emptive Multitasking with
TaskWindow in this month's RISC User magazine. The way in
which this is done is discussed later.

ChangeBG will work with ChangeFSI version 0.90 (as supplied on the RISC OS 3.1 Support Disc), and also versions 0.95 (supplied with the Risc PC) and 0.98.


Installing ChangeBG
ChangeBG is supplied without the ChangeFSI image processor. Before you
can use ChangeBG, you must install the image processor, as follows:

1. Click on the item's icon in the RISC User menu system, or double-click on the !ChangeBG icon in the root directory of the magazine disc. An archive will be opened containing the ChangeBG application.

2. Drag ChangeBG from the archive to a blank, formatted floppy disc or a hard disc. 

3. Locate versions 0.90, 0.95 or 0.98 of ChangeFSI. Copy the application to the same disc as the ChangeBG application.

4. Double-click on the !ChangeBG icon. An installation window will open.

5. Drag the !ChangeFSI icon from the directory viewer into the ChangeBG installation window.

6. During the installation procedure, you may be required to swap floppy discs.

7. When installation is complete, a BEEP will sound and an installation complete window will appear.

8. Close the installation complete window. ChangeBG is now ready to use. You may make copies of the installed version FOR PERSONAL USE.


Running ChangeBG
ChangeBG is loaded onto the icon bar by double clicking on its icon in a
directory viewer. Clicking Menu over the icon bar icon pops up a menu,
providing Info and Quit options. The Info option gives information about
the current version of ChangeBG. Quit removes the program from the icon
bar.


Processing an image
To process an image using ChangeBG, the following procedure is always
used:

1. Drag the image to be processed to the ChangeBG icon.

2. A save box will appear. Enter the name you wish to be used for the processed image, and drag the icon to a directory viewer.

3. As soon as you drop the icon in the directory viewer, processing will start. The status indicator beneath the ChangeBG icon will change from Idle to Processing. You may notice that the desktop slows down slightly, but you will be able to continue to work while the image is processed.

4. When processing is complete, the status indicator will change back to Idle. If the relevant option has not been turned off, a BEEP will be sounded.

NOTE: You cannot drag the icon from the save box straight into another
program. You must save the image to disc, then, once processing is
complete, load it into your target application.


Options
ChangeBG provides access to a wide range of ChangeFSI options. Each of
these is documented using the interactive help program (!Help), which
can be loaded by clicking on the 'i' icon in the options window.

To open the options window, click select over ChangeBG's icon bar icon.
It can be closed again by clicking on the window's Cancel button.

Any changes you make in the options window can be made effective by
clicking on the Set button. They can be saved to disc for use the next
time ChangeBG is loaded by clicking on the Save button before clicking
on Set.


Memory
Due to the way in which the image processor was written, the ChangeBG
system can suffer from a variety of memory related problems.

The memory allocation for the image processor can be specified from the
options window. However, if it is changed, the changes do not take
effect until either:

1. ChangeBG is next loaded (assuming the new memory allocation has been saved).

2. The Force button is pressed.

When specifying a memory allocation, remember that the first 200k is
required for the image processor program itself. What is left will be
used for images. The recommended minimum allocation is 400k.

For normal image processing, the Use strips option should always be
left ON. This means that if an image is too large to be processed in the
memory available, it will be processed a strip at a time. In most cases,
this will allow you to leave the memory allocation at around 400k and
expect no memory problems.

Unfortunately, the Use strips option DOES NOT WORK with the Rotate and
Vertical Flip options. In these cases, Use strips is automatically
ignored.

If Use strips is not in use, the image processor may well run out of
memory. In this case, a dialogue box will appear allowing you to either
quit ChangeBG, or restart the operation with a different memory
allocation. If you choose the latter, alter the memory allocation in the
writable field, then click on restart.

NOTE: If you attempt to run the image processor with a file which it
does not understand, you may also see the 'Out of memory' dialogue box.
In this case, click on the Quit button.   


Problems
Due to the fact that ChangeFSI was not originally written as a
background task, the ChangeBG system suffers from a problem when
processing JPEG files. For part of the processing time, the background
processing system will break down, i.e. the desktop will apear to hang.
THE SYSTEM IS STILL WORKING and normal background operation will resume
after a few seconds.

This occurs because JPEG files are handled not by ChangeFSI but by a
program called djpeg which is run by ChangeFSI. It would not be possible
to make djpeg run in the background without very major modifications to
ChangeFSI itself.


How it works
(Note to readers - This assumes that you have read the Pre-emptive
multitasking with TaskWindow article referred to earlier.)

When ChangeBG starts up, it loads the small Basic program, BackEnd,
using the *TaskWindow command. BackEnd in turns loads ChangeFSI as a
library (See ChangeFSI documentation).

When ChangeBG wishes to start an operation, it writes a full ChangeFSI
command line string to a pipe file (these strings may be too long to pass
as a Wimp message (limit ~220 bytes). It then sends a 'Start' signal to
the background task using normal TaskWindow messages.

On receiving the 'Start' command, BackEnd reads the command string from
the pipe, and passes it to FNChangeFSI. When the processing operation is
complete, BackEnd sends a 'Finished' message. On receiving this message,
ChangeBG beeps and resets its status indicator. 


Copyright  RISC User 1995
