Images and Backgrounds in Dw

General

Representation of the image data is delegated to dw::core::Imgbuf, see there for details. Drawing is delegated to dw::core::View (dw::core::View::drawImgbuf).

Since dw::core::Imgbuf provides memory management based on reference counting, there may be an 1-to-n relation from image renderers (image widgets or backgrounds, see below) and dw::core::Imgbuf. Since dw::core::Imgbuf does not know about renderers, but just provides rendering functionality, the caller must (typically after calling dw::core::Imgbuf::copyRow) notify all renderers connected to the buffer.

Images

This is the simplest renderer, displaying an image. For each row to be drawn,

  1. first dw::core::Imgbuf::copyRow, and then
  2. for each dw::Image, dw::Image::drawRow must be called, with the same argument (no scaling is necessary).

dw::Image automatically scales the dw::core::Imgbuf, the root buffer should be passed to dw::Image::setBuffer.

See also:
dw::Image for more details.

Future Extensions

(This is not implemented yet.) Rendering itself (image widgets and background) will be abstracted, by a new interface dw::core::ImageRenderer. In the current code for image decoding, this interface will replace references to dw::Image, which implements dw::core::ImageRenderer, in most cases.

Backgrounds

(This is based on future extensions described above.) Since background are style resources, they are associated with dw::core::style::Style. For backgrounds, another level is needed, because of the 1-to-n relation from dw::core::style::Style to dw::core::Widget:

inline_dotgraph_1.dot

Unlike dw::Image, dw::core::style::BgRenderer is not associated with a certain rectangle on the canvas. Instead, widgets, or parts of widgets take this role. This is generally represented by an implementation of the interface dw::core::style::BgAllocation, which is implemented by dw::core::Widget, but also by all parts of widget implementation, which may have an own background image.

The following diagram gives a total overview:

inline_dotgraph_2.dot

[legend]

Integration into dillo

Todo:
Add some references.

Generated on Wed Sep 7 02:00:35 2011 for Dillo by  doxygen 1.5.9