mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025544: Visualization, TKOpenGl - support grayscale textures
Image_PixMap::ImgFormat - extend enumeration by ImgAlpha and ImgAlphaF. OpenGl_Workspace::setTextureParams() - specify GL_REPLACE for 1-component textures with disabled modulation. OpenGl_Texture::GetDataFormat() - return GL_LUMINANCE format for ImgGray format and GL_ALPHA for ImgAlpha. vmarkerstest - override pixel format for grayscale images to ImgAlpha. Add test case bugs/vis/bug25544_graytexture.
This commit is contained in:
@@ -78,6 +78,7 @@ namespace
|
||||
switch (theFormat)
|
||||
{
|
||||
case Image_PixMap::ImgGrayF:
|
||||
case Image_PixMap::ImgAlphaF:
|
||||
return FIT_FLOAT;
|
||||
case Image_PixMap::ImgRGBAF:
|
||||
return FIT_RGBAF;
|
||||
@@ -90,6 +91,7 @@ namespace
|
||||
case Image_PixMap::ImgRGB:
|
||||
case Image_PixMap::ImgBGR:
|
||||
case Image_PixMap::ImgGray:
|
||||
case Image_PixMap::ImgAlpha:
|
||||
return FIT_BITMAP;
|
||||
default:
|
||||
return FIT_UNKNOWN;
|
||||
@@ -448,7 +450,8 @@ bool Image_AlienPixMap::Save (const TCollection_AsciiString& theFileName)
|
||||
}
|
||||
case FIF_EXR:
|
||||
{
|
||||
if (Format() == Image_PixMap::ImgGray)
|
||||
if (Format() == Image_PixMap::ImgGray
|
||||
|| Format() == Image_PixMap::ImgAlpha)
|
||||
{
|
||||
anImageToDump = FreeImage_ConvertToType (myLibImage, FIT_FLOAT);
|
||||
}
|
||||
|
Reference in New Issue
Block a user