nanogui: Drawing transparent bitmaps


Previous by date: 28 Feb 2007 02:58:18 +0000 Drawing transparent bitmaps, Uwe Klatt
Next by date: 28 Feb 2007 02:58:18 +0000 show the jpeg, Robert Chan
Previous in thread: 28 Feb 2007 02:58:18 +0000 Drawing transparent bitmaps, Uwe Klatt
Next in thread: 28 Feb 2007 02:58:18 +0000 Re: Drawing transparent bitmaps, Roberto

Subject: Re: [nanogui] Drawing transparent bitmaps
From: "Greg Haerr" ####@####.####
Date: 28 Feb 2007 02:58:18 +0000
Message-Id: <1b1301c75ae4$3471b920$0300a8c0@RDP>

: today I modified the fb16 graphic driver for displaying transparent
bitmaps.
: I want to know if somebody knows a "better" solution for this "problem".

Uwe -

I would likely have implemented the solution the same way,
as implementing it in the driver allows the fastest possible
image drawing with no changes to the engine level.  Since
the engine doesn't support passing any additional values
to the driver to identify the transparency value (other
than stuffing it in the rightmost bits of 'op', which
wouldn't work well for 32bpp framebuffers), picking
an otherwise-unused ROP is probably fine.  My only
other thoughts would be exactly which ROP code to
use, and documenting that, or adding a new one called
say MWMODE_SRC_TRANS_WHITE = 26
and incrementing MWMODE_MAX to 26.

Also, the applyOp macro is used in some other
places, I think, so we may need to implement this
capability in a macro...?

Nonetheless, send a patch when you're done!

Regards,

Greg




:
: In my application I use bmp files for user interface and normally there is
: no transparency feature available for this file format.
: I decided to use WHITE (all Bits ON) for transparency.
:
: Then I used the existing ROP-Mode  MWROP_SRC_OVER.
: This ROP is not used at the moment.
:
: I had to modify only two functions:
: linear16_blit and linear16_stretchblit
: You can find both in fblin16.c
:
: In linear16_blit I replaced
:
:   applyOp(MWROP_TO_MODE(op), *src, dst, ADDR16);
:
: with
:
:   if(op == MWROP_SRC_OVER) {
:     if(*src != 0xFFFF)
:       *dst = *src;
:     }
:     else
:       applyOp(MWROP_TO_MODE(op), *src, dst, ADDR16);
:
: and in linear16_stretchblit I replaced
:
:   *dst++ = pixel;
:
: with
:
:   if((op == MWROP_SRC_OVER) && (pixel == 0xFFFF))
:     dst++;
:   else
:     *dst++ = pixel;


Previous by date: 28 Feb 2007 02:58:18 +0000 Drawing transparent bitmaps, Uwe Klatt
Next by date: 28 Feb 2007 02:58:18 +0000 show the jpeg, Robert Chan
Previous in thread: 28 Feb 2007 02:58:18 +0000 Drawing transparent bitmaps, Uwe Klatt
Next in thread: 28 Feb 2007 02:58:18 +0000 Re: Drawing transparent bitmaps, Roberto


Powered by ezmlm-browse 0.20.