Discussion:
Problem with GC_MODE
Carlo Zinato
2007-09-26 15:11:32 UTC
Permalink
Hi all,
I'm using a truecolor 565 color framebuffer drawing graphics
exclusively in black and white, i.e. with GrSetGCBackground(gc, WHITE)
and GrSetGCForeground(gc, BLACK). Everything works fine in GR_MODE_COPY
and GR_MODE_COPYINVERTED (involving only src graphic), but when I use
any other mode which combines src and dst nothing is drawn. For example
if I draw in GR_MODE_XOR mode a black box somewhere over a bigger black
box nothing happens. Am I missing something?
OK, I misunderstood how GR_MODE works: I thought logical operations
consider foreground as 1 and background as 0. But they refer to actual
pixel colors, so in my case WHITE is 1 (pixel is 0xFFFF) and BLACK is 0
(pixel is 0x0000).
Solved problem inverting the logic (e.g. replaced GR_MODE_XOR with
GR_MODE_EQUIV).

Cheers,
Carlo
Thanks in advande,
Carlo
---------------------------------------------------------------------
Carlo Zinato
2007-09-26 14:38:16 UTC
Permalink
Hi all,

I'm using a truecolor 565 color framebuffer drawing graphics
exclusively in black and white, i.e. with GrSetGCBackground(gc, WHITE)
and GrSetGCForeground(gc, BLACK). Everything works fine in GR_MODE_COPY
and GR_MODE_COPYINVERTED (involving only src graphic), but when I use
any other mode which combines src and dst nothing is drawn. For example
if I draw in GR_MODE_XOR mode a black box somewhere over a bigger black
box nothing happens. Am I missing something?

Thanks in advande,
Carlo

Loading...