Synopsis
Inquire about a data buffer.
Format
long MbufInquire(BufId, ParamToInquire, UserVarPtr)
MIL_ID BufId; | Source buffer identifier |
long InquireType; | Type of information about which to inquire |
void *UserVarPtr; | Storage location for requested information |
Description
This function inquires about a specified MIL buffer parameter setting. This function is useful, for example, to check the size of a buffer restored from disk.
The BufId parameter specifies the identifier of the source buffer.
The InquireType parameter specifies the buffer parameter about which to inquire. This parameter can be set to one of the following values:
InquireType | Description |
M_SIZE_X | Width of the buffer. |
M_SIZE_Y | Height of the buffer. |
M_SIZE_BAND | Number of buffer color bands. |
M_SIZE_BIT | Buffer depth in bits. |
M_TYPE | Buffer data type (size in bits + M_SIGNED, M_UNSIGNED, or M_FLOAT). |
M_SIGN | Buffer range (M_SIGNED or M_UNSIGNED). |
M_ATTRIBUTE | Buffer attribute. |
M_OWNER_SYSTEM | Identifier of the system on which the buffer has been allocated |
M_PITCH | The number of memory (not data) pixels in each line of the buffer. |
M_PITCH_BYTE | The number of memory (not data) bytes in each line of the buffer. |
M_HOST_ADDRESS | Host pointer to the buffer or M_NULL. If available, this pointer can be used to directly access the data of a MIL buffer with the Host CPU.. |
M_PHYSICAL_ADDRESS | Physical address of the Host buffer or M_NULL. Available only for a non-paged buffer mapped on the Host. This type of buffer is used only for access by bus masters other than the Host CPU. |
M_PARENT_ID | Identifier of parent buffer. (returns same as BufId if no parent buffer) |
M_PARENT_OFFSET_X | X offset in relation to the parent buffer. |
M_PARENT_OFFSET_Y | Y offset in relation to the parent buffer. |
M_PARENT_OFFSET_BAND | Band offset in relation to the parent buffer. |
M_ANCESTOR_ID | MIL Identifier of the ancestor buffer. (returns same as BufId if no ancestor buffer) |
M_ANCESTOR_OFFSET_X | X offset in relation to the ancestor buffer. |
M_ANCESTOR_OFFSET_Y | Y offset in relation to the ancestor buffer. |
M_ANCESTOR_OFFSET_BAND | Band offset in relation to the ancestor buffer. |
(An ancestor buffer is a buffer from which other buffers originated. It must have been allocated with MbufAlloc1d, MbufAlloc2d, or MbufAllocColor and does not have a parent buffer.)
M_MODIFICATION_COUNT | Count of the modifications made to the buffer since its allocation. |
(The modification counter is initialized randomly. Call MbufInquire immediately after buffer allocation to determine the starting number.)
M_ASSOCIATED_LUT | Identifier of the LUT buffer associated with the image buffer. (returns M_DEFAULT if no LUT) |
M_NATIVE_ID | The native identifier (handle) of the buffer. This identifier can be used when operating in the system native library. |
M_WINDOW_DDRAW_SURFACE | Pointer (LPDDRAWSURFACE) to the DirectDraw surface associated with the MIL buffer (if any) or M_NULL. |
M_WINDOW_DIB_HEADER | Pointer (LPBITMAPINFO) to the header of the DIB associated with the MIL buffer (if any) or M_NULL. |
M_WINDOW_DC | Windows display context handle (HDC) (MbufControl) or M_NULL. |
M_FORMAT can access a variety of buffer format information, as follows:
– One of the following is returned by M_FORMAT:
M_MONO1 | 1 bit per pixel in monochrome format. |
M_MONO8 | 8 bit per pixel in monochrome format. |
M_MONO16 | 16 bit per pixel in monochrome format. |
M_MONO32 | 32 bit per pixel in monochrome format. |
M_RGB15 | 16 bits per pixel in XRGB 1555 format. |
M_RGB16 | 16 bits per pixel in RGB 565 format. |
M_RGB24 | 24 bits per pixel in RGB 888 format. |
M_RGB32 | 32 bits per pixel in XRGB 8888 format. |
M_YUV9 | YUV9 format. |
M_YUV12 | YUV12 format. |
M_YUV16 | YUV16 format. |
– Any number of the following might be returned by M_FORMAT:
M_DRAW | The buffer is a DDraw surface. |
M_DIB | The buffer is a DIB buffer. |
M_FLIP | The buffer is top-down (DIB). |
M_ON_BOARD | Memory is allocated on-board. |
M_OFF_BOARD | Memory is allocated in Host system memory. |
M_PACKED | The buffer bands are packed. |
M_PLANAR | The buffer bands are planar. |
M_UNSIGNED | The buffer is unsigned. |
M_SIGNED | The buffer is signed. |
M_FLOAT | The buffer is floating point. |
For M_KERNEL and M_STRUCT_ELEMENT data buffers only (see MbufControlNeighborhood for possible values):
M_OVERSCAN | Overscan type. |
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. The variable must be of type long except for M_PARENT_ID, M_OWNER_SYSTEM, and M_ANCESTOR_ID, which require a pointer to a MIL_ID. Since the MbufInquire function also returns the requested information, you can set this parameter to M_NULL.
Returned value
The returned value is the requested MIL buffer parameter setting, cast as long.
《MbufInquire()函数》上有7条评论
评论已关闭。