The following functions can be used to manipulate IIT pixel data by copying data into and out of the IIT_PIXEL common block:
int get_iit_pixel(int iit,int x,int y); int get_iit_pixel_id(int pid); int get_nth_iit_pixel(int n); void put_iit_pixel(void); void add_iit_pixel(void); void append_iit_pixel(void); void clear_iit_pixels(void); int PIXID(IIT_PIXEL_COM p); int PIXID3(iit,x,y); int PIDX(int p); int PIDY(int p); int PIDI(int p);
get_iit_pixel() can be used to copy any given pixel from the pixel data structures into the IIT_PIXEL common block. The ADC brightness is returned to the caller. This function treats all pixels as if they exist. If it is called with an invalid pixel number (i.e. one with coordinates outside the boundary of the IIT window or for a non-existent IIT) then it treats this as an unhit pixel and returns 0 accordingly.
get_iit_pixel_id() is not really a function. It's a macro
for get_iit_pixel() which allows you to retrieve a pixel based on
its ``id'' number. Every pixel has a unique id number defined
as
. Additional macros, PIXID, PIXID3,
PIDX, PIDY, and PIDI
can be used to translate from a pixel to an id number, or from an id number
to an X coordinate, a Y
coordinate, or an IIT number.
get_nth_iit_pixel() works much the same as get_iit_pixel() except that the argument is a single integer and only pixels which have been hit are returned. The argument is a simple counter. This function is designed to be put in simple for/while/do loops to loop over all hit pixels. It is important to note that this function numbers the first hit pixel as ``1'' not ``0''. This should be intuitive for Fortran users but counterintuitive for C hackers. If the argument passed to get_nth_iit_pixel() is larger than the total number of pixels, then -1 is returned and the contents of IIT_PIXEL remain unchanged.
put_iit_pixel() copies from the IIT_PIXEL common block into the main data structures. No arguments are required. The value of IIT_PIXEL.b will overwrite any previously stored value in the main data structures.
add_iit_pixel(), in contrast to put_iit_pixel(), does not simply overwrite the existing brightness value. The new value is set to the old value plus the value in IIT_PIXEL.b.
clear_iit_pixels() erases all pixel information from memory.