Graphic3d_BufferType has been extended by Graphic3d_BT_Red.
#define _Graphic3d_BufferType_H__
//! Define buffers available for dump
-typedef enum
+enum Graphic3d_BufferType
{
Graphic3d_BT_RGB, //!< color buffer without alpha component
Graphic3d_BT_RGBA, //!< color buffer
- Graphic3d_BT_Depth, //!< depth buffer
- Graphic3d_BT_RGB_RayTraceHdrLeft //!< left view HDR color buffer for Ray-Tracing
-} Graphic3d_BufferType;
+ Graphic3d_BT_Depth, //!< depth buffer
+ Graphic3d_BT_RGB_RayTraceHdrLeft, //!< left view HDR color buffer for Ray-Tracing
+ Graphic3d_BT_Red, //!< color buffer, red channel
+};
#endif // _Graphic3d_BufferType_H__
{
#if !defined(GL_ES_VERSION_2_0)
case Image_Format_Gray:
- aFormat = GL_DEPTH_COMPONENT;
+ aFormat = theBufferType == Graphic3d_BT_Depth ? GL_DEPTH_COMPONENT : GL_RED;
aType = GL_UNSIGNED_BYTE;
break;
case Image_Format_GrayF:
- aFormat = GL_DEPTH_COMPONENT;
+ aFormat = theBufferType == Graphic3d_BT_Depth ? GL_DEPTH_COMPONENT : GL_RED;
aType = GL_FLOAT;
break;
case Image_Format_RGB:
case Graphic3d_BT_RGBA: aFormat = Image_Format_RGBA; break;
case Graphic3d_BT_Depth: aFormat = Image_Format_GrayF; break;
case Graphic3d_BT_RGB_RayTraceHdrLeft: aFormat = Image_Format_RGBF; break;
+ case Graphic3d_BT_Red: aFormat = Image_Format_Gray; break;
}
if (!theImage.InitZero (aFormat, Standard_Size(aTargetSize.x()), Standard_Size(aTargetSize.y())))
{
aParams.BufferType = Graphic3d_BT_RGB;
}
+ else if (aBufArg == "red")
+ {
+ aParams.BufferType = Graphic3d_BT_Red;
+ }
else if (aBufArg == "depth")
{
aParams.BufferType = Graphic3d_BT_Depth;
{
aParams.BufferType = Graphic3d_BT_RGB;
}
+ else if (anArg == "-red"
+ || anArg == "red")
+ {
+ aParams.BufferType = Graphic3d_BT_Red;
+ }
else if (anArg == "-depth"
|| anArg == "depth")
{
case Graphic3d_BT_RGBA: aFormat = Image_Format_RGBA; break;
case Graphic3d_BT_Depth: aFormat = Image_Format_GrayF; break;
case Graphic3d_BT_RGB_RayTraceHdrLeft: aFormat = Image_Format_RGBF; break;
+ case Graphic3d_BT_Red: aFormat = Image_Format_Gray; break;
}
switch (aStereoPair)