Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > d76e9d0335eb50de9ef01195761a76f9 > files > 51

lib64kate-devel-0.3.7-1mdv2010.1.x86_64.rpm

<!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"/>
<title>libkate: Format - RLE bitmap</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">


<h1><a class="anchor" id="format_rle">Format - RLE bitmap </a></h1><p>RLE bitmaps are stored line per line, each line encoded with a particular algorithm, usually a variation of RLE.</p>
<p>Let <b>N</b> be the number of bits per pixel of this bitmap.</p>
<ul>
<li><b>N</b> bits being the "zero" color (it doesn't really matter what this color is, but the compression is best if this is the background color)</li>
</ul>
<p>Then, for each row in the bitmap:</p>
<ul>
<li>3 bits representing the type of encoding used for this line.</li>
</ul>
<dl class="user"><dt><b>For encoding 0 (empty):</b></dt><dd>There is no more data for this line, it consists of a single line of pixels of the "zero" color.</dd></dl>
<dl class="user"><dt><b>For encoding 1 (basic):</b></dt><dd>While there are still pixels to decode in this line: <ul>
<li>4 bits representing the number <b>P</b> of pixels of an identical color, minus 1 (eg, 0 means a single pixel). </li>
<li><b>N</b> bits representing the color <b>C</b>.</li>
</ul>
Then the next <b>P</b> pixels are filled with color <b>C</b>.</dd></dl>
<dl class="user"><dt><b>For encoding 2 (delta):</b></dt><dd>While there are still pixels to decode in this line: <ul>
<li>1 bit being 1 if the pixel run is encoded as delta, 0 if not</li>
</ul>
If the bit is 1: <ul>
<li>6 bits representing the number <b>P</b> of pixels in this run, minus 1 The next <b>P</b> pixels are filled from a copy of the pixels in the previous line, starting at the same horizontal offset, or, if this is the first line of the bitmap, they are filled with the "zero" color.</li>
</ul>
If the bit is 0: <ul>
<li>3 bits representing the number <b>P</b> of pixels in this run, minus 1 </li>
<li><b>N</b> bits representing the color <b>C</b>. Then the next <b>P</b> pixels are filled with color <b>C</b>.</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>For encoding 3 (basic/stop):</b></dt><dd><ul>
<li>8 bits representing a number <b>P</b> of pixels in an initial run - if <b>P</b> is greater than zero, <b>P</b> pixels are filled with the "zero" color.</li>
</ul>
Then, while there are still pixels to decode in this line: <ul>
<li>6 bits representing the number <b>P</b> of pixels in this run, or 0 </li>
<li>if <b>P</b> is greater than zero, <b>N</b> bits being the color to fill the next <b>P</b> pixels with. </li>
<li>if <b>P</b> is zero, the remainder of the line is filled with the zero color.</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>For encoding 4 (basic/startend):</b></dt><dd><ul>
<li>9 bits representing the number <b>P</b> of pixels in a run of color "zero" at the start of the line (0 for an empty run) </li>
<li>9 bits representing the number <b>P</b> of pixels in a run of color "zero" at the end of the line (0 for an empty run)</li>
</ul>
Then, while there are still pixels to decode in this line: <ul>
<li>3 bits representing the number <b>P</b> of pixels in this run, minus 1 </li>
<li><b>N</b> bits representing the color <b>C</b>. Then the next <b>P</b> pixels are filled with color <b>C</b>.</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>For encoding 5 (delta/stop):</b></dt><dd>While there are still pixels to decode in this line: <ul>
<li>1 bit being 1 if the next run is delta encoded, and 0 otherwise.</li>
</ul>
If the bit is 1: <ul>
<li>5 bits representing the number <b>P</b> of pixels in this run, minus 1 The next <b>P</b> pixels are filled from a copy of the pixels in the previous line, starting at the same horizontal offset, or, if this is the first line of the bitmap, they are filled with the "zero" color.</li>
</ul>
If the bit is 0: <ul>
<li>3 bits representing the number <b>P</b> of pixels in this run, or 0. </li>
<li>if <b>P</b> is greater than zero, <b>N</b> bits representing the color of the pixels in this run. </li>
<li>if <b>P</b> is zero, the remainder of the line is filled with the zero color.</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>For encoding 6 (basic/zero):</b></dt><dd>While there are still pixels to decode in this line: <ul>
<li><b>N</b> bits representing the color <b>C</b> of this run. </li>
<li>if <b>C</b> is the "zero" color, 8 bits representing the length <b>P</b> of this run, minus 1. </li>
<li>if <b>C</b> is not the "zero" color, 3 bits representing the length <b>P</b> of this run, minus 1. Then, the next <b>P</b> pixels are filled with color <b>C</b>.</li>
</ul>
</dd></dl>
<dl class="user"><dt><b>For encoding 7:</b></dt><dd>Encoding 7 is reserved for future use. A decoder encountering encoding 7 will not be able to decode the line, and thus the bitmap. </dd></dl>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Wed Dec 23 04:05:07 2009 for libkate by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>