mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +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:
parent
44b80414d3
commit
fdae2107d9
@ -589,6 +589,13 @@ bool Image_AlienPixMap::Load (const Standard_Byte* theData,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FreeImage_GetBPP (anImage) == 1)
|
||||||
|
{
|
||||||
|
FIBITMAP* aTmpImage = FreeImage_ConvertTo8Bits (anImage);
|
||||||
|
FreeImage_Unload (anImage);
|
||||||
|
anImage = aTmpImage;
|
||||||
|
}
|
||||||
|
|
||||||
Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
|
Image_Format aFormat = convertFromFreeFormat (FreeImage_GetImageType(anImage),
|
||||||
FreeImage_GetColorType(anImage),
|
FreeImage_GetColorType(anImage),
|
||||||
FreeImage_GetBPP (anImage));
|
FreeImage_GetBPP (anImage));
|
||||||
|
14
tests/bugs/vis/bug30946
Normal file
14
tests/bugs/vis/bug30946
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
puts "============="
|
||||||
|
puts "0030946: Visualization - Image_AlienPixMap ignores 1-bit pixelformat when using FreeImage"
|
||||||
|
puts "============="
|
||||||
|
|
||||||
|
pload VISUALIZATION
|
||||||
|
vinit View
|
||||||
|
|
||||||
|
vbackground -image [locate_data_file bug30946_img_1bit_256px.png]
|
||||||
|
if { [vreadpixel 120 315 rgb name] != "WHITE" } { puts "Error: background image was loaded incorrectly" }
|
||||||
|
|
||||||
|
vpoint p0 0 0 0
|
||||||
|
vaspects p0 -setMarkerType [locate_data_file bug30946_img_1bit_32px.png]
|
||||||
|
|
||||||
|
vdump $imagedir/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user