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.
This is the simplest renderer, displaying an image. For each row to be drawn,
dw::Image automatically scales the dw::core::Imgbuf, the root buffer should be passed to dw::Image::setBuffer.
(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.
(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:
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:
1.5.9