next up previous 231
Next: Modifying a copy of an image
Up: Examples of using IMG from C
Previous: Creating a new image

Modifying an image

This example shows how to access an existing image and modify its values.
   /* Access an existing image. */
   imgMod( "in", &nx, &ny, &ip, istat );

   /* Set all elements with a value above 32000 to 32000. */
   for( i=0; i <nx*ny; i++ ) {
       if ( ip[i] > 32000.0f ) {
          ip[i] = 32000.0f;
       }
   }

   /* Free the image */
   imgFree( "in", istat );



next up previous 231
Next: Modifying a copy of an image
Up: Examples of using IMG from C
Previous: Creating a new 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