本文整理汇总了C++中KoColor::opacityF方法的典型用法代码示例。如果您正苦于以下问题:C++ KoColor::opacityF方法的具体用法?C++ KoColor::opacityF怎么用?C++ KoColor::opacityF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoColor
的用法示例。
在下文中一共展示了KoColor::opacityF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateValues
void KoUniColorChooser::updateValues()
{
KoColor tmpColor;
m_HIn->blockSignals(true);
m_SIn->blockSignals(true);
m_VIn->blockSignals(true);
m_RIn->blockSignals(true);
m_GIn->blockSignals(true);
m_BIn->blockSignals(true);
if (cmykColorSpace()) {
m_CIn->blockSignals(true);
m_MIn->blockSignals(true);
m_YIn->blockSignals(true);
m_KIn->blockSignals(true);
}
m_LIn->blockSignals(true);
m_aIn->blockSignals(true);
m_bIn->blockSignals(true);
/*
KoOldColor color = m_fgColor;
int h = color.H();
int s = color.S();
int v = color.V();
m_HIn->setValue(h);
m_SIn->setValue(s);
m_VIn->setValue(v);
*/
tmpColor = m_currentColor;
tmpColor.convertTo(rgbColorSpace());
m_RIn->setValue(tmpColor.data()[2]);
m_GIn->setValue(tmpColor.data()[1]);
m_BIn->setValue(tmpColor.data()[0]);
if(m_showOpacitySlider)
{
m_opacitySlider->blockSignals(true);
m_opacityIn->blockSignals(true);
KoColor minColor = tmpColor;
tmpColor.colorSpace()->setOpacity(minColor.data(), OPACITY_TRANSPARENT_U8, 1);
KoColor maxColor = tmpColor;
tmpColor.colorSpace()->setOpacity(maxColor.data(), OPACITY_OPAQUE_U8, 1);
m_opacitySlider->setColors(minColor, maxColor);
m_opacitySlider->setValue(tmpColor.opacityF() * 100 );
m_opacityIn->setValue(tmpColor.opacityF() * 100 );
m_opacityIn->blockSignals(false);
m_opacitySlider->blockSignals(false);
}
tmpColor = m_currentColor;
tmpColor.convertTo(labColorSpace());
m_LIn->setValue(((quint16 *)tmpColor.data())[0]/(256*256/100));
m_aIn->setValue(((quint16 *)tmpColor.data())[1]/256);
m_bIn->setValue(((quint16 *)tmpColor.data())[2]/256);
if ( cmykColorSpace() ) {
tmpColor = m_currentColor;
tmpColor.convertTo(cmykColorSpace());
m_CIn->setValue((tmpColor.data()[0]*100)/255);
m_MIn->setValue((tmpColor.data()[1]*100/255));
m_YIn->setValue((tmpColor.data()[2]*100)/255);
m_KIn->setValue((tmpColor.data()[3]*100)/255);
}
m_HIn->blockSignals(false);
m_SIn->blockSignals(false);
m_VIn->blockSignals(false);
m_RIn->blockSignals(false);
m_GIn->blockSignals(false);
m_BIn->blockSignals(false);
if (cmykColorSpace()) {
m_CIn->blockSignals(false);
m_MIn->blockSignals(false);
m_YIn->blockSignals(false);
m_KIn->blockSignals(false);
}
m_LIn->blockSignals(false);
m_aIn->blockSignals(false);
m_bIn->blockSignals(false);
}