AnsweredAssumed Answered

G2D API Source Color Key?

Question asked by Gary Pratley on May 20, 2019
Latest reply on May 21, 2019 by Gary Pratley

Using the G2D API, is it possible to use src color keying/transparency?

 

I have wrapper classes that use the G2D surfaces and blitting, but my images loaded onto the G2D surfaces have a background transparency color. I blit these surfaces/images onto a composite surface for final rendering to the graphics device, but require the blit to exclude my transparency color from the src G2D surface. I've set src.clrcolor to my transparency colour, and enabled G2_BLEND and G2_GLOBAL_ALPHA. I've experimented with different src and dest blendfunc values without success.

 

My G2D surface (and graphics) format is RGB565 for optimal memory usage.

 

Can what I'm trying to achieve be done with the G2D API and RGB565 format, or would I need to use RGBA and local alpha blending, or use the IPU API if I wish to use src color keying?

Outcomes