本文整理汇总了C++中Spectrum::green方法的典型用法代码示例。如果您正苦于以下问题:C++ Spectrum::green方法的具体用法?C++ Spectrum::green怎么用?C++ Spectrum::green使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spectrum
的用法示例。
在下文中一共展示了Spectrum::green方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CompareSpectra
static bool CompareSpectra(const Spectrum& s0, const Spectrum& s1)
{
TEST_PROPERTY(s0.red(), s1.red());
TEST_PROPERTY(s0.green(), s1.green());
TEST_PROPERTY(s0.blue(), s1.blue());
return false;
}
示例2: float
void
VectorMapLayer::renderTile(RenderContext& rc, const WorldGeometry* /* world */, const QuadtreeTile* tile) const
{
#ifndef VESTA_OGLES2
rc.setVertexInfo(VertexSpec::PositionColor);
Material simpleMaterial;
simpleMaterial.setDiffuse(Spectrum(1.0f, 1.0f, 1.0f));
simpleMaterial.setOpacity(1.0f);
rc.bindMaterial(&simpleMaterial);
float tileArc = float(PI) * tile->extent();
Vector2f southwest = tile->southwest();
SpherePatch box;
box.west = float(PI) * southwest.x();
box.east = box.west + tileArc;
box.south = float(PI) * southwest.y();
box.north = box.south + tileArc;
AlignedBox<float, 2> bounds(Vector2f(box.west, box.south), Vector2f(box.east, box.north));
for (vector<counted_ptr<MapElement> >::const_iterator iter = m_elements.begin(); iter != m_elements.end(); ++iter)
{
const MapElement* element = iter->ptr();
bool tileContainsElement = false;
if (element)
{
AlignedBox<float, 2> elementBox = element->bounds();
if (!elementBox.isNull())
{
if (elementBox.min().x() < bounds.max().x() &&
elementBox.max().x() > bounds.min().x() &&
elementBox.min().y() < bounds.max().y() &&
elementBox.max().y() > bounds.min().y())
{
tileContainsElement = true;
}
}
}
if (tileContainsElement)
{
Spectrum color = element->color();
glColor4f(color.red(), color.green(), color.blue(), element->opacity());
if (element->opacity() < 1.0f)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
else
{
glDisable(GL_BLEND);
}
element->render(box.west, box.south, box.east, box.north);
}
}
glDisable(GL_BLEND);
#endif
}