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,150 07-27-2025, 05:01 PM
Last Post: merom
  baremetal via Zig on PinePhone - JumpDrive help please WhiteHexagon 1 333 07-07-2025, 10:33 AM
Last Post: WhiteHexagon
  Jami on the Pine phone ? bcnaz 8 8,720 06-09-2025, 04:17 PM
Last Post: j_s
  How-To: Remote Control Your Phone from Desktop via VNC biketool 6 2,409 03-05-2025, 06:18 AM
Last Post: Kevin Kofler
  Latest firmware for PinePhone modem! Subsentient 105 176,985 02-02-2025, 08:47 PM
Last Post: bacydentir85
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 40 43,753 12-28-2024, 12:19 AM
Last Post: mara
  Office applications for the Pinephone Peter Gamma 2 1,493 09-05-2024, 09:22 AM
Last Post: Peter Gamma
  Struggle to install LibreOffice on the PinePhone Peter Gamma 50 47,706 07-26-2024, 10:35 PM
Last Post: Peter Gamma
  Why does Pine64 sabotage office on the Pinephone? Peter Gamma 5 2,540 07-04-2024, 07:34 AM
Last Post: Kevin Kofler
  Which word processor to choose for the Pinephone? Peter Gamma 16 9,801 06-22-2024, 07:28 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 2 Guest(s)