| Customize Help
| Save Settings

MbufChild2d



Function Map
Synopsis
Allocate a child buffer within a specific region of a parent buffer.
Syntax
MIL_ID MbufChild2d(
MIL_ID ParentBufId, //in
MIL_INT OffX, //in
MIL_INT OffY, //in
MIL_INT SizeX, //in
MIL_INT SizeY, //in
MIL_ID *BufIdPtr //out
)
Description

This function allocates a two-dimensional child buffer within a region of the specified, previously allocated data buffer. If the parent buffer is multi-band, this function allocates a multi-band child buffer; the child is allocated within the specified region in each color band. To allocate a child region in one specific band, or specifically in all bands, use MbufChildColor2d() instead of MbufChild2d().

The child buffer is not allocated in its own memory space; it remains part of the parent buffer. Therefore, any modification to the child buffer affects the parent and vice versa. Note, a parent buffer can have several child buffers.

A child buffer is considered a data buffer in its own right, and can be used in the same circumstances as its parent buffer. A child buffer inherits its type and attributes from the parent buffer.

If a child buffer is allocated using a parent buffer with an ROI, set using MbufSetRegion(), the child buffer inherits the parent buffer's ROI. You can also set an ROI in a child buffer directly. Note that the ROI of the child buffer is only accessible using the child buffer's MIL identifier.

When this buffer is no longer required, it can be released, using MbufFree().

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
ParentBufId

Specifies the identifier of the parent buffer.

OffX

Specifies the horizontal pixel offset of the child buffer's top-left pixel, relative to the parent buffer's top-left pixel. The given offset must be within the width of the parent buffer.

OffY

Specifies the vertical pixel offset of the child buffer's top-left pixel, relative to the parent buffer's top-left pixel. The given offset must be within the height of the parent buffer.

SizeX

Specifies the width of the child buffer.

SizeY

Specifies the height of the child buffer.

BufIdPtr

Specifies the address of the variable in which the child buffer identifier is to be written. Since the MbufChild2d() function also returns the child buffer identifier, you can set this parameter to M_NULL.

Return value
The returned value is the child buffer identifier. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.