-------------------------------------------------------------------------------
       Matrox Imaging Library (6.1) MIL_Lite_LastMinute.txt Readme File
                                April 27, 2000
    Copyright 2000 by Matrox Electronic Systems Ltd. All rights reserved.
-------------------------------------------------------------------------------

This file presents last minute information that did not make it into the manual
or on-line help. Note that this text file serves to complement your manual. The 
information found in this file overrides your formally documented material.

Contents

 1. Hooking functions, in general.
 2. Mbuf...() additions.
 3. Mdig...() additions/modifications.
 4. Mdisp...() additions/modifications.
 5. Mfunc...() additions/modifications.
 6. Mgra...() additions/modifications.
 7. Msys...() additions/modifications.
 8. Matrox Corona MIL Board-Specific modifications
 9. Matrox Meteor-II MIL Board-Specific additions/modifications.
10. Matrox Corona Installation notice.
11. User Guide notice

1. Hooking functions, in general.

   - The functions hooked to an event execute on a distinct thread. This
     permits the functions to run asynchronously from the operation that 
     fired the event and from functions hooked to other events. Although 
     there is a small queue to permit a certain amount of overlap, hooked 
     functions should not take longer to execute than the period in which 
     two of their associated events can occur. You cannot determine the
     instance of the event that fired the function, and even if this were
     possible, this information would generally not be very useful because, 
     for example, you could miss a grab. Typically, a hooked function 
     performs the minimum number of operations required and, 
     if necessary, performs longer processes by launching other threads. 

2. Mbuf...() additions
   
   - MbufCopy():
       - If the source image is a 3-band YUV image and the destination is a 
	 1-band image, only the Y band (luminance) is copied. If the 
	 source image is a 3-band RGB image and the destination is a 1-band
	 image, only the red band is copied. 

3. Mdig...() additions/modifications.

   - MdigHookFunction():
       - M_GRAB_FIELD_START is also available, depending on the board.
       - M_GRAB_START: When grabbing continuously, the event is fired only when 
         the first frame is grabbed. To be notified at the start of each frame, 
         use the M_GRAB_FRAME_START event.
       - M_GRAB_END: Occurs at the end of the grab. When grabbing continuously, 
         the event is fired only after the last frame is grabbed. To be
         notified at the end of each frame, use the M_GRAB_FRAME_END event.
       - M_FRAME_START, M_FIELD_START, M_FIELD_START_ODD, M_FIELD_START_EVEN: 
         Starting or stopping the grab does not affect these events.

4. Mdisp...() additions/modifications.

   - MdispHookFunction(): 
      - The function's prototype is correct. It is still the same as it was 
        in MIL 6.0. That is:
        MDISPHOOKFCTPTR MdispHookFunction(DisplayId, HookType, HookHandlerPtr, 
                                          UserDataPtr)
 
        You are still responsible for tracking the address of the hooked 
        function and chaining it if required. 
         
      - You can only hook a function to the M_FRAME_START event in single
        screen mode and only if DirectDraw is enabled (default). 

   - MdispInquire(): 
      - The M_WINDOW_BUF_ID inquire type returns "0" when called on a VGA 
        system. The M_WINDOW_OVR_BUF_ID should be used instead.
      
   - MdispOverlayKey():
      - The KeyMask parameter specifies the mask to apply to the overlay 
        pixels, before performing the comparison and when keying is enabled 
        (M_KEY_ON_COLOR). Only overlay pixel bits corresponding to enabled 
        mask bits are compared with those of the keying color during the 
        keying operation. 

        To compare overlay pixels to the specified KeyColor value, enable all 
        bits in the mask (that is, set KeyMask to 0xffff). 

        To compare overlay pixels to a range of keying colors, enable the mask 
        bits in the required range and specify an appropriate KeyColor value. 
        When in an 8-bit display mode, pass an 8-bit value as the mask. When 
        in any other display mode, pass an RGB24 packed value (that is, the 
        least-significant byte corresponding to the red component, the next 
        significant byte corresponding to the green component, and the 
        most-significant byte corresponding to the blue component).

        When keying is not enabled (M_KEY_OFF), set KeyMask to M_NULL.

5. Mfunc...() additions/modifications.

   - MfuncErrorReport(): The FunctionId parameter can be set to M_NULL.
       - If FunctionId is not set to M_NULL, any error will be logged as 
         a user error, it will pop-up immediately, and it won't be possible 
         to reset the error with MfuncErrorReport().
       - If FunctionId is set to M_NULL, any error will be logged as an 
         internal error and it will be possible to reset the error with 
         MfuncErrorReport(0,0,0,0) until MfuncFreeAndEnd() is called. If the
         error is not reset, the error message will pop-up only when
         MfuncFreeAndEnd() is called.

6. Mgra...() additions/modifications.

   - MgraFill(): If the source buffer is a multi-band buffer, MgraFill() 
     will process each band separately. This means that each band of the
     adjacent pixels will be compared with the corresponding band of the 
     seed pixel. This can produce strange results if, for example, you try 
     to fill the inside of a red circle with blue. The blue will spread to 
     the whole image since the red circle does not exist in the blue band.

7. Msys...() additions/modifications.

   - If a Matrox Genesis D.A.C. module is present, 
     MsysInquire(...,M_BOARD_TYPE,..) now returns M_GENESIS_WITH_DAC_MODULE 
     or M_GENESIS_LC_WITH_DAC_MODULE.

    - On a Matrox Meteor-II, the MsysControl() M_PCI_LATENCY control type should 
      should be from 0-255 with a granularity of 8 (for example, 0,8,16, 24...)

8. Matrox Corona MIL Board-Specific modifications

   - MdispInquire():	
       - In the second table describing the "InquireType" parameter, for
	 M_ENCODER_MODE, the function returns only 2 values: M_YC and M_RGB.
   - MdispControl():
       - In the first table describing the "ControlType" parameter, read
	 "M_ENCODER_SYNC" instead of "M_ENCODER_SYNC_SOURCE".
       - In the chapter entitled "MIL and the Matrox Meteor-II platform", 
	 section "Using the encoder", the function calls
	 "MdispControl(MilDisplay, M_ENCODER_MODE, M_ENABLE, M_COMPOSITE);"
	 should read "MdispControl(MilDisplay, M_ENCODER_MODE, M_COMPOSITE);".
       - The "M_LOW_PASS_TYPE_A" control type should actually be "M_FILTER_LOW_PASS_TYPE_A".

9. Matrox Meteor-II MIL Board-Specific additions/modifications

   - MdigAlloc():
       - On the Matrox Meteor-II /1394 board, the accepted format strings
	 are camera-specific and can be inquired (with MdigInquire())
	 using the three following defines:

	 M_FORMAT_SUPPORTED_NUM, which will return the number of supported strings

   	 M_FORMAT_SUPPORTED_LENGTH, which will return the maximum length of
	 these strings (in char)
	
	 M_FORMAT_SUPPORTED, which will fill a user-allocated array with
	 the supported strings.
 
	 Here is an example of how to inquire and print all the supported
	 strings:
 
	 #include "mil.h"
 	 #include "stdio.h"
	 #include "string.h"
 

	 void main(void)
	 {
	    MIL_ID MilApplication,  /* Application identifier.  */
           	MilSystem,       /* System identifier.       */
            	MilDigitizer;    /* Digitizer identifier.    */
 
  	    /* Allocate defaults. */
	    MappAlloc(M_DEFAULT, &MilApplication);
	    MsysAlloc(M_SYSTEM_METEOR_II_1394, M_DEFAULT, M_SETUP, &MilSystem);
	    MdigAlloc(MilSystem, M_DEFAULT, "M_DEFAULT", M_DEFAULT, &MilDigitizer);
 
   	    // Inquire number of strings and length
	    long NbFormats = MdigInquire(MilDigitizer, M_FORMAT_SUPPORTED_NUM,
									 M_NULL);
	    long MaxLength = MdigInquire(MilDigitizer, M_FORMAT_SUPPORTED_LENGTH,
									 M_NULL);
 
 	    // Allocate a buffer to receive the strings
	    char * Strings = new char[NbFormats*MaxLength];
	    memset(Strings, 0, NbFormats*MaxLength*sizeof(char));
 
 	    // Inquire the strings
	    MdigInquire(MilDigitizer, M_FORMAT_SUPPORTED, Strings);
 
 	    long Offset = 0;
 	    for(long t = 0; t < NbFormats; t++)
	      {
      		// Print each string
      		printf("%s\n", &Strings[Offset]);
     		Offset += MaxLength;
      	      }
            delete [] Strings;
   
   
   	    printf("Press <Enter> to end.\n");
	    getchar();
 
 	    // Free MIL objects
	    MdigFree(MilDigitizer);
	    MsysFree(MilSystem);
	    MappFree(MilApplication);
 	 }

   - MdigChannel():
       - The maximum number of channels for the Matrox Meteor-II /Multi-Channel 
	 PC/104-Plus board is 6 and not 12.
       - In the table of Composite/Monochrome cameras, the channels M_CH7 to 
	 M_CH11 are supported on the Matrox Meteor-II /Standard board and not
	 on the Matrox Meteor-II /Multi-Channel board.

   - MdigControl():
       - M_GRAB_TRIGGER_SOURCE with M_HSYNC or M_VSYNC is not supported on
	 the Matrox Meteor-II /Multi-Channel board.

10. Matrox Corona Installation notice

   - Please note in the Matrox Corona Installation and Hardware Reference 
     Manual dated August 13, 1998 (manual number 10572-MN-0150):
      - On page 78, the location of pin 70 is incorrect. The pin labeled 70 
        is actually pin 2. All the odd numbered pins are on one side of the 
        connector [2 ... 70], while all the even numbered pins are on the 
        other [1 ... 69]. 

      - On page 75, in the VGA output connector description, pin 13 is shown 
        as being the VSYNC signal (but is described as being the TTL 
        horizontal sync output signal) and pin 14 is shown as the HSYNC 
        signal (but is described as being the TTL vertical sync 
        output signal). Pin 13 is actually the HSYNC signal, while pin 14 
        is the VSYNC signal.

11. User Guide notice

   - In the chapter entitled "Specifying and managing your data buffers",
     in the section called "Manipulating and controlling certain data
     buffer areas", the last sentence of the second to last paragraph should
     read as follows: "If the source is signed and the destination depth is
     greater than the source, the source data is sign-extended when it is
     copied into the destination.".

   - In the chapter entitled "Lookup tables", in the section called "LUT's
     and data buffers", the last sentence of the fifth paragraph should read
     as follows: "The LUT index, starting at a specified value, is used as
     the 'x' value in the equation.".
