Filters
Filter values by
Object Type
  • Array buffer
  • Image buffer
    • Image buffer that supports compression
    • Image buffer that supports processing
    • Image buffer that supports grabbing
  • Kernel buffer
  • LUT buffer
  • Structuring element buffer
| Customize Help
| Save Settings

MbufAllocComponent



Function Map
Synopsis
Allocate a buffer and add it as a component of a container.
Syntax
MIL_ID MbufAllocComponent(
MIL_ID ContainerBufId, //in
MIL_INT SizeBand, //in
MIL_INT SizeX, //in
MIL_INT SizeY, //in
MIL_INT Type, //in
MIL_INT64 Attribute, //in
MIL_INT64 ComponentType, //in
MIL_ID *ComponentIdPtr //out
)
Description

This function allocates a buffer and adds it as a component of a container. The buffer is allocated on the same system as the container.

Note that typically you do not need to manually allocate components. MIL typically allocates/reallocates components as required when the container is used as a destination for a grabbing or processing function.

After allocating the component, you should check that the operation was successful (either using MappGetError(), or by verifying that the buffer identifier returned is not Null).

When the component is no longer required, free it using MbufFreeComponent() or free its container using MbufFree().

Note that in some cases, a component allocated using MbufAllocComponent() might be freed and reallocated automatically if its container is the destination for a MIL function (such as a grabbing or 3D processing function). If the buffer is reallocated, its MIL identifier will change. If you need to access the component directly using its MIL buffer identifier, you should inquire its MIL identifier (using MbufInquireContainer() with M_COMPONENT_ID) any time its container is passed as the destination of a MIL function.

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
ContainerBufId

Specifies the MIL identifier of the container to which to add the component.

SizeBand INQ

Specifies the number of (x,y) surfaces (also called bands) to allocate to the buffer. When allocating a buffer to store color, specify one band for each color, or other type of data, that the buffer needs to store (for example, monochrome images require one color band; RGB color images require three color bands). This parameter can be set to any non-zero integer value. However, in general, only 1- and 3-band buffers are allowed.

SizeX INQ

Specifies the buffer width. The units are determined by the selected buffer attribute. For example, if the buffer has an image buffer attribute, width is specified in pixels.

SizeY INQ

Specifies the buffer height. The units are determined by the selected buffer attribute. For example, if the buffer has an image buffer attribute, height is specified in pixels.

Type INQ

Specifies a combination of two values: data type and data depth per band. Specify the depth of the buffer per band as one of the following:

function map For the data depth of the component
Click to summarizeValue Description
Click to summarize 1 +

Specifies a 1-bit (packed binary) buffer. INFO

Click to summarize 8 +

Specifies an 8-bit buffer.

Click to summarize 16 +

Specifies a 16-bit buffer.

Click to summarize 32 +

Specifies a 32-bit buffer.

Combination values for 1; 8; 16; 32.

You can add one of the following values to the above-mentioned values to set the data type.

Supported data types depend on the specified depth.

function map For specifying the data type of the buffer
Click to summarize
Combination value
Description
Click to summarize M_FLOAT

Specifies that the type of data is floating-point. INFO

Click to summarize M_SIGNED

Specifies that the type of data is signed. INFO

Click to summarize M_UNSIGNED

Specifies that the type of data is unsigned. INFO

This is the default value.

(summarize)
Attribute INQ

Specifies the buffer usage. MIL uses this information to determine where to allocate the buffer in physical memory.

Set this parameter to one of the following values:

function map For specifying the buffer usage
Click to summarizeValue Description
Click to summarize M_ARRAY +

Specifies a buffer to store array type data. INFO

Click to summarize M_IMAGE +

Specifies a buffer to store image data.

Click to summarize M_KERNEL +

Specifies a kernel buffer to store a custom filter for convolution functions. INFO

Click to summarize M_LUT +

Specifies a buffer to store lookup table data. INFO

Click to summarize M_STRUCT_ELEMENT +

Specifies a buffer to store structuring element data for morphology functions. INFO

Combination values for M_IMAGE.

You can add one or more of the following values to the above-mentioned value to set the intended purpose of the image buffer.

Note that the component is always automatically assigned the intended usage attributes of its container (such as M_PROC or M_DISP). You can therefore optionally omit the intended purpose setting when allocating a component. You can still specify valid combination values for these settings if you omit them.

Attempting to allocate a component with one of the following attributes in a container that does not have the attribute will generate an error (aside from M_COMPRESS).

function map For specifying the intended purpose of the image buffer
Click to summarize
Combination value
Description
Click to summarize M_COMPRESS +

Specifies an image buffer that can hold compressed data. INFO

Click to summarize M_DISP

Specifies an image buffer that can be displayed.

Click to summarize M_GRAB

Specifies an image buffer in which to grab data. INFO

Click to summarize M_PROC +

Specifies an image buffer that can be processed. INFO

Combination value for M_PROC.

You can add the following value to the above-mentioned value to set the allocation of an overscan region.

This overrides the MsysControl() M_ALLOCATION_OVERSCAN system control setting and forces the allocation of an overscan region. When this attribute is set, the setting of the M_ALLOCATION_OVERSCAN_SIZE system control determines the size of the overscan region and the M_ALLOCATION_OVERSCAN setting is ignored.

Note that this attribute is only useful when added to a buffer on which you want to perform neighborhood processing operations.

function map For allocating an overscan region
Click to summarize
Combination value
Description
Click to summarize M_ALLOCATION_OVERSCAN

Specifies that the buffer is allocated with an overscan region. INFO

Combination values for M_COMPRESS.

You can add one of the following values to the above-mentioned value to set the compression type.

The image buffer's data depth dictates which compression type can be selected.

function map For specifying the compression type
Click to summarize
Combination value
Description
Click to summarize M_H264
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold H.264 data. This compression type is used when specifying a source of an input or a destination of an output for a sequence operation as an array of buffers (MseqDefine() with M_BUFFER_LIST).

(summarize)
Click to summarize M_JPEG2000_LOSSLESS
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG2000 lossless data. The supported data formats are: 1-band, 8- or 16-bit data, and 3-band, 8- or 16-bit data in M_RGB24 + M_PLANAR, M_RGB48 + M_PLANAR, or M_YUV24 + M_PLANAR format.

(summarize)
Click to summarize M_JPEG2000_LOSSY
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG2000 lossy data. The supported data formats are: 1-band, 8- or 16-bit data, and 3-band, 8- or 16-bit data in M_RGB24, M_RGB48, M_YUV9, M_YUV12, M_YUV16 + M_PLANAR, or M_YUV24 format.

(summarize)
Click to summarize M_JPEG_LOSSLESS
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG lossless data. The supported data formats are: 1-band, 8- or 16-bit data, and 3-band data in M_RGB24 or M_RGB48 format.

(summarize)
Click to summarize M_JPEG_LOSSLESS_INTERLACED
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG lossless data in separate fields. The supported data formats are 1-band, 8- or 16-bit data.

(summarize)
Click to summarize M_JPEG_LOSSY
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG lossy data. The supported data formats are: 1-band 8-bit data, and 3-band 8-bit data in M_RGB24, M_YUV24, M_YUV12, M_YUV9, M_YUV16 + M_PLANAR, or M_YUV16 + M_PACKED format.

This is the default value.

(summarize)
Click to summarize M_JPEG_LOSSY_INTERLACED
[For essential MIL-Lite information, see remarks ]

Specifies that the buffer will be used to hold JPEG lossy data in separate fields. The supported data formats are: 1-band 8-bit data, and 3-band 8-bit data in M_YUV16 + M_PACKED format.

(summarize)
Combination values for M_IMAGE.

You can add one of the following values to the above-mentioned value to set a storage format and a location specifier.

MIL automatically selects the most appropriate storage format according to the specified intended usage attribute. For general processing, MIL will convert the data when the function requires a different format. If the default storage format is not appropriate and you want to avoid conversion during a time critical operation, you can add a storage format and a location specifier.

function map For specifying a storage format and a location specifier
Click to summarize
Combination value
Description MIL system-specific
tooltip (‡)
Click to summarize M_DIB

Forces the buffer to be a DIB buffer. INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_DIRECTX
[This is only applicable to Windows]

Forces the buffer to be a DirectX surface.

a c
M10
g h i j k
M10
l m o p r
U27
u
U36
v y
U75
aa
Click to summarize M_GDI

Forces the buffer to be compatible with GDI. INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_LINUX_MXIMAGE
[This is only applicable to Linux]

Forces the buffer to be an X11 Ximage.

a c
M10
g h i j k
M10
l m o p r
U27
u
U36
v y
U75
aa
Combination value for the values listed in For specifying the buffer usage; and for the following values: M_ARRAY; M_IMAGE; M_KERNEL; M_LUT; M_STRUCT_ELEMENT.

You can add the following value to the above-mentioned values to specify that the buffer is FPGA accessible.

Note that the following value cannot be used with M_COMPRESS or values in the For specifying a storage format and a location specifier table.

function map For specifying that the buffer is FPGA accessible
Click to summarize
Combination value
Description MIL system-specific
tooltip (‡)
Click to summarize M_FPGA_ACCESSIBLE +

Forces the buffer to be allocated in a bank of memory that is accessible from the Processing FPGA. INFO

j l m p r
U27
aa
Combination values for M_IMAGE.

You can add one of the following values to the above-mentioned value to set a storage format for color buffers.

Note that the buffer must be a color buffer. Also note that it might be slower to use buffers that have been forced with one of these attributes. Although there is no right or wrong storage format to use, certain operations are optimized for some formats.

function map For specifying a storage format for color buffers INQ
Click to summarize
Combination value
Description
Click to summarize M_PACKED +

Specifies that the buffer's bands are stored in packed format (color buffer only); that is, the pixel components are stored together (RGB RGB RGB...). INFO

Click to summarize M_PLANAR +

Specifies that the buffer's bands are stored in planar format (color buffer only); that is, each pixel is stored as three component planes (RRR... GGG... BBB...). INFO

Combination values for M_PLANAR.

You can add one of the following values to the above-mentioned value to set a planar color buffer format. Alternatively, you can add a value from For specifying a packed or planar color buffer format.

Note that the values below cannot be used with grab buffers (M_GRAB), unless otherwise stated.

function map For specifying a planar color buffer format
Click to summarize
Combination value
Description MIL system-specific
tooltip (‡)
Click to summarize M_RGB3

Specifies 3-bit color depth (RGB 1:1:1) planar pixels.

a g h i j k
M10
l m p r
U27
t
U28
u
U36
y
U75
aa
Click to summarize M_YUV9

Specifies YUV9 planar pixels.

a g h i j k
M10
l m p r
U27
t
U28
u
U36
y
U75
aa
Click to summarize M_YUV12

Specifies YUV12 planar pixels.

a g h i j k
M10
l m p r
U27
t
U28
u
U36
y
U75
aa
Click to summarize M_YUV24

Specifies YUV24 planar pixels.

a g h i j k
M10
l m p r
U27
t
U28
u
U36
y
U75
aa
Combination values for M_PACKED.

You can add one of the following values to the above-mentioned value to set a packed color buffer format. Alternatively, you can add a value from For specifying a packed or planar color buffer format.

Note that the values below cannot be used with grab buffers (M_GRAB), unless otherwise stated.

function map For specifying a packed color buffer format
Click to summarize
Combination value
Description MIL system-specific
tooltip (‡)
Click to summarize M_BGR24

Specifies 24-bit color depth packed pixels (BGRBGR). INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_BGR32

Specifies 32-bit color depth packed pixels (BGRXBGRX). INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_RGB15

Specifies 16-bit color depth packed pixels (XRGB 1:5:5:5). INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_RGB16

Specifies 16-bit color depth packed pixels (RGB 5:6:5). INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_YUV16_UYVY

Specifies YUV16 packed (4:2:2) pixels, whereby the components of each pixel are stored in the UYVY order. INFO

c
M10
o v
Click to summarize M_YUV16_YUYV

Specifies YUV16 packed (4:2:2) pixels, whereby the components of each pixel are stored in the YUYV order. INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Combination values for the values listed in For specifying a storage format for color buffers.

You can add one of the following values to the above-mentioned values to set a packed or planar color buffer format. Alternatively, you can add a value from For specifying a packed color buffer format or from For specifying a planar color buffer format.

Note that the values below cannot be used with grab buffers (M_GRAB), unless otherwise stated.

function map For specifying a packed or planar color buffer format
Click to summarize
Combination value
Description
Click to summarize M_RGB24

Specifies 24-bit color depth (RGB 8:8:8) packed or planar pixels. INFO

Click to summarize M_RGB48

Specifies 48-bit color depth (RGB 16:16:16). INFO

Click to summarize M_RGB96

Specifies 96-bit color depth (RGB 32:32:32) packed or planar pixels.

Click to summarize M_YUV16

Specifies YUV16 (4:2:2) pixels. INFO

Combination values for M_ARRAY; M_IMAGE; M_KERNEL; M_LUT; M_STRUCT_ELEMENT.

You can add one of the following values to the above-mentioned values to set a location for a buffer.

function map For specifying a location for a buffer
Click to summarizeCombination value Description MIL system-specific
tooltip (‡)
Click to summarize M_HOST_MEMORY +

Forces the buffer in Host memory.

This is the default value.

(summarize)
a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_MAPPABLE

Forces the buffer to be allocated in non-paged memory that can be set in the address space of the process (Host memory). INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_OFF_BOARD

Ensures that the buffer is not in on-board memory. INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Click to summarize M_ON_BOARD +

Forces the buffer in on-board memory. INFO

g h i j k
M10
l m p r
U27
t
U28
u
U36
y
U75
aa
Click to summarize M_VIDEO_MEMORY

Forces the buffer in (off-screen) display memory of your graphics controller. INFO

a c
M10
g h i j k
M10
l m o p r
U27
t
U28
u
U36
v y
U75
aa
Combination value for the values listed in For specifying that the buffer is FPGA accessible; and for the following values: M_HOST_MEMORY; M_ON_BOARD.

You can add the following value to the above-mentioned values to specify a memory bank to be used.

function map For specifying a memory bank to be used
Click to summarizeCombination value Description
Click to summarize M_MEMORY_BANK_n

Forces the buffer to be allocated in the specified memory bank. INFO

Combination values for the values listed in For specifying that the buffer is FPGA accessible; and for the following value: M_ON_BOARD.

You can add one of the following values to the above-mentioned values to set a location in a specific type of memory.

function map For specifying a location in a specific type of memory
Click to summarize
Combination value
Description MIL system-specific
tooltip (‡)
Click to summarize M_FAST_MEMORY

Specifies that the buffer is in the fastest memory available. INFO

j l m p
Click to summarize M_SHARED

Specifies that the buffer is in shared processing memory. INFO

j k
M10
l m p r
U27
y
U75
aa
Combination values for M_ARRAY; M_IMAGE; M_KERNEL; M_LUT; M_STRUCT_ELEMENT.

You can add one of the following values to the above-mentioned values to set the attribute of the specified physical memory type.

function map For specifying the attribute of the specified physical memory type
Click to summarizeCombination value Description
Click to summarize M_NON_PAGED

Forces the buffer in MIL-reserved, non-pageable memory.

Click to summarize M_PAGED

Forces the buffer in pageable memory.

ComponentType

Specifies the component type, which identifies what kind of information the component stores.

function map For specifying the type of component
Click to summarizeValue Description
Click to summarize M_DEFAULT

Specifies the default component type. The default component type for image buffers is M_COMPONENT_INTENSITY. The default component type for all other buffers is M_COMPONENT_UNDEFINED.

(summarize)
Click to summarize M_COMPONENT_CONFIDENCE

Specifies that the component stores confidence information for the M_COMPONENT_RANGE or M_COMPONENT_DISPARITY component of the container. Coordinates associated with the confidence value 0 are considered invalid data and will not be used by 3D image processing functions.

A confidence component is associated with a range or disparity component in the same container when there are no other range, disparity, or confidence components in the container. If there is more than one range, disparity, and/or confidence component in a container (for example, because a single grab into the container transmitted multiple range and confidence components), you will need to either create a child container which contains only the required components using MbufChildContainer(), or free the extra components using MbufFreeComponent().

(summarize)
Click to summarize M_COMPONENT_CUSTOM + n

Specifies that the component has a custom component type, identified by n, where n can be a value between 0 and 254.

You can use custom component types to identify components which store information that does not fit one of the standard component types. In addition, some cameras transmit components with custom component types. Refer to your camera manual to determine what type of information is stored in transmitted components.

(summarize)
Click to summarize M_COMPONENT_DISPARITY

Specifies that the component stores a disparity map. Each pixel of a disparity map indicates the apparent distance (typically measured in pixel units) between where an object appears in the left and right images captured by a stereoscopic camera.

(summarize)
Click to summarize M_COMPONENT_INFRARED

Specifies that the component stores an intensity image of infrared light.

Click to summarize M_COMPONENT_INTENSITY

Specifies that the component stores an intensity image of visible light.

Click to summarize M_COMPONENT_MESH_MIL

Specifies that the component stores mesh information for the M_COMPONENT_RANGE component of the container.

A mesh component is associated with a range component in the same container when there are no other range or mesh components in that container. A point cloud container which has a mesh component is referred to as a meshed point cloud container.

(summarize)
Click to summarize M_COMPONENT_METADATA

Specifies that the component stores metadata information. Metadata components are used by MIL internally. Typically, you should ignore metadata components in your application.

(summarize)
Click to summarize M_COMPONENT_MULTISPECTRAL

Specifies that the component stores an intensity image where each band represents the intensity of a specific wavelength of light. Unlike an intensity component, a multispectral component might include information about non-visible light.

(summarize)
Click to summarize M_COMPONENT_NORMALS_MIL

Specifies that the component stores normals information for each point in the M_COMPONENT_RANGE component of the container.

A normals component is associated with a range component in the same container when there are no other range or normals components in that container.

(summarize)
Click to summarize M_COMPONENT_RANGE

Specifies that the component stores 3D distance/position information. This can be either a 1-band buffer that stores a depth map, or a 3-band buffer that stores coordinates of 3D points.

(summarize)
Click to summarize M_COMPONENT_REFLECTANCE

Specifies that the component stores a reflectance map. Each pixel of a reflectance map indicates how much of the light hitting an object at that location is reflected back. Typically, this is an intensity image of the light spectrum used by a 3D sensor to detect 3D distance/position information. Typically, if the map was generated by a laser profiler, each row indicates the detected intensity of the laser for a single scan.

(summarize)
Click to summarize M_COMPONENT_SCATTER

Specifies that the component stores a scatter map. Each pixel of a scatter map indicates how much of the light hitting an object at that location is detected scattering beneath the object's surface.

(summarize)
Click to summarize M_COMPONENT_ULTRAVIOLET

Specifies that the component stores an intensity image of ultraviolet light.

Click to summarize M_COMPONENT_UNDEFINED

Specifies that the component stores information of an unknown type.

ComponentIdPtr

Specifies the address of the variable in which to write the buffer identifier. Since the MbufAllocComponent() function also returns the buffer identifier, you can set this parameter to M_NULL. If allocation fails, M_NULL is written as the identifier.

Return value
The returned value is the buffer identifier. If allocation fails, M_NULL is returned.
Remarks
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
FLOAT SIGNED UNSIGNED ARRAY IMAGE KERNEL LUT STRUCT ELEMENT COMPRESS DISP GRAB PROC ALLOCATION OVERSCAN H264 JPEG2000 LOSSLESS JPEG2000 LOSSY JPEG LOSSLESS JPEG LOSSLESS INTERLACED JPEG LOSSY JPEG LOSSY INTERLACED DIB DIRECTX GDI LINUX MXIMAGE FPGA ACCESSIBLE PACKED PLANAR RGB3 YUV9 YUV12 YUV24 BGR24 BGR32 RGB15 RGB16 YUV16 UYVY YUV16 YUYV RGB24 RGB48 RGB96 YUV16 HOST MEMORY MAPPABLE OFF BOARD ON BOARD VIDEO MEMORY MEMORY BANK n FAST MEMORY SHARED NON PAGED PAGED DEFAULT COMPONENT CONFIDENCE COMPONENT CUSTOM n COMPONENT DISPARITY COMPONENT INFRARED COMPONENT INTENSITY COMPONENT MESH MIL COMPONENT METADATA COMPONENT MULTISPECTRAL COMPONENT NORMALS MIL COMPONENT RANGE COMPONENT REFLECTANCE COMPONENT SCATTER COMPONENT ULTRAVIOLET COMPONENT UNDEFINED ARRAY IMAGE KERNEL LUT STRUCT ELEMENT M_MEMORY_BANK_n M_COMPONENT_CUSTOM + n