In order to access the MIL buffer directly, the buffer’s address and pitch must be known. Once you know this, you will be able to access them directly for optimum performance.
The address of a parent or child buffer can be returned using MbufInquire(). Selecting M_HOST_ADDRESS will return a logical address, while M_PHYSICAL_ADDRESS will return a physical address. In either case, the first address of the buffer you are specifying will be the top left-most pixel in the image. Knowing the pitch and the depth of the buffer will tell you the address of the following row.
The pitch of a buffer is the number of units between the beginnings of any two adjacent lines of the buffer’s data and can be measured in pixels or bytes. Note that in some instances, the pitch in bytes will be more accurate than in pixels. If the last pixel falls outside of a 32-bit boundary (required by Windows), the start of the next row will be located at the beginning of the next 32-bit boundary; this process is called internal padding. When measuring the pitch in pixels, the padding can be counted as “extra” pixels, depending on the depth of the pixels. This will result in an inaccurate pitch.