One think I remember was a pain: abstraction of image classes drawing.
This is because there are three image class types have their own
platform-dependent drawing:

   Fl_RGB_Image
   Fl_Pixmap
   Fl_Bitmap

All of them use fl_offscreen() as the cache but they use bits and pieces
of plafrorm dependent code eg when building/binding mask. Now we already
have functions

  fl_draw_image();
  fl_draw_pixmap();

with certain duplicity of the code found in the image classes. I think
we should add a "C" function

  fl_draw_bitmap();

for drawing bitmmap with current color, clean-up the code so that eg
fl_draw_pixmap() can handle bitmasks properly and remove all platform
dependent code from the image classes themselves:  all they need to use
are these external functions + fl_offscreen() to build the cache.

The other thing is that Fl_Offscreen and offscreen handling functions
are in many places platform-dependent defines, not proper functions or
classes. But caches are inherently platform/device dependent (eg
postscript may use image dictionary) so to handle that transparently the
offscreen should have a device-type parameter (the offscreen creation
can be a device method with function wrappers for "current device" for
backward compatibility) and proper device checking should be performed
when creating/binding the offscreen so that device/offscreen are
compatible. Some devices may not want caching at all - eg printer if it
does not care about the transfer speed or data size - and they can leave
cache untouched.

R.


Matthias Melcher wrote:

> 
> Yes Roman, great points. I think this is the way to go.
> 
> Matthias
> 
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to