
Abridged list of PIP commands used in various programs enclosed in the CD

Courtesy: This file is included with permission from Matrox Electronics
          Systems, Canada

1   fg_autoset()
    - sets gain and offset.
    - warning : this command destroys the current contents of the frame 
      buffer.

2   fg_cgrab(state)
    - continuous frame grab
      state : specifies the frame grabbing mode.
          0 : disable continuous frame grabbing
          1 : enable continuous frame grabbing

3.  fg_chan(int channel)
    - selects the active video input port.
    - channel = 0 : top camera input on back of card.
        
4.  fg_clear(int smap, int umap)
    - clears the screen by setting one of the unused maps of the input LUT 
      to the current draw index.
    - smap : selects one of the 8 input LUT maps to be the active map 
             following the clear operation. Decimal values from 0 to 7 
             are expected.
    - umap : selects one of the 8 input LUT maps to be set to the current  
             draw index. Decimal values from 0 to 7 are expected.
         
5.  fg_cpws(int source, int dest)
    - This command copies the contents of the window in the source workspace 
      to an identical window in another workspace. source or destination
      should lie between 0 to 3.

6.  fg_dquad(int quad)
    - Selects the quadrant to be displayed. 
    - quad : when using the PIP-1024 in the 512*512 mode. A decimal value  
             from 0 to 3 is required.

7.  fg_elips(int xradius, int yradius)
    - Draws an ellipse centered at the current pen position, in the current 
      draw index.
    
8.   fg_exit()
    - terminate digitizer operations.

9.  fg_frdisk(int bsize, int quad, char *fname,char workbuffer[bsize],int seg)
    - This command is used to copy the image stored in a file to the specifed 
      quadrant.

    
10. fg_inifmt(int baseaddr,int mode,int speed,int class,int vid_type,int zoom)
    - Initializes the PIP board in the system unit to a known state.
    - baseaddr : specifies the offset of the I/O address used. Its int value 
                 is 620 if the board has an offset of zero at any of the 
                 base addresses.
    - mode : non-zero = zoom resolution allowed.
    - speed : zero = PIP-5122 or PIP-1024 installed.
    - class : 0-6, the video format to use.
    - vid_type : zero = American standred video.
                 non-zero = European.
    - zoom : zero = full resolution 
             non-zero = zoom resolution.

11.  fg_iniluts()
    - loads all the lookup tables with grayscale maps.

12.  fg_lutd(map,color,start,length,buffer)
    - Initialize LUT.
    - map : This parameter specifies which of the 8 maps of any particular 
            LUT is to be loaded with data. Recall that each LUT is subdivided
            into 8 individual 256 byte maps. The parameter map is given value
            in decimal form 0 to 7. Note that upon initialization, the system 
            the default map is set to 0.
    - color : This parameter specifies the lookup table which will be affected
              by the change of data. The 5 possible values have the following
              correlation:
              0 : Input lookup table
              1 : Blue lookup table
              2 : Green lookup table
              3 : Red lookup table
              4 : All output lookup tables
    - start : This parameter indicates which of the 256 bytes of the selected
              map will serve as the starting point of our initialization.
              This value is given in decimal and must be between 0 and 255
              inclusive.
    - length : This parameter indicates how many bytes starting at point
               start within the map will rewritten using the scaling function
               This value is given in decimal and must be betwwen 1 and 256 
               inclusive.
    - buffer : In order to transfer data to a particular map within a LUT,
               lutd must know the location of the buffer containing the 
               values of the initialization. This parameter contains the 
               location of this buffer.

13.  fg_lutm(map)
    - map : This parameter specifies which of the 8 maps of any particular 
            LUT is to be loaded with data. Recall that each LUT is subdivided
            into 8 individual 256 byte maps. The parameter map is given value
            in decimal form 0 to 7. Note that upon initialization, the system 
            the default map is set to 0.


14. fg_linerel(int x, int y)
    - used to draw a line from the current pen location to the current pen 
      location + (x, y) in the current index.

15. fg_lineto(int x, int y)
    - used to draws a line from current pen location to the point of
      coordinate (x,y). 

16. fg_moverel(int x, int y)
    - used to move current pen position from the present location to the 
      current pen position + (x, y).

17. fg_moveto(int x, int y)
    - used to move the current pen position to a specied (x, y) position. 
        
18. fg_pan(int origin)
    - used to set the absolute pan position (panning shifts images with 
      respect to the x axix).
    - origin : specifies the position in the frame buffer to which the screen 
               will move.

19. fg_pixr(int x, int y)
    - used to read the value of a pixel in the frame buffer.

20. fg_pixw(int x, int y, int value)
    - used to write a pixel to the frame buffer 
    - value : specifes the intensity of the pixel.
    
21. fg_quadm(int mode)
    - used to set display mode on a PIP-1024.
    - mode 0: selects the 1024*1024 mode
           1: selects the 512*512 mode
    - from quadrant mode ref. chap 3
    
22. fg_rect(int x1, int y1, int x2, int y2)
    - used to draw a rectangle having (x1,y1) and (x2,y2) as opposite corners.

23. fg_rectf(int x1, int y1, int x2, int y2)
    - used to draw a filled rectangle having (x1,y1) and (x2,y2) as opposite 
      corners.

24. fg_rowr(int ycoord, int quad, char workbuffer[512])
    - used to read a row from the frame buffer and write it into the system 
      unit's memory.

25. fg_roww(int ycoord, int quad, char buffer[512])
    - used to write a row from the system's memory to the frame buffer.
    
26. fg_scroll(int origin)
    - used to set the absolute scroll position (scrolling shifts images along 
      the y axis) 
    - origin : specifies the y coordinate of the upper left corner of the 
               window with respect to the frame buffer coordinate system. 
    
27. fg_sync(mode)
    - sync sourse
    mode : this parameter selects the source
    0 : the internal sync is selected.
    1 : the external sync is selected.

28. fg_snap(wait)
    - wait : the value of this parameter determines whether or not the 
             routine will return immidiately to the program.
         0 : return immidiately
         1 : wait until the frame grab is complete.

29. fg_sbuf(mode)
    - mode : this parameter selects the output video source.
         0 : the output of the input lut is displayed, keying is disabled.
         1 : the output of the frame buffer is displayed, keying is allowed.
       
30. fg_scaling(x1,y1,x2,y2,buffer)
     x1 : this parameter indicates the first address in buf to be scaled.
     x2 : this parameter indicates the last address in buf to be scaled.
     y1 : this parameter specifies the first value (the low end of the scale) 
          to be stored at buf[x1].
     y2 : this parameter specifies the last value (the upper end of the scale)
          to be stored at buf x[2].
     buffer : this parameter is the address of the buffer where the result of 
              the scaling function to be stored.

31. fg_setind(int index)
    - sets the current draw index.
    
32. fg_setwin(int x1, int y1, int x2, int y2) 
    - specifies the lower left and upper right corners of the window.

33. fg_tchar(ch, size)
    - writes a character
    ch : This parameter contains the character to be written at the current
         pen location. The lower left hand corner of the character  will be
         located at the current pen position.
    size : This parameter sets the multiplication factor to be used when 
           drawing characters. The basic character is drawn in an 8 x 8 cell
           a size of 2 will draw the character in an 16 x 16 cell etc.
           size from 1 to 3 are typical. the character is an ordinary ASCII
           character.
34.  fg_todisk(int bsize,int quad,cahr *fname,char workbuffer[bsize], int seg)
    - This command is used to copy the image fram a selected display quadrant 
      to a disk file. 
    - bsize : defines the size of the intermediate buffer. We use 4096 bytes 
              size buffer.
    - quad : selects the display quadrant in which the transfered image will 
             be displayed.
    - fname : disk file name to/from which the dta transfer is to occur.
    - workbuffer : specifies the offset portion of the memory address. 
    - seg : specifies the segment portion of the memory buffer address, the 
            value -1 refers to the current data segment.

35. fg_tomem(x,y,cnt,workbuffer,segment)
    x and y : These parameters specify the xy coordinates of the transfer
              starting point in the frame buffer. The origin of the coordinate 
              space is the upper left corner of the frame buffer. The write is 
              scan in the frame buffer is limited by the boundaries of the quadrant
              containing the x,y coordinates. The scan in positive x direction
              with each succeding scan line below the preceding scan line.
    cnt     : this parameter specify the number of byte to be transfered.
    workbuffer : This parameter along with segment specifies the starting
                 address in system memory for the transfer. The first byte
                 in the transfer is written to this address and subsequent 
                 byte are written to contiguous higher locations.
    segment : This parameter along with workbuffer specifies the starting 
              address, in system memory, of the transfer.
36. fg_text(char *string, int size)
    - used to write a string of characters using the current drawing index.

37. fg_winfrdisk(int bsize, char *fname, char workbuffer[bsize], int seg)
    - This command is used to copy a disk file to the current display window.
    - ref fg_frdisk

38. fg_wintodisk(int bsize, char *fname, char workbuffer[bsize], int seg)
    - This command is used to copy the contents of the current display to a 
      disk file. 
    - ref fg_frdisk

39. fg_winr(char workbuffer[bsize])
    - This command is used to copy the contents of the current display window 
      to a buffer.

40. fg_winw(char workbuffer[bsize])
    - This command is used to copy the contents of a buffer to the current 
      display window. 
 
41. fg_zoom(int mode)
    - This command selects either full resolution or zoom resolution.
    - zero = standard video.
      non-zero = zoomed video.

        
