#include "l_bitmap.h"
L_LTIMGCOR_API L_INT L_GetBitmapColorType(pBitmap, puType, puConfidence, uFlag)
pBITMAPHANDLE pBitmap; |
pointer to the bitmap handle |
L_UINT * puType; |
pointer to a variable to be updated |
L_INT * puConfidence; |
pointer to a variable to be updated |
L_UINT uFlag; |
flags |
Gets the color type of the bitmap (black and white, color or grayscale), along with the confidence level.
Parameter | Description | |
pBitmap | Pointer to the bitmap handle referencing the bitmap whose color type will be retrieved. | |
puType | Pointer to a variable to be updated with the color type of the bitmap. Possible values are: | |
Value | Meaning | |
BITMAP_COLORTYPE_BLACKANDWHITE | [0x00000001] The bitmap is black and white. | |
BITMAP_COLORTYPE_GRAYSCALE | [0x00000002] The bitmap is grayscale. | |
BITMAP_COLORTYPE_COLOR | [0x00000003] The bitmap is color. | |
puConfidence | Pointer to a variable to be updated with the level of accuracy. Possible values are range from 50 to 100. | |
uFlag | A flag that is used to make the algorithm favor one type of bitmap over the others. For example, if color bitmaps are expected to be detected, even if they are more grayscale, they can be favored by passing BITMAP_COLORTYPE_FAVOR_COLOR. Possible values are: | |
Value | Meaning | |
BITMAP_COLORTYPE_FAVOR_COLOR | [0x00000001] Favor color bitmaps over other types. | |
BITMAP_COLORTYPE_FAVOR_BLACKANDWHITE | [0x00000002] Favor black and white bitmaps over other types.. | |
BITMAP_COLORTYPE_FAVOR_GRAYSCALE | [0x00000004] Favor grayscale bitmaps over other types. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
This functions works with 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 24, 32, 48 and 64-bit images.
Required DLLs and Libraries
For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64, Linux.
Functions: |
|
Topics: |
|
|
This example gets the type of the image and whether it's black and white, colored or grayscale, along with the confidence level.
L_INT GetBitmapColorTypeExample(pBITMAPHANDLE pBitmap)
{
L_INT nRet = 0;
L_UINT uType = 0; /* bitmap color type */
L_INT uConfidence = 0; /* confidence */
L_TCHAR szMessage[80]; /* Buffer for the MessageBox string */
nRet = L_GetBitmapColorType(pBitmap, &uType, &uConfidence, BITMAP_COLORTYPE_FAVOR_COLOR);
if(nRet != SUCCESS)
return nRet;
/* Display the result in a message */
switch(uType)
{
case BITMAP_COLORTYPE_BLACKANDWHITE:
wsprintf( szMessage, TEXT("The bitmap is Black and White: %ld"), uConfidence );
break;
case BITMAP_COLORTYPE_GRAYSCALE:
wsprintf( szMessage, TEXT("The bitmap is Grayscale: %ld"), uConfidence );
break;
case BITMAP_COLORTYPE_COLOR:
wsprintf( szMessage, TEXT("The bitmap is Color: %ld"), uConfidence );
break;
}
MessageBox (NULL, szMessage, TEXT("Result"), MB_OK);
return SUCCESS;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.