[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/tools

Francisco J. Cruz fj.cruz at supercable.es
Sun Feb 5 23:10:31 GMT 2006


SVN commit 506182 by fjcruz:

Color Management to print images from IE is operative. For anybody who test it: remember that  you have to avoid any color correction that printer drivers could make on the image (via "preferences" button on print dialog).
Please, test and comment.

CCMAIL:digikam-devel at kde.org

 M  +23 -10    imageprint.cpp  
 M  +5 -2      imageprint.h  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/tools/imageprint.cpp #506181:506182
@@ -66,8 +66,7 @@
 
 #include "imageprint.h"
 #include "editorwindow.h"
-// #include "setup.h"
-// #include "setupicc.h"
+#include "icctransform.h"
 
 
 namespace Digikam
@@ -175,6 +174,7 @@
     opts["app-imageeditor-scale-width"] = QString::number( m_width->value() );
     opts["app-imageeditor-scale-height"] = QString::number( m_height->value() );
     opts["app-imageeditor-auto-rotate"] = m_autoRotate->isChecked() ? t : f;
+    opts["app-imageeditor-color-managed"] = m_colorManaged->isChecked() ? t : f;
 }
 
 
@@ -192,6 +192,8 @@
     m_scale->setChecked( opts["app-imageeditor-scale"] == t );
     m_autoRotate->setChecked( opts["app-imageeditor-auto-rotate"] == t );
 
+    m_colorManaged->setChecked( false );
+
     m_units->setCurrentItem( opts["app-imageeditor-scale-unit"] );
 
     bool   ok;
@@ -228,18 +230,10 @@
     config->setGroup("Color Management");
 
     m_cmEnabled = config->readBoolEntry("EnableCM", false);
-    m_inProfilePath = config->readPathEntry("InProfileFile");
-    m_outpuProfilePath = config->readPathEntry("ProofProfileFile");
 }
 
 void ImageEditorPrintDialogPage::slotSetupDlg()
 {
-   ///TODO implement me
-// //    Setup setup(this, 0, Setup::Icc);
-// //     
-// //     if (setup.exec() != QDialog::Accepted)
-// //         return;
-
     EditorWindow* editor = dynamic_cast<EditorWindow*>(m_parent);
     editor->setup(true);
 }
@@ -279,7 +273,16 @@
 
     // TODO : perform all prepare to print transformations using DImg methods.
     // Paco, we will need to apply printer ICC profile here !
+    if (m_printer.option( "app-imageeditor-color-managed") != f)
+    {
+        IccTransform *transform = new IccTransform();
+        readSettings();
 
+        transform->setProfiles( m_inProfilePath, m_outputProfilePath );
+        transform->apply( m_image );
+    }
+    
+    
     QImage image2Print = m_image.copyQImage();
 
     // Black & white print ?
@@ -435,6 +438,16 @@
     return text;
 }
 
+void ImagePrint::readSettings()
+{
+     KConfig* config = kapp->config();
+
+    config->setGroup("Color Management");
+
+    m_inProfilePath = config->readPathEntry("InProfileFile");
+    m_outputProfilePath = config->readPathEntry("ProofProfileFile");
+}
+
 }  // namespace Digikam
 
 #include "imageprint.moc"
--- trunk/extragear/graphics/digikam/utilities/imageeditor/tools/imageprint.h #506181:506182
@@ -60,11 +60,15 @@
 
     QString minimizeString( QString text, const QFontMetrics& metrics,
                             int maxWidth );
+    void readSettings();
+    
 private:
 
     DImg          m_image;
     KPrinter&     m_printer;
     QString       m_filename;
+    QString       m_inProfilePath;
+    QString       m_outputProfilePath;
 
 };
 
@@ -101,8 +105,7 @@
     QCheckBox       *m_autoRotate;
     QCheckBox       *m_colorManaged;
     QPushButton     *m_cmPreferences;
-    QString          m_inProfilePath;
-    QString          m_outpuProfilePath;
+
     bool             m_cmEnabled;
 
     QWidget         *m_parent;



More information about the Digikam-devel mailing list