1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030946: Visualization - Image_AlienPixMap ignores 1-bit pixelformat when using FreeImage

Convert 1-bit image to 8-bit one during its loading because only greyscale images are supported by visualization
This commit is contained in:
mzernova
2019-09-10 17:10:25 +03:00
committed by abv
parent 44b80414d3
commit fdae2107d9
2 changed files with 21 additions and 0 deletions

View File

@@ -589,6 +589,13 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
return false;
}
if (FreeImage_GetBPP (anImage) == 1)
{
FIBITMAP* aTmpImage = FreeImage_ConvertTo8Bits (anImage);
FreeImage_Unload (anImage);
anImage = aTmpImage;
}
Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
FreeImage_GetColorType(anImage),
FreeImage_GetBPP (anImage));