D28695: Addition of Invert Plus Hue functionality to the Invert effect plugin

Javier Cordero noreply at phabricator.kde.org
Thu Apr 9 08:44:29 BST 2020


cuperino created this revision.
cuperino added a reviewer: kwin.
Herald added a project: KWin.
cuperino requested review of this revision.

REVISION SUMMARY
  People who use assistive technologies to invert screen colors usually use them for various reasons...
  
  - An attempt to get rid of the screen's brightness. Useful when bright colors cause headaches.
  - An attempt to add brightness. Bright backgrounds allow eyes to focus better.
  - To see details present in dark shades of similar colors without having to increase the display's brightness.
  - To compensate from using a dark theme in direct sunlight
  
  Some of these issues are addressed by the use of dark and light themes, but there are applications that don't yet or may never support both themes. These are some of the use cases where plugins such as KWin's Invert effect come in. Unfortunately, inverting colors comes with a disadvantage dark themes do not have. When inverting colors not only the brightness but the hue becomes opposite of the original image, giving an alien look to things and making them harder to recognize.
  
  A solution to this problem is to displace the hue by 180 degrees before or after the color invert. This revision of the Invert plugin does that by adding two new keyboard shortcuts to the Invert plugin:
  
  - Ctrl-Super-H runs a new Invert Plus Hue shader over the entire screen
  - Ctrl-Super-G adds the active window to the list of windows to be inverted with the Invert Plus Hue shader
  
  The logic behind the new feature is the same as the original Invert functionality, which uses Ctrl-Super-I and Ctrl-Super-U for a traditional invert. When the screen is inverted, windows in the list of windows to be inverted are treated as windows to not be inverted, thus preventing the same shader from being applied twice, wasting GPU cycles. This implementation takes this one step further, allowing the user to toggle between the classic Invert feature and the new Invert Plus Hue. When the user toggles between inverts, the previous invert is removed before the other sets in, preventing any invert shaders from being applied twice.

TEST PLAN
  Existing tests related to effect plugins pass. Code was thoroughly tested before commits, all possible plugin state combinations work correctly.

REPOSITORY
  R108 KWin

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D28695

AFFECTED FILES
  effects/invert/data/1.10/invert-plus-hue.frag
  effects/invert/data/1.10/invert.frag
  effects/invert/data/1.40/invert-plus-hue.frag
  effects/invert/data/1.40/invert.frag
  effects/invert/invert.cpp
  effects/invert/invert.h
  effects/invert/invert_config.cpp
  effects/shaders.qrc

To: cuperino, kwin
Cc: cuperino, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200409/d3ff9656/attachment-0001.html>


More information about the kwin mailing list