| MIL 10 Reference
| Customize Help
| Save Settings

MbufImportSequence



See also
Availability
Available in MIL-Lite with restrictions (see remarks)
Available in MIL

Available on Windows
Available on Linux

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Import a sequence of images from an AVI file into separate image buffers.
Syntax
void MbufImportSequence(
MIL_CONST_TEXT_PTR FileName, //in
MIL_INT64 FileFormat, //in
MIL_INT64 Operation, //in
MIL_ID SystemId, //in
MIL_ID *BufArrayPtr, //in-out
MIL_INT StartImage, //in
MIL_INT NumberOfImages, //in
MIL_INT64 ControlFlag //in
)
Description

This function imports a sequence of images from an AVI file into separate image buffers. MbufImportSequence() can automatically allocate the necessary buffers or you can use previously allocated buffers. In the latter case, the BufArrayPtr parameter should point to an array containing the buffer identifiers. In the former case, MbufImportSequence() will write the identifiers of the new buffers into the array pointed to by BufArrayPtr.

Rather than importing all the required images at once, you can also use this function to only open the AVI file for reading. Then, call this function as many times as required to import different sets of images from the file. Once you have finished importing images from the file, you must call this function again to close the file.

Region of interests (ROI) are not supported by this function. Using an image buffer with an ROI will cause an error.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
FileName

Specifies the name and path of the AVI file. This function handles the opening and/or closing of the file depending on the ControlFlag parameter setting.

This parameter can be set to the following value:

function map For specifying the name and path of the AVI file
CollapseValue Description
Collapse MIL_TEXT("FileName") 1

Specifies the drive, directory, and name of the file (for example, "C:\mydirectory\myfile").

To specify a file on a remote computer (under Distributed MIL), prefix the specified file name string with "remote:///" (for example, "remote:///C:\mydirectory\myfile").

(summarize)

1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().

FileFormat

Specifies the format of the file. This parameter can be set to one of the values listed below.

function map For specifying the file format
CollapseValue Description
Collapse M_DEFAULT

Specifies that MIL automatically determines the file format.

Collapse M_AVI_DIB

Specifies an AVI format containing non-compressed images.

Collapse M_AVI_MIL

Specifies an AVI format containing images in their MIL format.

Collapse M_AVI_MJPG
[For essential MIL-Lite information, see remarks ]

Specifies an AVI format containing compressed images.

Operation

Specifies whether to import the specified sequence of images into automatically allocated buffers or previously allocated buffers. If not importing images, this parameter should be set to M_NULL.

When importing images, this parameter can be set to one of the following:

function map For importing images
CollapseValue Description
Collapse M_LOAD

Imports the sequence into previously allocated buffers.

Collapse M_RESTORE

Imports the sequence into automatically allocated buffers.

SystemId

Specifies the system on which to allocate the buffers for an M_RESTORE operation. In other cases, this parameter should be set to M_NULL.

For an M_RESTORE operation, this parameter should be set to one of the following values:

function map For specifying the system
CollapseValue Description
Collapse M_DEFAULT_HOST

Specifies the default Host system of the current MIL application.

Collapse MIL system identifier

Specifies a valid system identifier, previously allocated using MsysAlloc().

BufArrayPtr

Specifies the address of the array containing the buffer identifiers for an M_LOAD operation, or the address of the array in which to store the new buffer identifiers for an M_RESTORE operation. If not importing images, this parameter should be set to M_NULL.

For an M_LOAD operation, the destination buffers should be large enough to hold the imported images.

For an M_RESTORE operation, the destination buffers will be allocated with an appropriate size and type to hold the images. If an M_RESTORE operation fails, zero will be written for the buffer identifiers.

[MIL-Lite with restriction]

When importing compressed images with the M_LOAD operation, if the destination buffers have only an M_IMAGE attribute, the images will automatically be decompressed. When importing uncompressed images with the M_LOAD operation, if the destination buffers have an M_IMAGE + M_COMPRESS attribute, the images will automatically be compressed.

When importing compressed images with the M_RESTORE operation, the M_COMPRESS attribute will automatically be added to the destination buffer (M_IMAGE + M_COMPRESS) and the images will remain compressed in the destination buffer.

StartImage

Specifies the frame number of the image from which to begin importing. If not importing images, this parameter should be set to M_NULL.

If importing images, this parameter can be set to one of the following values:

function map For specifying the frame number of the image from which to begin importing
CollapseValue Description
Collapse M_DEFAULT

Specifies to import the image at the current read position.

Collapse Value >= 0

Specifies the frame number of the image from which to begin importing. Note that the frame number of the first image in the sequence is zero.

(summarize)
NumberOfImages

Specifies the number of images, starting at StartImage, to import. If not importing images, this parameter should be set to M_NULL.

When importing images, this number cannot be larger than the size of the array pointed to by BufArrayPtr. Note that you can inquire about the number of frames (images) in the AVI file using MbufDiskInquire().

ControlFlag

Specifies the function's control flag. This parameter can be set to one of the following:

function map For specifying the function's control flag
CollapseValue Description
Collapse M_DEFAULT

Opens the AVI file, imports the specified images, and then closes the file.

Collapse M_CLOSE

Closes the AVI file, and (re)sets the pointer position to the first image. No images are imported.

(summarize)
Collapse M_OPEN

Opens the AVI file for reading, and sets the pointer to the first image. No images are imported.

(summarize)
Collapse M_READ

Imports the specified images from the AVI file, starting at the specified StartImage position. After the importing the images, the file pointer is left at the position of the next image, ready for the next M_READ operation.

(summarize)
Remarks
  • [MIL-Lite]
    Note that during development and at runtime, compression support, particularly for M_AVI_MJPG format and M_IMAGE + M_COMPRESS buffer type, requires the presence of a MIL license that grants access to the compression/decompression package. This access is only granted by default with the development license dongle for the full version of MIL. In other cases, you must purchase access to this package separately.
  • When a "remote" path is specified (the FileName parameter begins with "remote:///"), the SystemId parameter must point to the remote system when the AVI file is being opened or closed (M_OPEN or M_CLOSE). The buffers that are receiving the images are allocated on this same remote system.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
DEFAULT AVI DIB AVI MIL AVI MJPG LOAD RESTORE DEFAULT HOST DEFAULT DEFAULT CLOSE OPEN READ