本文整理汇总了C++中ScColor::getRawRGBColor方法的典型用法代码示例。如果您正苦于以下问题:C++ ScColor::getRawRGBColor方法的具体用法?C++ ScColor::getRawRGBColor怎么用?C++ ScColor::getRawRGBColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScColor
的用法示例。
在下文中一共展示了ScColor::getRawRGBColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintColorSample
void BarcodeGenerator::paintColorSample(QLabel *l, const ScColor & c)
{
QRect rect = l->frameRect();
QPixmap pm(rect.width(), rect.height());
pm.fill(c.getRawRGBColor()); // brute force sc2qt color convert for preview
l->setPixmap(pm);
}
示例2: event
bool ColorListBox::event(QEvent *event)
{
if (event->type() == QEvent::ToolTip)
{
if (cList != NULL)
{
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
QListWidgetItem* it = itemAt(helpEvent->pos());
if (it != 0)
{
event->accept();
QString tipText = "";
if (cList->contains(it->text()))
{
ScColor col = (*cList)[it->text()];
if (col.getColorModel() == colorModelCMYK)
{
int c, m, y, k;
col.getCMYK(&c, &m, &y, &k);
tipText = QString("C:%1% M:%2% Y:%3% K:%4%").arg(qRound(c / 2.55)).arg(qRound(m / 2.55)).arg(qRound(y / 2.55)).arg(qRound(k / 2.55));
}
else
{
int r, g, b;
col.getRawRGBColor(&r, &g, &b);
tipText = QString("R:%1 G:%2 B:%3").arg(r).arg(g).arg(b);
}
}
QToolTip::showText(helpEvent->globalPos(), tipText, this);
return true;
}
}
}
return QListWidget::event(event);
}
示例3: getShadeColorRGB
void ScColorEngine::getShadeColorRGB(const ScColor& color, const ScribusDoc* doc, RGBColorF& rgb, double level)
{
if (color.getColorModel() == colorModelCMYK)
{
CMYKColorF cmyk;
getShadeColorCMYK(color, doc, cmyk, level);
ScColor tmpC;
tmpC.setColorF(cmyk.c, cmyk.m, cmyk.y, cmyk.k);
getRGBValues(tmpC, doc, rgb);
}
else if (color.getColorModel() == colorModelRGB)
{
HSVColorF hsv;
color.getRawRGBColor(&rgb);
rgb.toHsv(hsv);
hsv.s = hsv.s * (level / 100.0);
hsv.v = 1.0 - (1.0 - hsv.v) * (level / 100.0);
hsv.toRgb(rgb);
//We could also compute rgb shade using rgb directly
/*rgb.r = 1.0 - ((1.0 - color.m_values[0]) * level / 100);
rgb.g = 1.0 - ((1.0 - color.m_values[1]) * level / 100);
rgb.b = 1.0 - ((1.0 - color.m_values[2]) * level / 100);*/
}
else if (color.getColorModel() == colorModelLab)
{
ScColorTransform trans = doc ? doc->stdLabToRGBTrans : ScCore->defaultLabToRGBTrans;
double inC[3];
inC[0] = 100 - (100 - color.m_L_val) * (level / 100.0);
inC[1] = color.m_a_val * (level / 100.0);
inC[2] = color.m_b_val * (level / 100.0);
quint16 outC[3];
trans.apply(inC, outC, 1);
rgb.r = outC[0] / 65535.0;
rgb.g = outC[1] / 65535.0;
rgb.b = outC[2] / 65535.0;
}
}