Complete this task as part of your GSoC application if you are applying for the AXIOM Remote related task.
This challenge is mandatory if you apply for T1126
Please follow the tasks closely and make sure to adhere to the C++ coding style (see links section for reference).
Note that this code is being run on an a microcontroller with limited resources inside the AXIOM Remote (https://wiki.apertus.org/index.php/AXIOM_Remote/Hardware#PCB_Version_0.9). This microcontroller is a PIC32MZ2048ECG100, 200Mhz 32 bit CPU, this software runs on it bare-metal (https://en.wikipedia.org/wiki/Bare_machine).
To allow you to run the software on a "virtual" AXIOM Remote hardware we create the AXIOM Remote Visualizer (https://github.com/apertus-open-source-cinema/AXIOM-Remote/tree/dev/AXIOM_Remote_Firmware_Visualizer).
Goal
As addition to the 1 bit images/icon drawing which is basically limited to black/white or monochrome icons (https://github.com/apertus-open-source-cinema/AXIOM-Remote/blob/dev/Firmware/UI/Painter/Painter.cpp#L314) this challenge adds very soft antialiasing to images by using 2 bits and therefore 4 colors with a predefined palette (colors: transparent, light grey, dark grey, black).
This basically means we want to implement simplified anti-aliasing image drawing:
Step 1: Preparations
- Check out the source code of AXIOM Remote
- Important: Don't forget to initialize git sub-modules in the repo, otherwise ImGui errors will occur
- Look through general source code and especially Firmware project and learn the structure
- Build the visualizer (AXIOM_Remote_Firmware_Visualizer) and play a bit with a firmware to understand it more
- Ask questions either here or on our IRC channel //(please use a dedicated client instead of web interface, to prevent regular disconnects)
Visualizer output:
Step 2: Create a 2 bit image as C array
There are several ways how to create the required image file c array, verify if this suggested method to create/convert images is suitable if not or there is there a better way please document this way.
- Create a new icon with e.g Gimp that uses an indexed color mode with 4 colors (you can draw something yourself or use one of the icon SVGs already used in the AXIOM Remote: https://github.com/apertus-open-source-cinema/AXIOM-Remote/tree/dev/Firmware/Media/Icons) and export as -> *.c
- Alternatively create a script based on the current icon creation Makefile (https://github.com/apertus-open-source-cinema/AXIOM-Remote/blob/dev/Firmware/Media/Icons/Makefile) or create a new script (python, etc.) that takes care of this.
- Add the data to the firmware in the proper folder
Step 3: Add Draw2BitIcon() in Painter
- Add Draw2BitIcon() method to the painter
- Draw an example icon on any AXIOM Remote page of your choice (eg. home page), take a screenshot and include it in your challenge solution.
Step 4: Bonus
- Add unit tests for Draw2BitIcon() method to verify that predefined input also deliver correct output, see examples in FirmwareTest folder, it already contains a few painter tests
- Add parameter to the Draw2BitIcon() method to define the color palette and transparency
Useful Links:
- C++ coding guidelines: https://github.com/apertus-open-source-cinema/AXIOM-Remote/blob/dev/CodingGuidelines.md and (isocpp): https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md
To get in touch with any mentor check the Mentor Contact List.