Synopsis
Inquire about the buffer data in a file.
Format
long MbufDiskInquire(FileName, ParamToInquire, UserVarPtr)
char *FileName; | File name |
long ParamToInquire; | Type of information about which to inquire |
void *UserVarPtr; | Storage location for inquiry result |
Description
This function inquires about the buffer data in the specified file on disk.
The FileName parameter specifies the file name. Note, an error occurs if the file does not have a known file format or the file format isn’t supported.
The supported file types are “MIL”, “TIFF” and “RAW”. Since a “RAW” data file does not have any information regarding size or type, you can only use this function to determine the file format of this type of file.
The ParamToInquire parameter specifies the parameter about which to inquire. This parameter can be set to one of the following values:
ParamToInquire | Description |
M_SIZE_X | Width of the data in the file. |
M_SIZE_X+M_LUT | Width of the LUT associated with the image in the file. If none, returns the buffer width needed to create a LUT for the image. |
M_SIZE_Y | Height of the data in the file. |
M_SIZE_BAND | Number of color bands in the file. |
M_SIZE_BAND+M_LUT | Number of bands of the LUT associated with the image in the file. If none, returns the number of bands needed to create a LUT for the image. |
M_TYPE | File data type (size in bits + M_SIGNED or M_UNSIGNED). |
M_SIZE_BIT | File data depth in bits. |
M_SIGN | File data range (M_SIGNED or M_UNSIGNED). |
M_ATTRIBUTE | File attribute. |
M_FILE_FORMAT | MIL identifier (MIL_ID) of the file format. |
M_LUT_PRESENT | Presence of LUT data in the file. (M_YES or M_NO) |
M_ASPECT_RATIO | Aspect ratio of the image in the file. (default is 1:1) |
For M_KERNEL and M_STRUCT_ELEMENT data buffers only (see MbufControlNeighborhood for possible values)
M_OVERSCAN | Overscan type. (M_TRANSPARENT, M_REPLACE, M_MIRROR or M_DISABLE) |
M_OVERSCAN_REPLACE_VALUE | Overscan replace value. |
M_OFFSET_CENTER_X | Offset center X coordinate. |
M_OFFSET_CENTER_Y | Offset center Y coordinate. |
For M_KERNEL data buffers only (see MbufControlNeighborhood for possible values)
M_ABSOLUTE_VALUE | Absolute value flag. |
M_SATURATION | Saturation flag. |
M_NORMALIZATION_FACTOR | Normalization factor. |
The UserVarPtr parameter specifies the address of the variable in which the requested information is to be written. When M_FILE_FORMAT is specified, this parameter should be a pointer to a MIL_ID; otherwise, it should be a pointer to a long. Since the MbufDiskInquire function also returns the requested information, you can set this parameter to M_NULL.
Returned value
The returned value is the requested information setting, cast to long. If the requested information is not available, M_INVALID is returned.
See also