Jump to content

gdispGBlitArea() doesn't support native images


ktowers

Recommended Posts

I'm trying to migrate from another graphics library (u8g2) to uGFX to get eventual support for color screens.  I have a number of ROM based bitmaps that are stored in native format.  For this display, it is 1 bit per pixel.  I tried used the gdispGBlitArea() function to draw them, but found that it assumes pixels take a minimum of one byte.  I worked around the problem by enabling the GDISP_HARDWARE_BITFILLS macro and doing the blitting in my driver by implementing gdisp_lld_blit_area().

Is there a plan to add more support at the gdisp layer for native formats?

One of the features that the u8g2 library had was to draw bitmaps with a transparent background.  I notice that there is support for blending the alpha channel for bitmaps in the gdisp.c file.  This would be the place to add support for similar transparent background in bitmap.  What are the plans for this?  I really don't want to have to push down the alpha blending stuff into my driver code.

 

Link to comment
Share on other sites

You can use the BMP image handling in ugfx. BMP images support a 1 bit per pixel format. The only thing you may need to do is to fabricate a BMP header.

Because BMP also support RLE encoded formats you may also be able to compress your 1 bit images and so save rom/ram.

Writing a bitblit routine for your driver to handle your "special format" image is probably not the best way to handle this.

Similarly with your alpha request, use the image processing support built into ugfx. For example, ugfx handles transparent gif's. It also handles PNG images with an alpha channel although alpha blending is supported to varying degrees based on your display controller.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...