Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quantum Painter #10174

Merged
merged 38 commits into from
Apr 13, 2022
Merged

Quantum Painter #10174

merged 38 commits into from
Apr 13, 2022

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Aug 26, 2020

Description

I needed a way to draw to an ILI9341 LCD panel. At the moment, QMK's ability to draw to devices is limited and implemented in bespoke manners, without any sort of abstraction layer in front of them.

This PR attempts to introduce the "Quantum Painter" API, which is intended to be a frontend for display devices, providing a unified API and allowing people to implement a minimal driver implementation to make it compatible with QMK.

Currently working hardware:

  • ILI9163 (128x128)
  • ILI9341 (240x320)
  • ST7789 (240x320, 240x240)
  • GC9A01 (240x240, Circular panel)
  • SSD1351 (128x128 OLED)

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team August 26, 2020 09:37
@tzarc tzarc self-assigned this Aug 26, 2020
@noroadsleft noroadsleft force-pushed the develop branch 2 times, most recently from 1d4c0cd to 65c27a3 Compare August 29, 2020 21:41
@tzarc tzarc force-pushed the quantum-painter branch 3 times, most recently from 6f4043f to 5129e9a Compare October 13, 2020 22:13
@manna-harbour
Copy link
Contributor

I had the same idea of converting images and metadata into separately buildable objects. See https://github.com/manna-harbour/qmk_firmware/blob/crkbd/keyboards/crkbd/keymaps/manna-harbour/readme.org.

In addition I implemented automatic rotation of images based on image and display orientation, and automatic conversion of images. If you're interested in adding those features, it would be nice to have a display orientation property that could be set per board so rotation could be completely automatic, and to integrate automatic conversion into the QMK build system.

@tzarc
Copy link
Member Author

tzarc commented Nov 2, 2020

would be nice to have a display orientation property that could be set per board so rotation could be completely automatic, and to integrate automatic conversion into the QMK build system

Display orientation is already in place, and automated conversion will be done with the CLI. Already in the works, but thanks!

@manna-harbour
Copy link
Contributor

manna-harbour commented Nov 9, 2020

Display orientation is already in place, and automated conversion will be done with the CLI. Already in the works, but thanks!

Great!

For "automatic rotation of images based on image and display orientation" I was referring to this part in particular, so that users don't have to deal with display or image orientation at all:

Portrait images will be displayed in portrait orientation. Landscape images will be displayed with a CCW rotation of 90 degrees on the left and a CW rotation of 90 degrees on the right.

Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my review points!

@tzarc tzarc merged commit 1f2b1de into qmk:develop Apr 13, 2022
@tzarc tzarc deleted the quantum-painter branch April 13, 2022 12:25
0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
* Install dependencies before executing unit tests.

* Split out UTF-8 decoder.

* Fixup python formatting rules.

* Add documentation for QGF/QFF and the RLE format used.

* Add CLI commands for converting images and fonts.

* Add stub rules.mk for QP.

* Add stream type.

* Add base driver and comms interfaces.

* Add support for SPI, SPI+D/C comms drivers.

* Include <qp.h> when enabled.

* Add base support for SPI+D/C+RST panels, as well as concrete implementation of ST7789.

* Add support for GC9A01.

* Add support for ILI9341.

* Add support for ILI9163.

* Add support for SSD1351.

* Implement qp_setpixel, including pixdata buffer management.

* Implement qp_line.

* Implement qp_rect.

* Implement qp_circle.

* Implement qp_ellipse.

* Implement palette interpolation.

* Allow for streams to work with either flash or RAM.

* Image loading.

* Font loading.

* QGF palette loading.

* Progressive decoder of pixel data supporting Raw+RLE, 1-,2-,4-,8-bpp monochrome and palette-based images.

* Image drawing.

* Animations.

* Font rendering.

* Check against 256 colours, dump out the loaded palette if debugging enabled.

* Fix build.

* AVR is not the intended audience.

* `qmk format-c`

* Generation fix.

* First batch of docs.

* More docs and examples.

* Review comments.

* Public API documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants