| MIL 10 Reference
| Customize Help
| Save Settings

MbufChildColor2d



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Partially supported on:
Partially supported on Matrox GPU processing driver

Fully supported on:
Fully supported on Host system
Fully supported on Matrox CronosPlus
Fully supported on Matrox GigE Vision driver
Fully supported on Matrox IEEE 1394 IIDC driver
Fully supported on Matrox Iris GT
Fully supported on Matrox Morphis
Fully supported on Matrox Morphis QxT
Fully supported on Matrox Orion HD
Fully supported on Matrox Radient eCL
Fully supported on Matrox Radient eV-CXP
Fully supported on Matrox Solios eA/XA
Fully supported on Matrox Solios ecl/xcl/ev-cl
Fully supported on Matrox USB3 Vision driver (requires Update 19)
Fully supported on Matrox Vio

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Available on Non-Matrox computer
Available on Matrox 4Sight-X
Available on Matrox 4Sight GP
Available on Matrox Supersight
function map Function map
Examples
Synopsis
Allocate a child data buffer within a color parent buffer.
Syntax
MIL_ID MbufChildColor2d(
MIL_ID ParentBufId, //in
MIL_INT Band, //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 child data buffer within the specified, previously allocated, color parent data buffer. It selects a two-dimensional region in one or all of the color bands of the parent data buffer and allocates the region as a child of that buffer.

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 color child buffer is considered a data buffer in its own right. It 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, release it, 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.

The parent buffer cannot have an M_COMPRESS attribute unless the Band parameter is set to M_ALL_BANDS.

Band

Specifies the color band of the parent data buffer from which to allocate the child data buffer. The specified color band should be valid in the parent buffer.

The Band parameter can be set to one of the following values:

function map For specifying the color band
CollapseValue Description
Collapse M_ALL_BANDS

Specifies all color bands (for RGB, HSL, and YUV parent buffers). That is, M_ALL_BANDS allocates a child buffer with the same number of bands as the parent buffer.

(summarize)
Collapse M_BLUE

Specifies the blue color band (for RGB parent buffers).

Collapse M_GREEN

Specifies the green color band (for RGB parent buffers).

Collapse M_HUE

Specifies the hue band (for HSL parent buffers).

Collapse M_LUMINANCE

Specifies the luminance band (for HSL parent buffers).

Collapse M_RED

Specifies the red color band (for RGB parent buffers).

Collapse M_SATURATION

Specifies the saturation band (for HSL parent buffers).

Collapse M_U

Specifies the U band (for YUV parent buffers). Note that the dimensions of the child buffer must not exceed the dimensions of the U band of the parent.

(summarize)
Collapse M_V

Specifies the V band (for YUV parent buffers). Note that the dimensions of the child buffer must not exceed the dimensions of the V band of the parent.

(summarize)
Collapse M_Y

Specifies the Y band (for YUV parent buffers).

Collapse 0 <= Value < #bands

Specifies the index of the band to use.

The relationship between index value and band for RGB, HSL, and YUV buffers is the following:

0

Corresponds to the red band (for RGB parent buffers), the hue band (for HSL parent buffers), and the Y band (for YUV parent buffers).

1

Corresponds to the green band (for RGB parent buffers), the saturation band (for HSL parent buffers), and the U band (for YUV parent buffers).

2

Corresponds to the blue band (for RGB parent buffers), the luminance band (for HSL parent buffers), and the V band (for YUV parent buffers).

(summarize)
OffX

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

[Matrox GPU processing driver]

When dealing with monochrome (1-band) buffers, the buffer offset must be a multiple of 4.

OffY

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

SizeX

Specifies the width of the child buffer.

[Matrox GPU processing driver]

When dealing with monochrome (1-band) buffers, the buffer width must be a multiple of 4.

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 MbufChildColor2d() 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 successful. If allocation fails, M_NULL is returned.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
ALL BANDS BLUE GREEN HUE LUMINANCE RED SATURATION U V Y