Exemplo n.º 1
0
void SharedLoadingTask::postProcess()
{
    // to receive progress info again. Should be safe now, we are alone.
    addListener(this);

    // ---- Color management ---- //

    switch (m_loadingDescription.postProcessingParameters.colorManagement)
    {
        case LoadingDescription::NoColorConversion:
            break;
        case LoadingDescription::ApplyTransform:
        {
            IccTransform trans = m_loadingDescription.postProcessingParameters.transform();
            trans.apply(m_img, this);
            m_img.setIccProfile(trans.outputProfile());
            break;
        }
        case LoadingDescription::ConvertForEditor:
        {
            IccManager manager(m_img);
            manager.transformDefault();
            break;
        }
        case LoadingDescription::ConvertToSRGB:
        {
            IccManager manager(m_img);
            manager.transformToSRGB();
            break;
        }
        case LoadingDescription::ConvertForDisplay:
        {
            IccManager manager(m_img);
            manager.transformForDisplay(m_loadingDescription.postProcessingParameters.profile());
            break;
        }
        case LoadingDescription::ConvertForOutput:
        {
            IccManager manager(m_img);
            manager.transformForOutput(m_loadingDescription.postProcessingParameters.profile());
            break;
        }
    }

    removeListener(this);
}
Exemplo n.º 2
0
void RawProcessingFilter::filterImage()
{
    m_destImage = m_orgImage;

    // emulate LibRaw custom output profile
    if (!m_customOutputProfile.isNull())
    {
        // Note the m_destImage is not yet ready in load()!
        IccTransform trans;
        trans.setIntent(IccTransform::Perceptual);
        trans.setEmbeddedProfile(m_destImage);
        trans.setOutputProfile(m_customOutputProfile);
        trans.apply(m_orgImage, m_observer);
        m_destImage.setIccProfile(m_customOutputProfile);
    }

    postProgress(20);

    if (!m_settings.wb.isDefault())
    {
        WBFilter wb(m_settings.wb, this, m_orgImage, m_destImage, 20, 40);
    }

    postProgress(40);

    if (!m_settings.bcg.isDefault())
    {
        BCGFilter bcg(m_settings.bcg, this, m_orgImage, m_destImage, 40, 70);
    }

    postProgress(70);

    if (!m_settings.curvesAdjust.isEmpty())
    {
        CurvesFilter curves(m_settings.curvesAdjust, this, m_orgImage, m_destImage, 70, 100);
    }

    postProgress(100);
}