Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Full-screen post-processing effects/Accessibility #947
This is an experiment to see if post-processing drawing operations can have useful applications, especially regarding accessibility for visual impairments. The user-facing changes is a new "Accessibility" menu with two sample effects so far:
The magnification can be controlled by hitting Shift then a digit between 1 and 9 to zoom on another quadrant, but I'll gladly take suggestions on how to change this for something less clunky.
Under the hood, the NumWorks calculator doesn't have the RAM for a conventional approach to full-screen post-processing, so this uses fairly intricate bijective* transformations of low-level graphical primitives to compute effects on the fly. The net result is that post-processing effects can be linked into a pipeline that goes both ways in order for blending effects to work (their quality will depend on how lossless the transformations are) with hopefully acceptable run-time characteristics.
The reason I went with this approach is that it is completely transparent for the firmware. Adding effects requires implementing two-way transformation algorithms in a class, adding the hook for the pipeline and creating the UI for it. Effects can be disabled in some screens if needed, like the graphical output of a Python program or magnifying the main menu. It is also platform-agnostic, unlike previous inverted color mode implementations, so it should work everywhere and not just the device. I haven't tested on anything but the simulator though.
This is not finished or perfect (I haven't implemented reverse transformation of magnification yet and I'm having trouble bending escher to my will for example), but this should give an idea whether or not this is a viable approach. It won't solve all possible accessibility issues, however I believe it's a step on the right direction. Other possible filters are colorblind modes and global/per-channel gamma correction for example, but since I'm no accessibility expert I don't know what can or should be implemented nor how.
In short, it's cheap to implement, doesn't clash with the rest of the firmware, works on any platform and has no performance penalty if no effects are activated.
*Not quite exactly, but let's not get bogged down in semantics.
I've implemented per-channel gamma correction. This is useful for several accessibility use cases (at least in theory), from colorblindness to boosting contrast (and happens to be also suitable as a makeshift night mode).