summaryrefslogtreecommitdiff
path: root/old/dw/html/dw-images-and-backgrounds.html
diff options
context:
space:
mode:
Diffstat (limited to 'old/dw/html/dw-images-and-backgrounds.html')
-rw-r--r--old/dw/html/dw-images-and-backgrounds.html109
1 files changed, 109 insertions, 0 deletions
diff --git a/old/dw/html/dw-images-and-backgrounds.html b/old/dw/html/dw-images-and-backgrounds.html
new file mode 100644
index 0000000..eecb16c
--- /dev/null
+++ b/old/dw/html/dw-images-and-backgrounds.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.8.8"/>
+<title>Dillo: Images and Backgrounds in Dw</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="https://www.dillo.org/dw/html/jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td style="padding-left: 0.5em;">
+ <div id="projectname">Dillo
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.8.8 -->
+ <div id="navrow1" class="tabs">
+ <ul class="tablist">
+ <li><a href="index.html"><span>Main&#160;Page</span></a></li>
+ <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
+ <li><a href="namespaces.html"><span>Namespaces</span></a></li>
+ <li><a href="annotated.html"><span>Classes</span></a></li>
+ <li><a href="files.html"><span>Files</span></a></li>
+ </ul>
+ </div>
+</div><!-- top -->
+<div class="header">
+ <div class="headertitle">
+<div class="title">Images and Backgrounds in Dw </div> </div>
+</div><!--header-->
+<div class="contents">
+<div class="textblock"><h1>Image Buffers </h1>
+<p>Representation of the image data is done by <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a>, see there for details. Drawing is done by <a class="el" href="classdw_1_1core_1_1View.html" title="An interface to encapsulate platform dependent drawing. ">dw::core::View</a> (<a class="el" href="classdw_1_1core_1_1View.html#a07f2328b411be00f766761c42b4df069">dw::core::View::drawImage</a>).</p>
+<p>Since <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a> 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 <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a>. Since <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a> does not know about renderers, but just provides rendering functionality, the caller must (typically after calling <a class="el" href="classdw_1_1core_1_1Imgbuf.html#a0b738f2672de023650c657f16603a5c0">dw::core::Imgbuf::copyRow</a>) notify all renderers connected to the buffer.</p>
+<h1>Image Renderer </h1>
+<p>Generally, there are no restrictions on how to manage <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a>; but to handle image data from web resources, the interface <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a> should be implemented. It is again wrapped by DilloImage (to make access from the C part possible, since <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a> is written in C++), which is referenced by DilloWeb. There are two positions where retrieving image data is initiated:</p>
+<ul>
+<li>Html_load_image: for embedded images (implemented by <a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a>, which implements <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a>);</li>
+<li>StyleEngine::apply (search for "case
+ CSS_PROPERTY_BACKGROUND_IMAGE"): for backgrond images; there are some implementations of <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a> within the context of <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html">dw::core::style::StyleImage</a>.</li>
+</ul>
+<p>Both are described in detail below. Notice that the code is quite similar; only the implementation of <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a> differs.</p>
+<p>At this time, <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a> has got two methods (see more documentation there):</p>
+<ul>
+<li><a class="el" href="classdw_1_1core_1_1ImgRenderer.html#ab7dc127cefecc858705f0f4a652fd89e" title="Called, when an image buffer is attached. ">dw::core::ImgRenderer::setBuffer</a>,</li>
+<li><a class="el" href="classdw_1_1core_1_1ImgRenderer.html#aa4abd8fd9eee62c87f976025a95a6696" title="Called, when data from a row is available and has been copied into the image buffer. ">dw::core::ImgRenderer::drawRow</a>,</li>
+<li><a class="el" href="classdw_1_1core_1_1ImgRenderer.html#aaa81f8322974b3de8992c394450ccd52" title="Called, when all image data has been retrieved. ">dw::core::ImgRenderer::finish</a>, and</li>
+<li><a class="el" href="classdw_1_1core_1_1ImgRenderer.html#a9b0191db850fc2dacb19941dc8eeca76" title="Called, when there are problems with the retrieval of image data. ">dw::core::ImgRenderer::fatal</a>.</li>
+</ul>
+<h1>Images </h1>
+<p>This is the simplest renderer, displaying an image. For each row to be drawn,</p>
+<ul>
+<li>first <a class="el" href="classdw_1_1core_1_1Imgbuf.html#a0b738f2672de023650c657f16603a5c0">dw::core::Imgbuf::copyRow</a>, and then</li>
+<li>for each <a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a>, <a class="el" href="classdw_1_1Image.html#a3ef4895f4b6f6e43d31d97d59d09ee34" title="Called, when data from a row is available and has been copied into the image buffer. ">dw::Image::drawRow</a> must be called, with the same argument (no scaling is necessary).</li>
+</ul>
+<p><a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a> automatically scales the <a class="el" href="classdw_1_1core_1_1Imgbuf.html" title="The platform independent interface for image buffers. ">dw::core::Imgbuf</a>, the root buffer should be passed to <a class="el" href="classdw_1_1Image.html#aba1218df074496b12176464c43022f7c" title="Called, when an image buffer is attached. ">dw::Image::setBuffer</a>.</p>
+<dl class="section see"><dt>See also</dt><dd><a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a> for more details.</dd></dl>
+<h1>Background Images </h1>
+<p>Since background images are style resources, they are associated with <a class="el" href="classdw_1_1core_1_1style_1_1Style.html">dw::core::style::Style</a>, as <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html">dw::core::style::StyleImage</a>, which is handled in a similar way (reference counting etc.) as <a class="el" href="classdw_1_1core_1_1style_1_1Color.html">dw::core::style::Color</a> and <a class="el" href="classdw_1_1core_1_1style_1_1Font.html">dw::core::style::Font</a>, although it is concrete and not platform-dependant.</p>
+<p>The actual renderer (passed to Web) is an instance of <a class="el" href="classdw_1_1core_1_1ImgRendererDist.html" title="Implementation of ImgRenderer, which distributes all calls to a set of other implementations of ImgRe...">dw::core::ImgRendererDist</a> (distributes all calls to a set of other instances of <a class="el" href="classdw_1_1core_1_1ImgRenderer.html" title="... ">dw::core::ImgRenderer</a>), which contains two kinds of renderers:</p>
+<ul>
+<li>one instance of <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage_1_1StyleImgRenderer.html">dw::core::style::StyleImage::StyleImgRenderer</a>, which does everything needed for <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html">dw::core::style::StyleImage</a>, and</li>
+<li>other renderers, used externally (widgets etc.), which are added by <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html#a03aa6731a4b882391b610e0cd2206f48" title="Add an additional ImgRenderer, especially used for drawing. ">dw::core::style::StyleImage::putExternalImgRenderer</a> (and removed by <a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html#a987ab48ed3da97b0e59f31ba37fcc840" title="Remove a previously added additional ImgRenderer. ">dw::core::style::StyleImage::removeExternalImgRenderer</a>).</li>
+</ul>
+<p>This diagram gives an comprehensive overview:</p>
+<div align="center">
+<img src="dot_inline_dotgraph_2.png" alt="dot_inline_dotgraph_2.png" border="0" usemap="#dot_inline_dotgraph_2.map"/>
+<map name="dot_inline_dotgraph_2.map" id="dot_inline_dotgraph_2.map"><area shape="rect" id="node1" href="classdw_1_1core_1_1style_1_1Style.html" title="\N" alt="" coords="259,27,331,76"/><area shape="rect" id="node2" href="classdw_1_1core_1_1style_1_1StyleImage.html" title="\N" alt="" coords="251,124,339,173"/><area shape="rect" id="node3" href="classdw_1_1core_1_1Imgbuf.html" title="\N" alt="" coords="197,221,269,271"/><area shape="rect" id="node4" href="classdw_1_1core_1_1style_1_1StyleImage_1_1StyleImgRenderer.html" title="\N" alt="" coords="198,416,325,465"/><area shape="rect" id="node6" href="classdw_1_1core_1_1ImgRendererDist.html" title="\N" alt="" coords="329,221,450,271"/><area shape="rect" id="node5" href="classdw_1_1core_1_1ImgRenderer.html" title="\N" alt="" coords="347,319,445,368"/><area shape="rect" id="node7" href="classdw_1_1core_1_1style_1_1StyleImage_1_1ExternalImgRenderer.html" title="\N" alt="" coords="349,416,494,465"/><area shape="rect" id="node8" href="classdw_1_1core_1_1style_1_1StyleImage_1_1ExternalWidgetImgRenderer.html" title="\N" alt="" coords="308,513,495,563"/><area shape="rect" id="node10" href="classdw_1_1core_1_1Layout_1_1LayoutImgRenderer.html" title="\N" alt="" coords="713,513,849,563"/><area shape="rect" id="node12" href="classdw_1_1core_1_1Widget_1_1WidgetImgRenderer.html" title="\N" alt="" coords="27,611,165,660"/><area shape="rect" id="node15" href="classdw_1_1Textblock_1_1WordImgRenderer.html" title="\N" alt="" coords="527,611,655,660"/><area shape="rect" id="node9" href="classdw_1_1core_1_1Layout.html" title="\N" alt="" coords="745,416,817,465"/><area shape="rect" id="node11" href="classdw_1_1core_1_1Widget.html" title="\N" alt="" coords="60,513,132,563"/><area shape="rect" id="node13" href="classdw_1_1Textblock.html" title="\N" alt="" coords="577,416,655,465"/><area shape="rect" id="node14" href="structdw_1_1Textblock_1_1Word.html" title="\N" alt="" coords="580,513,652,563"/><area shape="rect" id="node16" href="classdw_1_1Textblock_1_1SpaceImgRenderer.html" title="\N" alt="" coords="537,708,671,757"/></map>
+</div>
+<center>[<a class="el" href="uml-legend.html">legend</a>]</center><h2>Memory management </h2>
+<p><a class="el" href="classdw_1_1core_1_1style_1_1StyleImage.html">dw::core::style::StyleImage</a> extends <a class="el" href="classlout_1_1signal_1_1ObservedObject.html" title="An observed object has a signal emitter, which tells the receivers, when the object is deleted...">lout::signal::ObservedObject</a>, so that deleting this instance can be connected to code dealing with cache clients etc. See StyleImageDeletionReceiver and how it is attached in StyleEngine::apply ("case CSS_PROPERTY_BACKGROUND_IMAGE").</p>
+<h1>Bugs and Things Needing Improvement </h1>
+<p>(Mostly related to image backgrounds, when not otherwise mentioned.)</p>
+<h2>High Priority </h2>
+<p>Configurability, security/privacy aspects, etc.,** which are currently available for image widgets, should be adopted. Perhaps some more configuration options specially for background images.</p>
+<h2>Medium Priority </h2>
+<p>Background-attachment** is not yet implemented, and will be postponed.</p>
+<p>Calls to <a class="el" href="classdw_1_1core_1_1ImgRenderer.html#a9b0191db850fc2dacb19941dc8eeca76" title="Called, when there are problems with the retrieval of image data. ">dw::core::ImgRenderer::fatal</a>** are incomplete. As an example, it is not called, when connecting to a server fails. (And so, as far as I see, no cache client is started.)</p>
+<h2>Low Priority </h2>
+<p>Alpha support:** (not related to image backgrounds) currently alpha support (and also colormap management) is done in dicache, while <a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a> is only created with type RGB. This leads to several problems:</p>
+<ul>
+<li>One dicache entry (representing an image related to the same URL), which has only one background color, may refer to different images with different background colors.</li>
+<li>The dicache only handles background colors, not background images.</li>
+</ul>
+<p>The solution is basicly simple: keep alpha support out of dicache; instead implement RGBA in <a class="el" href="classdw_1_1Image.html" title="Displays an instance of dw::core::Imgbuf. ">dw::Image</a>. As it seems, the main problem is alpha support in FLTK/X11.</p>
+<h2>Solved (Must Be Documented) </h2>
+<p>Drawing background images row by row may become slow. As an alternative, <a class="el" href="classdw_1_1core_1_1ImgRenderer.html#aaa81f8322974b3de8992c394450ccd52" title="Called, when all image data has been retrieved. ">dw::core::ImgRenderer::finish</a> could be used. However, drawing row by row could become an option.* There is now <a class="el" href="namespacedw_1_1core_1_1style.html#adb003b58fcf7ea1d906149b5d1fdb607">dw::core::style::drawBackgroundLineByLine</a>, which can be changed in the code, and is set to <em>false</em>. The old code still exists, so changing this to <em>true</em> activates again drawing line by line.</p>
+<p>(For image widgets, this could also become an option: in contexts, when image data is retrieved in a very fast way.) </p>
+</div></div><!-- contents -->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated on Sat May 28 2016 11:47:43 for Dillo by &#160;<a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.8.8
+</small></address>
+</body>
+</html>