| Customize Help
| Save Settings

MbufGetColor



Function Map
Synopsis
Get data from one or all bands of a buffer and place it in a user-supplied array.
Syntax
void MbufGetColor(
MIL_ID SrcBufId, //in
MIL_INT64 DataFormat, //in
MIL_INT Band, //in
void *UserArrayPtr //out
)
Description

This function copies data from one or all bands of a specified MIL source buffer to a user-supplied array.

If the source buffer is compressed, MIL decompresses the data before copying it to the user-supplied array.

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 if there is complementary information.
Parameters
This function is not supported on the selected boards.
Parameters
SrcBufId

Specifies the identifier of the source buffer.

If the specified buffer is an image buffer with an associated region of interest (ROI), an error will occur.

DataFormat

Specifies the data format to use to save the data in the user array. The internal data format of the source buffer need not match the specified data format of the user-supplied array; an internal conversion will be performed if necessary. Note, however, if the formats do match, the operation will be much faster.

See the Parameter associations section for possible values that can be specified.

Band

Specifies the index of the band to copy. This parameter can be set to one of the values below.

function map For specifying the index of the band to copy
Click to summarizeValue Description
Click to summarize M_ALL_BANDS

Copies from all bands.

Click to summarize M_BLUE

Copies from the blue band (for RGB buffers).

Click to summarize M_GREEN

Copies from the green band (for RGB buffers).

Click to summarize M_HUE

Copies from the hue band (for HSL and HSV buffers).

Click to summarize M_LUMINANCE

Copies from the luminance band (for HSL buffers).

Click to summarize M_RED

Copies from the red band (for RGB buffers).

Click to summarize M_SATURATION

Copies from the saturation band (for HSL and HSV buffers).

Click to summarize M_V

Copies from the V band (for HSV buffers).

Click to summarize 0 <= Value < #bands

Specifies the index of the band to copy.

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

0

Corresponds to the red band for RGB buffers, the hue band for HSL and HSV buffers.

1

Corresponds to the green band for RGB buffers or the saturation band for HSL and HSV buffers.

2

Corresponds to the blue band for RGB buffers, or the luminance band for HSL buffers, or the V band for HSV buffers.

(summarize)
UserArrayPtr
Accepts the address of one of the following (see the Parameter associations section for specifics on which is expected):
  • array of the same type as the buffer (SrcBufId) [optionally, in C++: a reference to a std::vector of the same type as the buffer]
  • array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ]

Specifies the address of the user array in which to copy data from the source buffer. Ensure that the user array is large enough to receive the data from the specified bands of the source buffer.

See the Parameter associations section for possible values that can be returned.

The table below lists possible values for the DataFormat parameter and possible values returned to the UserArrayPtr parameter.

Note that SizeX and SizeY denote the source buffer's width and height, respectively.

function map For specifying the data format
Click to summarize
DataFormat
Description
UserArrayPtr
- Possible values returned
Click to summarize M_PACKED +

Copies buffer bands in an interleaved manner (for example, RGB RGB RGB...). This format is only valid when the Band parameter is set to M_ALL_BANDS.


You must specify a combination value from the following table:
(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Click to summarize M_PLANAR

Copies the bands one after the other in RGB planar format (for example, RRR...GGG...BBB...). This format is only valid when the Band parameter is set to M_ALL_BANDS.

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of the same type as the buffer (SrcBufId) [optionally, in C++: a reference to a std::vector of the same type as the buffer] MORE
Click to summarize M_SINGLE_BAND

Copies a single band. This format is not valid when the Band parameter is set to M_ALL_BANDS.

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of the same type as the buffer (SrcBufId) [optionally, in C++: a reference to a std::vector of the same type as the buffer] MORE
Combination values for M_PACKED.

You must add one of the following values to the above-mentioned value to set the packed data format.

For more information on these formats, see the RGB buffers section of Chapter 21: Data buffers.

function map For setting the packed data format
Click to summarizeDataFormat Description
UserArrayPtr
- Possible values returned
Click to summarize M_BGR24

Stores the data in a BGR24 packed format. In this format, each pixel is internally stored as three consecutive bytes.

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Click to summarize M_BGR32

Stores the data in a BGR32 packed format. In this format, each pixel is internally stored as four consecutive bytes. Every fourth byte is a "don't care" byte.

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Click to summarize M_RGB15

Stores the data in an RGB15 packed format. In this format, each pixel is internally stored as a 16-bit word with a 5-bit blue value (least significant), a 5-bit green value, a 5-bit red value, and a "don't care" bit (most significant), in little-endian order (RGB 5:5:5).

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Click to summarize M_RGB16

Stores the data in an RGB16 packed format. In this format, each pixel is internally stored as a 16-bit word with a 5-bit blue value (least significant), a 6-bit green value, and a 5-bit red value (most significant), in little-endian order (RGB 5:6:5).

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Click to summarize M_RGB24

Stores the data in an RGB24 packed format. In this format, each pixel is internally stored as three consecutive bytes.

(summarize)
Expand data type infoCollapse data type info UserArrayPtr extra info
Data type info: Data type: array of type unsigned-char [optionally, in C++: a reference to a std::vector<unsigned-char> ] MORE
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
NONE ALL BANDS BLUE GREEN HUE LUMINANCE RED SATURATION V PACKED PLANAR SINGLE BAND BGR24 BGR32 RGB15 RGB16 RGB24 ALL BANDS ALL BANDS