当前位置: 首页>>代码示例>>C++>>正文


C++ ScColor::getCMYK方法代码示例

本文整理汇总了C++中ScColor::getCMYK方法的典型用法代码示例。如果您正苦于以下问题:C++ ScColor::getCMYK方法的具体用法?C++ ScColor::getCMYK怎么用?C++ ScColor::getCMYK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScColor的用法示例。


在下文中一共展示了ScColor::getCMYK方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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);
}
开发者ID:pvanek,项目名称:scribus-cuba-1.5.0,代码行数:35,代码来源:colorlistbox.cpp

示例2: if

static quint64 code64(const ScColor & col)
{
	int C = 0;
	int M = 0;
	int Y = 0;
	int K = 0;
	int R = 0;
	int G = 0;
	int B = 0;
	quint64 result = 0;
	if (col.getColorModel() == colorModelRGB)
	{
		col.getRGB( &R, &G, &B );
		QColor color = QColor(R, G, B);
		color.getCmyk(&C, &M, &Y, &K);
	}
	else if (col.getColorModel() == colorModelCMYK)
	{
		col.getCMYK( &C, &M, &Y, &K );
		R = 255-qMin(255, C + K);
		G = 255-qMin(255, M + K);
		B = 255-qMin(255, Y + K);
	}
	else
	{
		double L, a, b;
		col.getLab(&L, &a, &b);
		R = qRound(L);
		G = qRound(a);
		B = qRound(b);
	}
	result |= col.getColorModel() == colorModelRGB ? 1 : 0;
	result |= col.isSpotColor() ? 64 : 0;
	result |= col.isRegistrationColor() ? 32 : 0;
	result <<= 8;
	result |= C;
	result <<= 8;
	result |= M;
	result <<= 8;
	result |= Y;
	result <<= 8;
	result |= K;
	result <<= 8;
	result |= R;
	result <<= 8;
	result |= G;
	result <<= 8;
	result |= B;
	return result;
}
开发者ID:QuLogic,项目名称:ScribusCTL,代码行数:50,代码来源:util_color.cpp

示例3:

static quint64 code64(const ScColor & col) {
	int C, M, Y, K, R, G, B;
	quint64 result=0;
	col.getRGB( &R, &G, &B );
	col.getCMYK( &C, &M, &Y, &K );
	result |= col.getColorModel() == colorModelRGB ? 1 : 0;
	result |= col.isSpotColor() ? 64 : 0;
	result |= col.isRegistrationColor() ? 32 : 0;
	result <<= 8;
	result |= C;
	result <<= 8;
	result |= M;
	result <<= 8;
	result |= Y;
	result <<= 8;
	result |= K;
	result <<= 8;
	result |= R;
	result <<= 8;
	result |= G;
	result <<= 8;
	result |= B;
	return result;
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:24,代码来源:util_color.cpp


注:本文中的ScColor::getCMYK方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。