Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly
#34
(07-19-2023, 02:37 AM)WhiteHexagon Wrote: Colors: There is a mysterious difference between the canvas2d and PP, possibly just the red and blue reversed.

Yep the colours for PinePhone vs JavaScript Canvas are swapped, probably ARGB vs RGBA. We should swap the colour bytes here:

https://github.com/lupyuen/pinephone-lvg...js#L41-L50

Code:
// Load the WebAssembly Pointer into a JavaScript Image Data
const imageDataArray = new Uint8Array(memory.buffer, ptr, len)
imageData.data.set(imageDataArray);

// TODO: Swap the Colour Bytes (ARGB vs RGBA)

// Render the Image Data to the HTML Canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.putImageData(imageData, 0, 0);

To use multiple fonts, check out the LVGL Widgets Demo:

https://github.com/lupyuen2/wip-pinephon...#L172-L187
  Reply


Messages In This Thread
RE: Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly - by lupyuen - 07-20-2023, 01:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Movuan distribution for PinePhone merom 5 1,146 07-27-2025, 05:01 PM
Last Post: merom
  baremetal via Zig on PinePhone - JumpDrive help please WhiteHexagon 1 332 07-07-2025, 10:33 AM
Last Post: WhiteHexagon
  Jami on the Pine phone ? bcnaz 8 8,719 06-09-2025, 04:17 PM
Last Post: j_s
  How-To: Remote Control Your Phone from Desktop via VNC biketool 6 2,408 03-05-2025, 06:18 AM
Last Post: Kevin Kofler
  Latest firmware for PinePhone modem! Subsentient 105 176,956 02-02-2025, 08:47 PM
Last Post: bacydentir85
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 40 43,743 12-28-2024, 12:19 AM
Last Post: mara
  Office applications for the Pinephone Peter Gamma 2 1,490 09-05-2024, 09:22 AM
Last Post: Peter Gamma
  Struggle to install LibreOffice on the PinePhone Peter Gamma 50 47,673 07-26-2024, 10:35 PM
Last Post: Peter Gamma
  Why does Pine64 sabotage office on the Pinephone? Peter Gamma 5 2,528 07-04-2024, 07:34 AM
Last Post: Kevin Kofler
  Which word processor to choose for the Pinephone? Peter Gamma 16 9,775 06-22-2024, 07:28 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 3 Guest(s)