mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Soft proofing bugfixing
This commit is contained in:
@ -537,7 +537,11 @@ void PDFLittleCMS::init()
|
|||||||
m_profiles[SoftProofing] = createProfile(m_settings.softProofingProfile, m_manager->getCMYKProfiles());
|
m_profiles[SoftProofing] = createProfile(m_settings.softProofingProfile, m_manager->getCMYKProfiles());
|
||||||
m_profiles[XYZ] = cmsCreateXYZProfile();
|
m_profiles[XYZ] = cmsCreateXYZProfile();
|
||||||
|
|
||||||
cmsUInt16Number alarmCodes[cmsMAXCHANNELS] = { 0xFFFF };
|
cmsUInt16Number outOfGamutR = m_settings.outOfGamutColor.redF() * 0xFFFF;
|
||||||
|
cmsUInt16Number outOfGamutG = m_settings.outOfGamutColor.greenF() * 0xFFFF;
|
||||||
|
cmsUInt16Number outOfGamutB = m_settings.outOfGamutColor.blueF() * 0xFFFF;
|
||||||
|
|
||||||
|
cmsUInt16Number alarmCodes[cmsMAXCHANNELS] = { outOfGamutR, outOfGamutG, outOfGamutB };
|
||||||
cmsSetAlarmCodes(alarmCodes);
|
cmsSetAlarmCodes(alarmCodes);
|
||||||
|
|
||||||
if (m_settings.isWhitePaperColorTransformed)
|
if (m_settings.isWhitePaperColorTransformed)
|
||||||
|
@ -65,6 +65,7 @@ struct PDFCMSSettings
|
|||||||
bool isWhitePaperColorTransformed = false;
|
bool isWhitePaperColorTransformed = false;
|
||||||
bool isGamutChecking = false;
|
bool isGamutChecking = false;
|
||||||
bool isSoftProofing = false;
|
bool isSoftProofing = false;
|
||||||
|
QColor outOfGamutColor = Qt::red; ///< Color, which marks out-of-gamut when soft-proofing is proceeded
|
||||||
QString outputCS; ///< Output (rendering) color space
|
QString outputCS; ///< Output (rendering) color space
|
||||||
QString deviceGray; ///< Identifiers for color space (device gray)
|
QString deviceGray; ///< Identifiers for color space (device gray)
|
||||||
QString deviceRGB; ///< Identifiers for color space (device RGB)
|
QString deviceRGB; ///< Identifiers for color space (device RGB)
|
||||||
|
@ -515,6 +515,7 @@ void PDFProgramController::initialize(Features features,
|
|||||||
connect(m_pdfWidget->getDrawWidgetProxy(), &pdf::PDFDrawWidgetProxy::pageLayoutChanged, this, &PDFProgramController::onPageLayoutChanged);
|
connect(m_pdfWidget->getDrawWidgetProxy(), &pdf::PDFDrawWidgetProxy::pageLayoutChanged, this, &PDFProgramController::onPageLayoutChanged);
|
||||||
connect(m_pdfWidget, &pdf::PDFWidget::pageRenderingErrorsChanged, this, &PDFProgramController::onPageRenderingErrorsChanged, Qt::QueuedConnection);
|
connect(m_pdfWidget, &pdf::PDFWidget::pageRenderingErrorsChanged, this, &PDFProgramController::onPageRenderingErrorsChanged, Qt::QueuedConnection);
|
||||||
connect(m_settings, &PDFViewerSettings::settingsChanged, this, &PDFProgramController::onViewerSettingsChanged);
|
connect(m_settings, &PDFViewerSettings::settingsChanged, this, &PDFProgramController::onViewerSettingsChanged);
|
||||||
|
connect(m_CMSManager, &pdf::PDFCMSManager::colorManagementSystemChanged, this, &PDFProgramController::onColorManagementSystemChanged);
|
||||||
|
|
||||||
if (features.testFlag(TextToSpeech))
|
if (features.testFlag(TextToSpeech))
|
||||||
{
|
{
|
||||||
@ -1341,7 +1342,6 @@ void PDFProgramController::updateActionsAvailability()
|
|||||||
updateUndoRedoActions();
|
updateUndoRedoActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PDFProgramController::onViewerSettingsChanged()
|
void PDFProgramController::onViewerSettingsChanged()
|
||||||
{
|
{
|
||||||
m_pdfWidget->updateRenderer(m_settings->getRendererEngine(), m_settings->isMultisampleAntialiasingEnabled() ? m_settings->getRendererSamples() : -1);
|
m_pdfWidget->updateRenderer(m_settings->getRendererEngine(), m_settings->isMultisampleAntialiasingEnabled() ? m_settings->getRendererSamples() : -1);
|
||||||
@ -1357,6 +1357,11 @@ void PDFProgramController::onViewerSettingsChanged()
|
|||||||
updateRenderingOptionActions();
|
updateRenderingOptionActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PDFProgramController::onColorManagementSystemChanged()
|
||||||
|
{
|
||||||
|
m_settings->setColorManagementSystemSettings(m_CMSManager->getSettings());
|
||||||
|
}
|
||||||
|
|
||||||
void PDFProgramController::updateFileInfo(const QString& fileName)
|
void PDFProgramController::updateFileInfo(const QString& fileName)
|
||||||
{
|
{
|
||||||
QFileInfo fileInfo(fileName);
|
QFileInfo fileInfo(fileName);
|
||||||
|
@ -334,6 +334,7 @@ private:
|
|||||||
void onQueryPasswordRequest(QString* password, bool* ok);
|
void onQueryPasswordRequest(QString* password, bool* ok);
|
||||||
void onPageRenderingErrorsChanged(pdf::PDFInteger pageIndex, int errorsCount);
|
void onPageRenderingErrorsChanged(pdf::PDFInteger pageIndex, int errorsCount);
|
||||||
void onViewerSettingsChanged();
|
void onViewerSettingsChanged();
|
||||||
|
void onColorManagementSystemChanged();
|
||||||
|
|
||||||
void updateMagnifierToolSettings();
|
void updateMagnifierToolSettings();
|
||||||
void updateUndoRedoSettings();
|
void updateUndoRedoSettings();
|
||||||
|
@ -70,6 +70,9 @@ void PDFViewerSettings::readSettings(QSettings& settings, const pdf::PDFCMSSetti
|
|||||||
m_colorManagementSystemSettings.deviceGray = settings.value("deviceGray", defaultCMSSettings.deviceGray).toString();
|
m_colorManagementSystemSettings.deviceGray = settings.value("deviceGray", defaultCMSSettings.deviceGray).toString();
|
||||||
m_colorManagementSystemSettings.deviceRGB = settings.value("deviceRGB", defaultCMSSettings.deviceRGB).toString();
|
m_colorManagementSystemSettings.deviceRGB = settings.value("deviceRGB", defaultCMSSettings.deviceRGB).toString();
|
||||||
m_colorManagementSystemSettings.deviceCMYK = settings.value("deviceCMYK", defaultCMSSettings.deviceCMYK).toString();
|
m_colorManagementSystemSettings.deviceCMYK = settings.value("deviceCMYK", defaultCMSSettings.deviceCMYK).toString();
|
||||||
|
m_colorManagementSystemSettings.softProofingProfile = settings.value("softProofingProfile", defaultCMSSettings.softProofingProfile).toString();
|
||||||
|
m_colorManagementSystemSettings.proofingIntent = static_cast<pdf::RenderingIntent>(settings.value("proofingIntent", int(defaultCMSSettings.proofingIntent)).toInt());
|
||||||
|
m_colorManagementSystemSettings.outOfGamutColor = settings.value("outOfGamutColor", defaultCMSSettings.outOfGamutColor).value<QColor>();
|
||||||
m_colorManagementSystemSettings.profileDirectory = settings.value("profileDirectory", defaultCMSSettings.profileDirectory).toString();
|
m_colorManagementSystemSettings.profileDirectory = settings.value("profileDirectory", defaultCMSSettings.profileDirectory).toString();
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
@ -131,6 +134,9 @@ void PDFViewerSettings::writeSettings(QSettings& settings)
|
|||||||
settings.setValue("deviceGray", m_colorManagementSystemSettings.deviceGray);
|
settings.setValue("deviceGray", m_colorManagementSystemSettings.deviceGray);
|
||||||
settings.setValue("deviceRGB", m_colorManagementSystemSettings.deviceRGB);
|
settings.setValue("deviceRGB", m_colorManagementSystemSettings.deviceRGB);
|
||||||
settings.setValue("deviceCMYK", m_colorManagementSystemSettings.deviceCMYK);
|
settings.setValue("deviceCMYK", m_colorManagementSystemSettings.deviceCMYK);
|
||||||
|
settings.setValue("softProofingProfile", m_colorManagementSystemSettings.softProofingProfile);
|
||||||
|
settings.setValue("proofingIntent", int(m_colorManagementSystemSettings.proofingIntent));
|
||||||
|
settings.setValue("outOfGamutColor", m_colorManagementSystemSettings.outOfGamutColor);
|
||||||
settings.setValue("profileDirectory", m_colorManagementSystemSettings.profileDirectory);
|
settings.setValue("profileDirectory", m_colorManagementSystemSettings.profileDirectory);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@ SettingsDialog::SettingsDialog(QWidget* parent, const pdf::PDFCMSSettings& setti
|
|||||||
|
|
||||||
ui->cmsProofingIntentComboBox->setCurrentIndex(ui->cmsProofingIntentComboBox->findData(int(m_settings.proofingIntent)));
|
ui->cmsProofingIntentComboBox->setCurrentIndex(ui->cmsProofingIntentComboBox->findData(int(m_settings.proofingIntent)));
|
||||||
ui->cmsProofingColorProfileComboBox->setCurrentIndex(ui->cmsProofingColorProfileComboBox->findData(m_settings.softProofingProfile));
|
ui->cmsProofingColorProfileComboBox->setCurrentIndex(ui->cmsProofingColorProfileComboBox->findData(m_settings.softProofingProfile));
|
||||||
|
ui->outOfGamutColorEdit->setText(m_settings.outOfGamutColor.name(QColor::HexRgb));
|
||||||
|
|
||||||
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(320, 160)));
|
setMinimumSize(pdf::PDFWidgetUtils::scaleDPI(this, QSize(320, 160)));
|
||||||
}
|
}
|
||||||
@ -53,6 +54,11 @@ void SettingsDialog::accept()
|
|||||||
{
|
{
|
||||||
m_settings.proofingIntent = static_cast<pdf::RenderingIntent>(ui->cmsProofingIntentComboBox->currentData().toInt());
|
m_settings.proofingIntent = static_cast<pdf::RenderingIntent>(ui->cmsProofingIntentComboBox->currentData().toInt());
|
||||||
m_settings.softProofingProfile = ui->cmsProofingColorProfileComboBox->currentData().toString();
|
m_settings.softProofingProfile = ui->cmsProofingColorProfileComboBox->currentData().toString();
|
||||||
|
m_settings.outOfGamutColor.setNamedColor(ui->outOfGamutColorEdit->text());
|
||||||
|
if (!m_settings.outOfGamutColor.isValid())
|
||||||
|
{
|
||||||
|
m_settings.outOfGamutColor = Qt::red;
|
||||||
|
}
|
||||||
|
|
||||||
QDialog::accept();
|
QDialog::accept();
|
||||||
}
|
}
|
||||||
|
@ -20,27 +20,7 @@
|
|||||||
<string>Soft Proofing Settings</string>
|
<string>Soft Proofing Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="1" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="cmsOutputProfileLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Proofing profile</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="cmsProofingColorProfileComboBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="cmsProofingIntentLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Proofing intent</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="cmsProofingIntentComboBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
@ -53,6 +33,36 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="cmsProofingIntentLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Proofing intent</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QComboBox" name="cmsProofingIntentComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="cmsOutputProfileLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Proofing profile</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QComboBox" name="cmsProofingColorProfileComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="outOfGamutColorLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Alarm color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QLineEdit" name="outOfGamutColorEdit"/>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user