MIL_CONST_TEXT_PTR FileName, | //in |
MIL_INT64 FileFormat, | //in |
MIL_ID SrcBufId | //in |
This function exports a data buffer to a file, in the specified output file format.
If exporting an image, all the pixel information in the buffer is exported to the file. Additionally, if the image buffer includes any region of interest (ROI) information, set using MbufSetRegion(), the ROI information is also exported to the file when you export the image in M_MIL file format. If you specify a different file format (for example, M_TIFF), the ROI information cannot be exported to the file. To avoid exporting ROI information to the file when exporting the image in M_MIL file format, set FileFormat to M_MIL + M_NO_REGION.
Note that you can also save a buffer in an M_MIL file format, using MbufSave(). The M_MIL file format is TIFF compatible.
To export an image with a LUT (color palette), associate the LUT to the image, using MbufControl(). Upon export, the image is saved with its associated color palette (MIM, TIFF, and BMP file formats).
When exporting uncompressed data to a file in an M_JPEG_... or M_JPEG2000_... file format, this function will automatically compress the data, according to the specified file format. The buffer does not need an M_COMPRESS attribute. If you are exporting compressed data to a file in an uncompressed file format, this function will automatically decompress the data.
To save the calibration information associated with the buffer (if applicable), use M_WITH_CALIBRATION.
Specifies the name and path of the file in which to save the data buffer. It is recommended that you use the MIM file extension for easier use with other Matrox Imaging software products. The function handles (internally) the opening and closing of the file. If the file already exists, it will be overwritten.
This parameter can be set to the following value:
For specifying the file name and
path
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
||||||||||||||||||||||||||||||||||||||
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 file format. This parameter can be set to one of the following values. Note that, except for the M_MIL and M_RAW file formats, the source buffer should have an M_IMAGE attribute; otherwise, the data is saved as if it were image data.
For specifying the file
format
|
|||||||||||||||||||||||||||||||||||||||
Value | Description
|
MIL system-specific tooltip (†) |
|||||||||||||||||||||||||||||||||||||
M_BMP |
Specifies that the buffer is saved in a BMP file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG2000_LOSSLESS |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG2000 lossless file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG2000_LOSSLESS_JP2 |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG2000 lossless file format using the standard JP2 format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG2000_LOSSY |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG2000 lossy file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG2000_LOSSY_JP2 |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JP2000 lossy file format using the standard JP2 file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG_LOSSLESS |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG lossless file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG_LOSSLESS_INTERLACED |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in an interlaced JPEG lossless file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG_LOSSY |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG lossy file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG_LOSSY_INTERLACED |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in an interlaced JPEG lossy file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_JPEG_LOSSY_RGB |
[For
essential MIL-Lite information, see remarks ]
Specifies that the buffer is saved in a JPEG lossy file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_MIL + |
Specifies that the buffer is saved in a MIL file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_PNG |
Specifies that the buffer is saved in a PNG file format. |
† | a | b | c | d | e | g | h | i | j | k | l | m | n | o | p | q | r | s | |||||||||||||||||||
M_RAW |
Specifies that the buffer is saved as raw data. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | ||||||||||||||||||
M_TIFF + |
Specifies that the buffer is saved in a TIFF file format. (more details...) |
† | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s |
You can add one of the following values to the above-mentioned value to set whether to save the calibration information or region of interest data associated with the buffer.
For saving calibration information or ROI
data
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_NO_REGION |
Specifies that any ROI data associated with the buffer is not saved with the buffer contents. |
||||||||||||||||||||||||||||||||||||||
M_WITH_CALIBRATION |
Specifies that any calibration information associated with the buffer is saved. (more details...) |
You can add the following value to the above-mentioned values to set whether to save the color image buffer in a planar format.
For saving a color image in a planar
format
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_PLANAR |
Specifies that the color image buffer is saved in a planar format. |
You can add the following value to the above-mentioned value to set whether to save the image buffer in big endian format.
For saving an image in big endian
format
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_BIG_ENDIAN |
Specifies that the image buffer is saved in big endian format. |
You can add one of the following values to the above-mentioned value to set whether to use compression when saving a TIFF image file.
For compressing a TIFF image
file
|
|||||||||||||||||||||||||||||||||||||||
Combination value | Description
|
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_CCITTFAX3 |
Specifies to use CCITT FAX3 compression. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_CCITTFAX4 |
Specifies to use CCITT FAX4 compression. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_CCITTRLE |
Specifies to use CCITT RLE compression. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_CCITTRLEW |
Specifies to use CCITT RLEW compression. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_LZW |
Specifies to use LZW compression. |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_NONE |
Specifies to use no compression. |
||||||||||||||||||||||||||||||||||||||
M_COMPRESSION_PACKBITS |
Specifies to use PackBits compression. |
Specifies the identifier of the data buffer to save. This image buffer can have an ROI set using MbufSetRegion().
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |