[Openicc] Linux CM ideology... Print preview

Hal V. Engel hvengel at gmail.com
Mon Feb 7 13:29:50 PST 2011


On Monday, February 07, 2011 11:10:59 AM Kai-Uwe Behrmann wrote:
> Am 07.02.11, 10:58 -0800 schrieb Hal V. Engel:
> > On Monday, February 07, 2011 06:46:21 AM Leonard Rosenthol wrote:
> >> On Mon, Feb 7, 2011 at 9:00 AM, Kai-Uwe Behrmann <ku.b at gmx.de> wrote:
> >>> Am 07.02.11, 08:52 -0500 schrieb Leonard Rosenthol:
> >>>  On Sun, Feb 6, 2011 at 2:32 PM, Jan-Peter Homann
> >>>  
> >>>> <homann at colormanagement.de>wrote:
> >>>>  As the printer profile is only defined through choosing the
> >>>>  media-setting
> >>>>  
> >>>>> in the printing UI, a print preview is best implemented as function
> >>>>> of the
> >>>>> print UI (and not of an application creating complex PDF files)
> >>>>> 
> >>>>>  But how would the print UI get the "data" to be able to
> >>>>>  present/preview
> >>>> 
> >>>> it?
> >>>> Who generates the data?  In what format? With what color settings?
> >>> 
> >>> The print data is to be printed by the UI (CPD). A preview is already
> >>> there, just without any colour management at the moment.
> > 
> > Poppler currently does not have all of the hooks it needs in the Qt4 or
> > GTK interface code to handle creating color managed rasters.  I created
> > a patch set to implement these hooks as well as updating the Qt4 example
> > app to support CM for the display device about a year ago for the Qt4
> > wrapper.  But the patches never made it into the main code base.  The
> > code needed to put these hooks in place is fairly simple as these things
> > go (most of my code ended up in the example app) so I am not sure why
> > this has not been done yet.
> 
> Can you please forward us a link to this code to collect it in ColourWiki:
> http://www.oyranos.org/wiki/index.php?title=Device_Settings#Printing
> 
> kind regards
> Kai-Uwe Behrmann

I sent the patches to the popper developers email list back then.  So I did 
some searching to see what I could find.  It turns out that at least some of my 
code for the Qt4 wrapper actually made it into poppler about 6 months after I 
submitted the patch but I don't see where anyone did something similar for the 
GTK wrapper.  So the Qt4 hooks have been in place since poppler-0.13 or 0.14 
but the qt4 demo app was never updated with my patch or similar code.  Also 
the CM work on the Qt4 wrapper was based on my code but has some differences.

I have the original patch that I created and I will attach it to this email.  
The patches to the Qt4 wrapper involve about 82 lines that were 
added/changed/deleted including comments.  So this was not a big change to the 
orginal code and it mostly invloved exposing the CM functionality in the base 
libraries in the Qt4 interface. 

The Qt4 viewer patch is bigger as it inserts/changes/deletes about 259 lines 
of code.  The qt4 viewer patch was intended to work on X11, Windows and OS/X 
(IE. get the correct monitor profile using system calls and so on) but the 
Windows and OS/X code had not been tested although it should have been close 
to correct since it was based on similar code in LProf and wine but there may 
be some details that need to be sorted out.  If you strip out the Windows and 
OS/X code the qt4 viewer patch would likely be about half the size of the qt4 
viewer parts of this patch.

Also this was written in a very basic way.  On X11 it bassically works like 
this.

1. It first askes the system what monitor it is displayed on and then uses that 
information to retrieve the ICC_PROFILE atom for that monitor.

2. It makes the calls to poppler to setup the display profile.

3. It asks the poppler back end to rendor the document.

4. It displays the rendered (IE. color managed) document.

As you can see it does not handle cases where the document is displayed 
spanning more than one monitor.  It also does not handle the case where the 
document window is moved between displays.

The patch is against poppler-0.12 so it likely will not apply to the current 
version of poppler.  In addition I think at this point that the only part of 
this that is of interest are the qt4 viewer patches.

Hal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/openicc/attachments/20110207/21768f7e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poppler-CM.patch
Type: text/x-patch
Size: 26556 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/openicc/attachments/20110207/21768f7e/attachment-0001.bin>


More information about the openicc mailing list