On Fri, Jul 17, 2015 at 9:01 PM, Lubomir I. Ivanov <neolit...@gmail.com> wrote:
> On 17 July 2015 at 21:54, Gehad Elrobey <gehadelro...@gmail.com> wrote: > > > > > > On Fri, Jul 17, 2015 at 8:46 PM, Lubomir I. Ivanov <neolit...@gmail.com> > > wrote: > > > >> On 17 July 2015 at 21:36, Tomaz Canabrava <tcanabr...@kde.org> wrote: > >> > > >> >>>> I am forces to render the dive profile on a QImage so that I can > >> >>>> convert > >> >>>> it to grayscale image and then render it on top of the QWebview, Do > >> >>>> you > >> >>>> think there is a way to convert the vector graphics to grayscale? > >> >>> > >> >>> > >> >>> > >> >>> graphicsview-common.h:QColor getColor(const color_indice_t i, bool > >> >>> isGrayscale = false); > >> >>> > >> >>> so, 90% of the time we are using getColor without the isGrayscale > >> >>> boolean, triggering the false state. > >> >>> this is where you should do your stuff :) > >> >>> > >> >>> grep getColor inside qt-ui/profile and see where you should change. > >> >>> > >> >>> > >> >> > >> >> I already tried to do this, I also added isGrayscale members in > >> >> DiveProfileItem, but there are some remaining elements that I > couldn't > >> >> change into grayscale (eg. cylinder pressure curve and numbers on > >> >> horizontal/vertical axis) please check the screenshot attached, Am I > >> >> missing > >> >> something? > >> > > >> > > >> > > >> > yes, in a few places we are not using the get color correctly and this > >> > needs > >> > to be fixed: > >> > > >> > tankitem.cpp ( see the setColorAt calls ) > >> > rulerItem.cpp ( check for QColor usage ) > >> > profileWidget.cpp ( check for QColor ) > >> > diveprofileItem.cpp ( check for " // This paints the colors of the > >> > velocities. " ) > >> > > >> > getSacColor also doesn't takes into consideration printMode > >> > > >> > >> thanks Tomaz, > >> i admit that when i saw that profile2 didn't support the greyscale > >> color table, i didn't even bother fixing this. :( > >> > >> Gehad, if we can't find an easy way to preserve everything in vector > >> while in greyscale we may have to use the custom color table for the > >> profile, after all. > >> because having the profile and table in raster because of the > >> greyscale mode is a bit subpar? > >> > > > > The QPrinter::setColorMode() work very nicely it converts the whole > > printouts to grayscale pages without the need to rasterize the page, the > > only drawback is that this doesn't work correctly with the > > QPrintPreviewDialog which I think we may use the css filter way to work > > around this issue - we will not have identical previewing and printing > > methods though , what do you think? > > > > well, does setColorMode() preserve at least the vector graphics of the > hard-copy - for both the table and profile? > Yes it does, you can test it on current master. -- regards, Gehad
_______________________________________________ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface