AllenBarnett
Posts: 7
Joined: Thu Dec 26, 2013 9:48 pm

Transparency in an 8BPP dispmanx resource

Thu Apr 04, 2019 12:07 am

Is it possible to make transparent pixels in a dispmanx resource with a type of VC_IMAGE_8BPP? The palette seems to be defined as an array of RGB565 colors. Is it possible to include an alpha value other than on the whole dispmanx element?
I'm trying to draw a non-square image in one dispmanx layer on top of another image in a lower layer.
Thanks,
Allen

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6693
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Transparency in an 8BPP dispmanx resource

Thu Apr 04, 2019 1:45 pm

If using Dispmanx (NOT the mailbox calls), then you can pass either RGB565 or RGBA32 entries. The firmware switches on the length of the write being either
16 * sizeof(uint32_t) and VC_IMAGE_4BPP, or 256 * sizeof(uint32_t) and VC_IMAGE_8BPP to be RGBA32
or
16 * sizeof(uint16_t) and VC_IMAGE_4BPP, or 256 * sizeof(uint16_t) and VC_IMAGE_8BPP to be RGB565.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

AllenBarnett
Posts: 7
Joined: Thu Dec 26, 2013 9:48 pm

Re: Transparency in an 8BPP dispmanx resource

Fri Apr 05, 2019 1:16 am

That works great! And sneaky, too! Thanks so much.

The color of my overlay don't look exactly like I would expect. Is it possible that the 32-bit palette format is BGRA?

Return to “Graphics programming”