You can now use KAPPA to create some small images which you can then display and manipulate. The simplest way to create an image is to use command CREFRAME, which you can type in lower case if you like:
After a loading message, the first thing that happens is that you are invited to specify a value for one of the program parameters:
XDIM - x dimension of output array /64/ >
(If you have used CREFRAME before, you might find the `
/64/' in the
line comes out as something else.)
This line is typical of the way in which ADAM asks for parameter values.
The first field, in this case `XDIM', is the parameter keyword -- the name by
which the parameter is known to the user.
Then, after the `
-' delimiter, comes the second field, in this case
x dimension of output array'.
This is a brief description of what the parameter means.
The third field, in this case `
/64/', shows a suggested value for the
If you just press CR in response to the prompt, the suggested value will
be taken as the value you wish to specify for that parameter.
Sometimes a suggested value will not be displayed in a prompt.
In this case you must specify a value.
For the purposes of this example it is sensible to choose a small array size, say 1010. Thus, the suggested value of `64' is not what you want and you must specify the value you require by entering the value `10':
XDIM - x dimension of output array /64/ > 10
The parameter system then accepts this value as the value of the parameter XDIM. Once you press CR, the system will present you with a prompt for another parameter value:
YDIM - y dimension of output array /64/ >
This prompt is similar to the previous one, and the suggested value is `64' as before. Specify the value `10' again:
YDIM - y dimension of output array /64/ > 10
The system now presents you with the following lines:
GS = Gaussians, RR = Random 0 to 1, RL = Random from Min to Max, RA = Ramp across image, FL = Flat, BL = Blank, GN = Gaussian noise with standard deviation about the mean, RP = Poissonian noise about mean. TYPED - Type of data to be generated /'GS'/ >
The first four indicate the codes you can enter in response to the parameter prompt and the meanings attached to them. The last is a prompt in the same format as the previous prompts with a suggested value of `GS'. In this case, the input required is a character string rather than an integer -- you can usually tell what type of input is required from the format of the suggested value. For this illustration, generate an array that is simple in structure to make it easy to follow what is going on. Choose an image in the form of a `ramp' -- this is an array whose pixel values rise or fall steadily from left to right or from top to bottom. The code is `RA':
TYPED - Type of data to be generated /'GS'/ > ra
You may wonder why the suggested value is surrounded by quotes but the supplied
value is not.
In fact, the supplied value should strictly be
'RA', but it is
permissible to omit the quote characters as long as there is no ambiguity in
The next line to appear is:
LOW - Lower limit for data >
This time the suggested value field (the `/.../' bit) is missing. Whether it is present or not depends on how the programmer has used the parameter system and whether or not he thinks a suggested value is appropriate. Because no suggested value is given, you need to enter a value -- use `1' for the lower limit and `10' for the upper limit:
LOW - Lower limit for data > 1 HIGH - Upper limit for data > 10
The next prompt is:
DIRN - Direction of ramping /1/ >
This time you have suggested value again, but what does the number mean? You can find out by entering `?':
DIRN - Direction of ramping /1/ > ?
The system will explain that `1' generates pixels which increase from left to right, `2' generates pixels which increase from right to left, `3' bottom to top, and `4' top to bottom. Choose the suggested value `1' by just pressing CR:
DIRN - Direction of ramping /1/ >
The next prompt to appear is:
OUTPIC - Image for output data >
Here there is no suggested value, so you must enter your own. The response required is a name for the generated image; call it RAMP1:
OUTPIC - Image for output data > ramp1 ICL>
After `ramp1' is entered the program generates the required image, so there may be a slight delay. The `ICL' prompt indicates that the CREFRAME command has completed its task and has returned control to the command language processor. The generated image will be called `RAMP1' and will be stored in a file called RAMP1.SDF in your default directory -- take a look, you will find it is there.
If you now generate three more 1010 images containing different types of ramp, you can display and process them in various ways. Each time you want to create a new image using CREFRAME, you must enter the name of the program as a command:
ICL> creframe XDIM - x dimension of output array /10/ >
Notice that the second and all subsequent times you run an application program, there is no delay while it is loaded; the response is almost immediate. This is one of the main advantages of running applications from ICL. Notice also that the suggested value has changed from `64' to `10' -- the parameter system has remembered the value you last entered for XDIM; this is called its `current value'. (The current values of parameters used by KAPPA commands are stored in the file KAPPA.SDF in your ADAM_USER directory.) Thus, you can just press CR to accept the suggested value. Generating the next image is going to be easy, isn't it?
YDIM - y dimension of output array /10/ > GS = Gaussians, RR = Random 0 to 1, RL = Random from Min to Max, RA = Ramp across image, FL = Flat, BL = Blank, GN = Gaussian noise with standard deviation about mean, RP = Poissonian noise about mean. TYPED - Type of data to be generated /'GS'/ >
Wait a minute -- last time you specified `RA' as the value of TYPED, but the suggested value has remained `GS' as it was originally. In this case, the suggested value `GS' is generated by the program and the current value is not used. Once again, it all depends on how the parameter system has been used by the programmer -- this subject will be considered in more detail in Chapter . All you can do is keep a careful eye on the suggested values. Here you must specify `RA' explicitly again in order to generate a ramp:
TYPED - Type of data to be generated /'GS'/ > ra LOW - Lower limit for data > 1 HIGH - Upper limit for data > 10 DIRN - Direction of ramping /1/ > 2 OUTPIC - Image for output data > ramp2 ICL>
This time DIRN has been set to `2' and the image called `RAMP2'.
In a similar way, you can now generate images called `RAMP3' and `RAMP4' with DIRN set to 3 and 4 respectively. Notice that the suggested value for DIRN is similar to that for TYPED in that it always has the same value rather than the last used value.
ADAM The Starlink Software Environment