本文整理汇总了C++中ScColorProfile::engine方法的典型用法代码示例。如果您正苦于以下问题:C++ ScColorProfile::engine方法的具体用法?C++ ScColorProfile::engine怎么用?C++ ScColorProfile::engine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScColorProfile
的用法示例。
在下文中一共展示了ScColorProfile::engine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createProofingTransform
ScColorTransform ScLcmsColorMgmtEngineImpl::createProofingTransform(ScColorMgmtEngine& engine,
const ScColorProfile& inputProfile , eColorFormat inputFormat,
const ScColorProfile& outputProfile, eColorFormat outputFormat,
const ScColorProfile& proofProfile , eRenderIntent renderIntent,
eRenderIntent proofingIntent, long transformFlags)
{
ScColorTransform transform(NULL);
if (inputProfile.isNull() || outputProfile.isNull())
return transform;
int inputProfEngineID = inputProfile.engine().engineID();
int outputProfEngineID = outputProfile.engine().engineID();
int proofProfEngineID = proofProfile.engine().engineID();
if ((engine.engineID() != m_engineID) || (inputProfEngineID != m_engineID) ||
(outputProfEngineID != m_engineID) || (proofProfEngineID != m_engineID))
return transform;
const ScLcmsColorProfileImpl* lcmsInputProf = dynamic_cast<const ScLcmsColorProfileImpl*>(inputProfile.data());
const ScLcmsColorProfileImpl* lcmsOutputProf = dynamic_cast<const ScLcmsColorProfileImpl*>(outputProfile.data());
const ScLcmsColorProfileImpl* lcmsProofingProf = dynamic_cast<const ScLcmsColorProfileImpl*>(proofProfile.data());
if (!lcmsInputProf || !lcmsOutputProf || !lcmsProofingProf)
return transform;
long strategyFlags = 0;
if (m_strategy.useBlackPointCompensation)
strategyFlags |= Ctf_BlackPointCompensation;
if (m_strategy.useBlackPreservation)
strategyFlags |= Ctf_BlackPreservation;
ScColorTransformInfo transInfo;
transInfo.inputProfile = inputProfile.productDescription();
transInfo.outputProfile = outputProfile.productDescription();
transInfo.proofingProfile = proofProfile.productDescription();
transInfo.inputFormat = inputFormat;
transInfo.outputFormat = outputFormat;
transInfo.renderIntent = renderIntent;
transInfo.proofingIntent = proofingIntent;
transInfo.flags = transformFlags | strategyFlags;
DWORD lcmsFlags = translateFlagsToLcmsFlags(transformFlags | strategyFlags);
DWORD lcmsInputFmt = translateFormatToLcmsFormat(inputFormat);
DWORD lcmsOutputFmt = translateFormatToLcmsFormat(outputFormat);
int lcmsIntent = translateIntentToLcmsIntent(renderIntent);
int lcmsPrfIntent = translateIntentToLcmsIntent(proofingIntent);
if (transInfo.inputProfile != transInfo.proofingProfile)
{
if (transInfo.proofingProfile == transInfo.outputProfile)
{
transInfo.proofingIntent = Intent_Relative_Colorimetric;
lcmsPrfIntent = translateIntentToLcmsIntent(Intent_Relative_Colorimetric);
}
transform = m_transformPool->findTransform(transInfo);
if (transform.isNull())
{
cmsSetErrorHandler(&cmsErrorHandler);
cmsHTRANSFORM hTransform = NULL;
try
{
hTransform = cmsCreateProofingTransform(lcmsInputProf->m_profileHandle , lcmsInputFmt,
lcmsOutputProf->m_profileHandle, lcmsOutputFmt,
lcmsProofingProf->m_profileHandle, lcmsIntent,
lcmsPrfIntent, lcmsFlags | cmsFLAGS_SOFTPROOFING);
if (hTransform)
{
ScLcmsColorTransformImpl* newTrans = new ScLcmsColorTransformImpl(engine, hTransform);
newTrans->setTransformInfo(transInfo);
transform = ScColorTransform(dynamic_cast<ScColorTransformData*>(newTrans));
m_transformPool->addTransform(transform, true);
}
}
catch (lcmsException& e)
{
std::cerr << e.what() << std::endl;
// #9922 : no idea why that crash in release mode
/*if (transform.isNull() && hTransform)
cmsDeleteTransform(hTransform);*/
transform = ScColorTransform();
}
cmsSetErrorHandler(NULL);
}
}
else
{
transformFlags &= (~Ctf_Softproofing);
transformFlags &= (~Ctf_GamutCheck);
lcmsFlags = translateFlagsToLcmsFlags(transformFlags | strategyFlags);
transInfo.flags = transformFlags | strategyFlags;
transInfo.renderIntent = proofingIntent;
transInfo.proofingIntent = (eRenderIntent) 0;
if (transInfo.inputProfile == transInfo.outputProfile)
{
lcmsFlags |= cmsFLAGS_NULLTRANSFORM;
transInfo.inputProfile = QString();
transInfo.outputProfile = QString();
transInfo.proofingProfile = QString();
transInfo.renderIntent = (eRenderIntent) 0;
transInfo.proofingIntent = (eRenderIntent) 0;
transInfo.flags = 0;
}
transform = m_transformPool->findTransform(transInfo);
if (transform.isNull())
//.........这里部分代码省略.........
示例2: transform
ScColorTransform ScLcms2ColorMgmtEngineImpl::createTransform(ScColorMgmtEngine& engine,
const ScColorProfile& inputProfile , eColorFormat inputFormat,
const ScColorProfile& outputProfile, eColorFormat outputFormat,
eRenderIntent renderIntent, long transformFlags)
{
ScColorTransform transform(NULL);
if (inputProfile.isNull() || outputProfile.isNull())
return transform;
int inputProfEngineID = inputProfile.engine().engineID();
int outputProfEngineID = outputProfile.engine().engineID();
if ((engine.engineID() != m_engineID) || (inputProfEngineID != m_engineID) || (outputProfEngineID != m_engineID))
return transform;
const ScLcms2ColorProfileImpl* lcmsInputProf = dynamic_cast<const ScLcms2ColorProfileImpl*>(inputProfile.data());
const ScLcms2ColorProfileImpl* lcmsOutputProf = dynamic_cast<const ScLcms2ColorProfileImpl*>(outputProfile.data());
if (!lcmsInputProf || !lcmsOutputProf)
return transform;
transformFlags &= (~Ctf_Softproofing);
transformFlags &= (~Ctf_GamutCheck);
long strategyFlags = 0;
if (m_strategy.useBlackPointCompensation)
strategyFlags |= Ctf_BlackPointCompensation;
if (m_strategy.useBlackPreservation)
strategyFlags |= Ctf_BlackPreservation;
ScColorTransformInfo transInfo;
transInfo.inputProfile = inputProfile.productDescription();
transInfo.outputProfile = outputProfile.productDescription();
transInfo.proofingProfile = QString();
transInfo.inputFormat = inputFormat;
transInfo.outputFormat = outputFormat;
transInfo.renderIntent = renderIntent;
transInfo.proofingIntent = (eRenderIntent) 0;
transInfo.flags = transformFlags | strategyFlags;
bool nullTransform = false;
if (transInfo.inputProfile == transInfo.outputProfile)
{
// This is a null transform
transInfo.inputProfile = QString();
transInfo.outputProfile = QString();
transInfo.proofingProfile = QString();
transInfo.renderIntent = (eRenderIntent) 0;
transInfo.proofingIntent = (eRenderIntent) 0;
transInfo.flags = 0;
nullTransform = true;
}
transform = m_transformPool->findTransform(transInfo);
if (transform.isNull())
{
cmsUInt32Number lcmsFlags = translateFlagsToLcmsFlags(transformFlags | strategyFlags);
cmsUInt32Number lcmsInputFmt = translateFormatToLcmsFormat(inputFormat);
cmsUInt32Number lcmsOutputFmt = translateFormatToLcmsFormat(outputFormat);
int lcmsIntent = translateIntentToLcmsIntent(renderIntent);
if (nullTransform)
lcmsFlags |= cmsFLAGS_NULLTRANSFORM;
cmsHTRANSFORM hTransform = NULL;
hTransform = cmsCreateTransform(lcmsInputProf->m_profileHandle , lcmsInputFmt,
lcmsOutputProf->m_profileHandle, lcmsOutputFmt,
lcmsIntent, lcmsFlags | cmsFLAGS_LOWRESPRECALC);
if (hTransform)
{
ScLcms2ColorTransformImpl* newTrans = new ScLcms2ColorTransformImpl(engine, hTransform);
newTrans->setTransformInfo(transInfo);
transform = ScColorTransform(dynamic_cast<ScColorTransformData*>(newTrans));
m_transformPool->addTransform(transform, true);
}
}
return transform;
}