Jump to content

gdispGBlitArea() doesn't support native images


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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...