next up previous 231
Next: ACCESSING HEADER INFORMATION
Up: Modifying images
Previous: Modifying an image

Modifying a copy of an image

This example copies the input image first and then modifies the copy. This is essential if the input image needs to be kept. A complete program called add.f exists (see §[*]).

*  Access an existing image.
      CALL IMG_IN( 'IN', NX, NY, IPIN, ISTAT )

*  Create a new output image by copying the input image.
      CALL IMG_OUT( 'IN', 'OUT', IPOUT, ISTAT )               [1]

*  Modify the output image.
      CALL DOFILL( %VAL( IPOUT ), NX, NY, ISTAT )

*  Free the input and output images.
      CALL IMG_FREE( '*', ISTAT )                             [2]
The following notes refer to the numbered statements:
1.
The call to IMG_OUT creates a new output image associated with the parameter 'OUT' by copying the one associated with the parameter 'IN'. It returns a pointer IPOUT for the output image data.

2.
Notice that the names of the image parameters are not shown explicitly in this call to IMG_FREE. Using a '*' indicates that all known images should be freed.



next up previous 231
Next: ACCESSING HEADER INFORMATION
Up: Modifying images
Previous: Modifying an image

IMG Simple Image Data Access
Starlink User Note 160
P.W. Draper
R.F. Warren-Smith
3 March 2003
E-mail:P.W.Draper@durham.ac.uk

Copyright © 2000-2003 Council for the Central Laboratory of the Research Councils