0

Is there some way to change screen "saturation" ? Make screen in warm colors \ or make it in sepia using c++ && qt on win\mac ?

As a reference modern monitors have such a menu option on changing the screen color or you can also check the app for linux f.lux as a reference ...

The first thing that comes on my mind is to create some transparent " window on top " make a screenshot and play around with rgb ... but it will be not the best solution

2 Answers2

0

There's no Qt API that will help you with that. On either platform you'll have to use native APIs to change the screen color reproduction curves and shift the color temperature to warmer tones. The situation on OS X would be more uniform in that the API to do that either exists on all hardware or on none. On Windows, things might be more complicated. Some undocumented vendor APIs probably exist, used by respective vendor control panels to alter the color temperature. There are also all ways you could hook yourself into the screen compositing pipeline, but this may require writing a driver. Unfortunately, I'm not too familiar with how easy it might be. It'll be probably either very simple or very complicated. There are some simple workarounds, like adding a translucent tinted window on top of everything, but those don't look good.

Community
  • 1
  • 1
Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
  • *"those don't look good"* - That's really the least of your worries. By far most drastic is the fact, that a user can no longer interact with the desktop. – IInspectable Oct 24 '16 at 15:59
  • @IInspectable It is possible to have windows that are transparent to mouse and can't be focused, so that won't be a problem. – Kuba hasn't forgotten Monica Oct 24 '16 at 16:37
  • That requires a **fully** transparent window. You cannot have a translucent window, that is transparent to mouse input. – IInspectable Oct 24 '16 at 16:43
  • @IInspectable At least it's possible, if a bit kludgy, on Windows. I don't know about OS X. – Kuba hasn't forgotten Monica Oct 24 '16 at 16:44
  • I was referring to Windows, and no, you cannot have a translucent window that's transparent to mouse input. You can have a fully transparent window, that is subject to hit-testing, or a fully transparent window, that's also transparent to mouse input. And that's it. – IInspectable Oct 24 '16 at 16:45
  • @IInspectable You can set yourself up as a global mouse hook and throw away hit tests against yours (or any other) window, making it as if it wasn't there, no matter how it looks, IIRC. I've done it a little while ago as a little desktop annoyer that would randomly make random windows transparent to mouse clicks. And there apparently is [a way of doing it even without using hooks](http://stackoverflow.com/questions/2842667/how-to-create-a-semi-transparent-window-in-wpf-that-allows-mouse-events-to-pass). – Kuba hasn't forgotten Monica Oct 24 '16 at 16:56
0

Neither C++ nor Qt facilitate such functionality. It seems for windows it is possible to modify brightness and contrast for the display, but that's about it, no saturation, no colorization.

The "make a screenshot and play around with rgb" will have abysmal performance and a number of other possible complications, such as event handling.

Now, if you want to apply a color filter to your Qt application, Qt has the QGraphicsEffect class, which automatically hooks up with the rendering system, caches the target to an image and applies to desired effect. I am not sure how well will that work for the "transparent window on top" idea.

It only has a few stock effects, but you can easily roll out your own. Then you can use QWidget::setGraphicsEffect(QGraphicsEffect * effect) to apply it to the desired widget or derived.

dtech
  • 47,916
  • 17
  • 112
  • 190