ovis: setBackground(Scalar) - set clear color instead of 1x1 Texture

so we can use the alpha channel for e.g. masking
pull/1555/head
Pavel Rojtberg 7 years ago
parent c52eed063b
commit 68aebd2573
  1. 13
      modules/ovis/src/ovis.cpp

@ -323,12 +323,21 @@ public:
Pass* rpass = bgplane->getMaterial()->getBestTechnique()->getPasses()[0];
rpass->getTextureUnitStates()[0]->setTextureName(name);
// ensure bgplane is visible
bgplane->setVisible(true);
}
void setBackground(const Scalar& color)
{
Mat img(1, 1, CV_8UC3, color);
setBackground(img);
// hide background plane
bgplane->setVisible(false);
// BGRA as uchar
ColourValue _color = ColourValue(color[2], color[1], color[0], color[3]) / 255;
rWin->getViewport(0)->setBackgroundColour(_color);
if(frameSrc != rWin)
frameSrc->getViewport(0)->setBackgroundColour(_color);
}
void createEntity(const String& name, const String& meshname, InputArray tvec, InputArray rot)

Loading…
Cancel
Save