MmeasAllocContext()函数

Synopsis

Allocate a measurement context.

Format

MIL_ID MmeasAllocContext(SystemId, ControlFlag, ContextIdPtr)

MIL_ID SystemId; System identifier
long ControlFlag; Allocation control flag
MIL_ID *ContextIdPtr; Storage location for measurement context identifier

Description

This function allocates a measurement context on the specified system. Measurement context parameters are used to control the behavior of measurement operations (MmeasFindMarker and MmeasCalculate). When the measurement context is no longer required, you should release its memory, using MmeasFree.

The SystemId parameter specifies the system on which the measurement context will be allocated. This parameter must be set to a valid system identifier, M_DEFAULT_HOST, or M_DEFAULT. Specify M_DEFAULT_HOST to allocate on the default Host system of the current MIL application. Specify M_DEFAULT to have MIL select the most appropriate system on which to allocate the graphics context (it can be the default Host system or any already allocated system).

The ControlFlag parameter specifies the allocation control flag and must be set to M_DEFAULT.

The ContextIdPtr parameter specifies the address of the variable in which the measurement context identifier is to be written. If allocation fails, M_NULL is written as the identifier. Since the MmeasAllocContext function also returns the buffer identifier, you can set this parameter to M_NULL.

Note, upon allocation of an application, a default measurement context is automatically allocated. Its parameters are set to the default values described in the next paragraph. Rather than using MmeasAllocContext to allocate a measurement context, you can use this default measurement context, by specifying M_DEFAULT wherever a measurement context identifier is required.

Measurement context parameters are set to the following default values upon allocation and can be changed at any time, using MmeasControl:

Parameter description Default value
Pixel aspect ratio (pixel width/pixel height) 1.0
X and Y coordinates of a pixel center relative to the top-left corner of the pixel 0.5, 0.5
Pixel-aspect-ratio input interpretation M_CORRECTED
Pixel-aspect-ratio output interpretation M_CORRECTED

Returned value

The returned value is the measurement context identifier. If allocation fails, M_NULL is returned.

See also

MmeasFree, MmeasControl, MmeasFindMarker, MmeasCalculate

《MmeasAllocContext()函数》上有2条评论

评论已关闭。