本文整理汇总了C++中QLCFixtureHead::channelNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ QLCFixtureHead::channelNumber方法的具体用法?C++ QLCFixtureHead::channelNumber怎么用?C++ QLCFixtureHead::channelNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLCFixtureHead
的用法示例。
在下文中一共展示了QLCFixtureHead::channelNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateMapChannels
void RGBMatrix::updateMapChannels(const RGBMap& map, const FixtureGroup* grp)
{
uint fadeTime = (overrideFadeInSpeed() == defaultSpeed()) ? fadeInSpeed() : overrideFadeInSpeed();
// Create/modify fade channels for ALL pixels in the color map.
for (int y = 0; y < map.size(); y++)
{
for (int x = 0; x < map[y].size(); x++)
{
QLCPoint pt(x, y);
GroupHead grpHead(grp->head(pt));
Fixture* fxi = doc()->fixture(grpHead.fxi);
if (fxi == NULL)
continue;
QLCFixtureHead head = fxi->head(grpHead.head);
QVector <quint32> rgb = head.rgbChannels();
QVector <quint32> cmy = head.cmyChannels();
quint32 masterDim = fxi->masterIntensityChannel();
quint32 headDim = head.channelNumber(QLCChannel::Intensity, QLCChannel::MSB);
// Collect all dimmers that affect current head:
// They are the master dimmer (affects whole fixture)
// and per-head dimmer.
//
// If there are no RGB or CMY channels, the least important* dimmer channel
// is used to create grayscale image.
//
// The rest of the dimmer channels are set to full if dimmer control is
// enabled and target color is > 0 (see
// http://www.qlcplus.org/forum/viewtopic.php?f=29&t=11090)
//
// Note: If there is only one head, and only one dimmer channel,
// make it a master dimmer in fixture definition.
//
// *least important - per head dimmer if present,
// otherwise per fixture dimmer if present
QVector <quint32> dim;
if (masterDim != QLCChannel::invalid())
dim << masterDim;
if (headDim != QLCChannel::invalid())
dim << headDim;
uint col = map[y][x];
if (rgb.size() == 3)
{
// RGB color mixing
{
FadeChannel fc(doc(), grpHead.fxi, rgb.at(0));
fc.setTarget(qRed(col));
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
{
FadeChannel fc(doc(), grpHead.fxi, rgb.at(1));
fc.setTarget(qGreen(col));
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
{
FadeChannel fc(doc(), grpHead.fxi, rgb.at(2));
fc.setTarget(qBlue(col));
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
}
else if (cmy.size() == 3)
{
// CMY color mixing
QColor cmyCol(col);
{
FadeChannel fc(doc(), grpHead.fxi, cmy.at(0));
fc.setTarget(cmyCol.cyan());
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
{
FadeChannel fc(doc(), grpHead.fxi, cmy.at(1));
fc.setTarget(cmyCol.magenta());
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
{
FadeChannel fc(doc(), grpHead.fxi, cmy.at(2));
fc.setTarget(cmyCol.yellow());
insertStartValues(fc, fadeTime);
m_fader->add(fc);
}
}
else if (!dim.empty())
{
//.........这里部分代码省略.........