In line with the recent discussion about "modernising" fltk to do
things like transparency, what's the current best way to go about
drawing a translucent rectangle?  I.e. something like fl_rect that
takes a rectangle and an rgba color.  I have some code that uses
fl_read_image, multiplies each pixel with the alpha to get the result
color, and redraws it with an Fl_RGB_Image.  Looking at it, I'm not
sure why I didn't just use an Fl_RGB_Image with 4 channels instead of
3.  However, both these approaches (certainly not the first one) are
not likely to take advantage of the OS's acceleration of transparency.
 I'm not sure this will be necessary in the end since my transparent
areas aren't large, but I was wondering if there was a consensus on a
"standard" way to do this in fltk.

Can I call the OS-level drawing functions directly?  I'm on OS X and
xorg X, and I'm sure OS X has some transparency features, and I gather
xorg X does too with the Xrender stuff, but I haven't read the OS X
docs yet and the Xrender / libcairo docs were hard to find the last
time I looked.  Calling as OS routine directly I imagine I'd have to
do some work to work nicely with fltk, e.g. obey its clipping stack,
and maybe some special setup to use non-fltk drawing on an fltk
window.

I'm also interested in anti-aliased lines, curves, and shapes.

Anyone else dealt with these issues in fltk and came up with a nice
solution?  I'm hoping a cross platform rectf with alpha wouldn't be
too hard to write, as well as anti-aliased versions of the various
line drawing primitives.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to