almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
117 stars 46 forks source link

A Add pixecolor Rgb888 for TGA file upload #54

Closed FMFigueroa closed 1 year ago

almindor commented 1 year ago

I think this looks good apart from the formatting and write_pixels_rgb888 being wrong. AFAICS it should just send the color bytes in directly.

rfuest commented 1 year ago

Something isn't right: ILI9341 controllers don't support 24 bit color. The maximum color depth is 18 bit (aka Rgb666).

FMFigueroa commented 1 year ago

with reason the image is overwritten, buffer is collapsed, I didn't know this, thanks for explaining it @rfuest , I was looking to transfer an image file with the tinytga crate doing a bypass with the driver. I will do it with a bmp image that requires Rgb565 and is supported by ili9341.

rfuest commented 1 year ago

with reason the image is overwritten, buffer is collapsed, I didn't know this, thanks for explaining it @rfuest , I was looking to transfer an image file with the tinytga crate doing a bypass with the driver. I will do it with a bmp image that requires Rgb565 and is supported by ili9341.

Using an image with the same color format will always give the best performance, but you can still use tinytga if you like, for example for the RLE compression.

There are two ways to use use tinytga in your case: Either use color_converted (see https://docs.rs/embedded-graphics/latest/embedded_graphics/draw_target/trait.DrawTargetExt.html#tymethod.color_converted), or preferably the GIT version of tinytga, which automatically converts mismatched color formats. Not quite sure why the latest changes in tinytga weren't released yet, like they were for tinybmp.