L_LTKRN_API L_INT L_SetBitmapYUVData(pBitmap, pYuvData, uYuvDataSize, yuvFormat, uFlags)
Updates the bitmap data using the YUV data from an input buffer. The YUV data is converted to grayscale/BGR before being set in the BITMAPHANDLE.
Pointer to the bitmap handle that references the bitmap whose data pointer will be set.
Pointer to a buffer that contains the YUV data (cannot be NULL).
Size of the data buffer pointed to by pYuvData. If uYuvDataSize is incorrect, this function fails and displays the ERROR_INVALID_YUV_SIZE error.
Specifies the YUV data format. See L_YUV.
Unused, reserved for future use. Pass 0.
|SUCCESS||The function was successful.|
|ERROR_BITPERPIXEL||pBitmap is not 8-, 24-, or 32-bits per pixel.|
|ERROR_NO_MEMORY||Not enough memory.|
|ERROR_INV_RANGE||Invalid bitmap width or height (usually because they are not multiple of 2).|
|ERROR_INVALID_YUV_SIZE||The size of the YUV data (
|ERROR_INVALID_YUV_FORMAT||The color space in
|< 1||An error occurred. Refer to Return Codes.|
This function is designed to be used mainly for use in mobile imaging to facilitate filling a BITMAPHANDLE structure using live frames from the mobile device's camera.
If the bitmap is not allocated, it will be allocated using conventional memory. There are restrictions on the bitmap width and height. For 4:1:1 (4:2:0) YUV data, both the bitmap width and height should be multiple of 2. For 4:2:2 YUV data, the bitmap width should be multiple of two.
The function ignores the bitmap's view perspective, so it must match the orientation of the YUV buffer. In most cases, the YUV buffer is top-to-bottom, so the ViewPerspective should be TOP_LEFT. If the YUV buffer is flipped, the ViewPerspective should be BOTTOM_LEFT, so it will be automatically flipped before saving or painting.
The YUV data should contain studio video YUV, with Y values ranging from 16 to 235 and U,V values ranging from 16 to 240. Values outside this range are clipped: values below 16 will be considered as if they were 16. Y values above 235 will be clipped to 235, U/V values above 240 will be clipped to 240.
Required DLLs and Libraries
Win32, x64, Linux.
For an example, refer to L_GetBitmapYUVData.
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries