MIL_CONST_TEXT_PTR FileName, | //in |
MIL_ID SystemId, | //in |
MIL_ID *BufIdPtr | //out |
This function restores the data from the specified file and loads it into an automatically allocated buffer. It tries to detect the file format from the data.
This function will allocate the destination buffer with the same attributes as the original buffer, with the exception of an M_IMAGE buffer.
In the case of an M_IMAGE buffer, the MbufRestore() function tries to allocate the buffer so that it can be used for acquisition (M_GRAB), display (M_DISP), and processing (M_PROC) operations. If there is insufficient appropriate memory to allocate such a buffer, it allocates one that can be used in all of the above operations except for acquisition (M_GRAB). Note that the maximum (total) number of grab (M_GRAB) buffers that can be allocated is restricted by the total amount of MIL non-paged (DMA) memory (specified at installation time or using the MILConfig utility). For systems with on-board processors, the total number of M_GRAB buffers and M_PROC buffers is limited by the amount of on-board memory.
If restoring an image, all the pixel information in the file is restored and loaded into the buffer. Additionally, if the file was saved in M_MIL file format and includes any region of interest (ROI) information, the ROI information is also restored and loaded into the buffer.
If the vectorial information of an M_VECTOR_AND_RASTER ROI was input in M_WORLD units, the ROI will be restored as an M_VECTOR ROI.
When restoring compressed data, the buffer will have an M_COMPRESS attribute.
When restoring an image file that was saved with an associated LUT (color palette), the LUT is also restored and associated with the restored image buffer. You can obtain the identifier of the associated LUT, using MbufInquire().
After restoring a buffer, we recommend that you check that the operation was successful using MappGetError() or by checking that the buffer identifier returned is not M_NULL.
Note, you can perform the same operation as MbufRestore() using MbufImport(), which uses the specified file format to restore the data instead of trying to determine the format from the data.
Specifies the name and path of the file from which to restore the data buffer. The function handles (internally) the opening and closing of the file.
This parameter can be set to one of the following:
For specifying the file name and
path
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_INTERACTIVE |
Opens the File Open dialog box from which you can interactively specify the drive, directory, and name of the file. |
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("FileName") 1 |
Specifies the drive, directory, and name of the file (for example "C:\mydirectory\myfile"). (more details...) |
1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().
Specifies the system on which to allocate the buffer.
This parameter should be set to one of the following values:
For specifying the system
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
M_DEFAULT_HOST |
Specifies the default Host system of the current MIL application. |
||||||||||||||||||||||||||||||||||||||
MIL system identifier |
Specifies a valid system identifier, previously allocated using MsysAlloc(). |
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |