Table: | For specifying the color band |
Table: | For retrieving clipping results |
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_INT *StatusPtr, | //out |
MIL_ID *BufIdPtr | //out |
This function allocates a child data buffer within the specified, previously allocated, color parent data buffer. It selects a rectangular area in one or all of the color bands of the parent data buffer and allocates this area as a child of that buffer. If necessary, the specified rectangular area will be adjusted (clipped) to ensure it fits within the limits of the parent buffer. If the specified rectangular area is completely outside the limits of the parent buffer, the allocation fails and an error is reported.
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 the child buffer is larger or positioned outside the parent buffer, the child buffer is clipped and the clipping status is returned using the StatusPtr parameter. In the following example, both the X-offset and the X/Y-size are clipped, so M_CLIPPED_OFFSET_X + M_CLIPPED_SIZE_X + M_CLIPPED_SIZE_Y is returned as the clipping status. If no clipping was necessary, M_NULL is returned as the clipping status.
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().
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.
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:
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies all color bands (for RGB, HSL, HSV, and YUV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the blue color band (for RGB buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the green color band (for RGB buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the hue band (for HSL and HSV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the luminance band (for HSL buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the red color band (for RGB buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the saturation band (for HSL and HSV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the U band (for YUV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the V band (for YUV and HSV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the Y band (for YUV buffers). |
||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Specifies the index of the band to copy. The relationship between index value and band for RGB, HSL, HSV, and YUV buffers is the following:
Specifies the index of the band to copy. (more details...) |
Specifies the horizontal offset of the child buffer, relative to the parent buffer's top-left pixel. If necessary, the given offset will be adjusted (clipped) to make sure that the top-left pixel of the child buffer is within the limits of the parent buffer.
Specifies the vertical offset of the child buffer, relative to the parent buffer's top-left pixel. If necessary, the given offset will be adjusted (clipped) to make sure that the top-left pixel of the child buffer is within the limits of the parent buffer.
Specifies the width of the child buffer. If necessary, the given dimension will be adjusted (clipped) to make sure that the bottom-right pixel of the child buffer is within the limits of the parent buffer.
Specifies the height of the child buffer. If necessary, the given dimension will be adjusted (clipped) to make sure that the bottom-right pixel of the child buffer is within the limits of the parent buffer.
Specifies the address of the variable in which the clipping status is written. If no status is required, set this parameter to M_NULL.
One or more of the following values can be returned together to denote that the child buffer was clipped. For example, when both the X-offset and the X-size are clipped, then M_CLIPPED_OFFSET_X + M_CLIPPED_SIZE_X is returned as the clipping status.
![]() |
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
Description | ||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() |
Specifies that no clipping was necessary. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() |
Specifies that the horizontal offset of the child buffer was clipped to fit within the width of the parent buffer. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() |
Specifies that the vertical offset of the child buffer was clipped to fit within the height of the parent buffer. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() |
Specifies that the width of the child buffer was clipped to fit within the width of the parent buffer. |
||||||||||||||||||||||||||||||||||||||
![]() ![]() ![]() |
Specifies that the height of the child buffer was clipped to fit within the height of the parent buffer. |
Header | Include mil.h. |
Library | Use mil.lib. |
DLL | Requires mil.dll. |