<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>code-spot &#187; C++</title>
	<atom:link href="http://code-spot.co.za/category/cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://code-spot.co.za</link>
	<description>a programming blog</description>
	<lastBuildDate>Sun, 27 Feb 2011 07:18:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>2D Minimum and Maximum Filters: Algorithms and Implementation Issues</title>
		<link>http://code-spot.co.za/2011/01/24/2d-minimum-and-maximum-filters-algorithms-and-implementation-issues/</link>
		<comments>http://code-spot.co.za/2011/01/24/2d-minimum-and-maximum-filters-algorithms-and-implementation-issues/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 22:30:49 +0000</pubDate>
		<dc:creator>herman.tulleken</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[implicit queue algorithm]]></category>
		<category><![CDATA[max-queue algorithm]]></category>
		<category><![CDATA[maximum filter]]></category>
		<category><![CDATA[minimum filter]]></category>
		<category><![CDATA[monotonic wedge algorithm]]></category>

		<guid isPermaLink="false">http://code-spot.co.za/?p=1100</guid>
		<description><![CDATA[A while back I needed to implement fast minimum and maximum filters for images. I devised (what I thought was) a clever approximation scheme where the execution time is not dependent on the window size of the filter. But the method had some issues, and I looked at some other algorithms. In retrospect, the method I [...]


Related posts:<ol><li><a href='http://code-spot.co.za/2010/04/16/simple-fast-approximate-minimum-maximum-filters/' rel='bookmark' title='Permanent Link: Simple, Fast* Approximate Minimum / Maximum Filters'>Simple, Fast* Approximate Minimum / Maximum Filters</a></li>
<li><a href='http://code-spot.co.za/2008/11/11/5-tips-for-prototyping-slow-algorithms/' rel='bookmark' title='Permanent Link: 5 Tips for Prototyping Slow Algorithms'>5 Tips for Prototyping Slow Algorithms</a></li>
<li><a href='http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/' rel='bookmark' title='Permanent Link: A simple texture algorithm – faster code and more results'>A simple texture algorithm – faster code and more results</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1101" title="minmax" src="http://code-spot.co.za/blog/wp-content/uploads/2011/01/minmax.png" alt="" width="491" height="321" /></p>
<p>A while back I needed to implement fast minimum and maximum filters for images. I devised (what I thought was) a <a href="http://code-spot.co.za/2010/04/16/simple-fast-approximate-minimum-maximum-filters/">clever approximation scheme</a> where the execution time is not dependent on the window size of the filter. But the method had some issues, and I looked at some other algorithms. In retrospect, the method I used seems foolish. At the time, I did not realise the obvious: a 1D filter could be applied to first the rows, and then the columns of an image, which makes the slow algorithm faster, or allows you to use one of the many published fast 1D algorithms.</p>
<p>I wanted to write down my gained knowledge, and started to work on a blog post. But soon it became quite long, so I decided to put it into a PDF document instead. You can download it below.</p>
<p><span id="more-1100"></span>The document is somewhat weird: it is very detailed for a &#8220;simple&#8221; image algorithm (it is more than 50 pages!). It does have several tips that applies to implementation of other image processing algorithms. It also has, what I believe to be, a very clear description of the Monotonic Wedge Algorithm, with code that reflects the explanation in text closely. (I had trouble understanding the algorithm from the original journal publication. And the authors provide code that was even further optimised and thus less clear to follow).</p>
<p>I intended to give some performance analysis and results, but other activities has robbed me of any free time. Perhaps later.</p>
<p>Also, the code has been edited for readability, and hence, might contain typos that were introduced in the process. If you spot any, please let me know.</p>
<h2>Download</h2>
<p><a href="http://www.code-spot.co.za/downloads/image/minmax_filters.pdf">minmax_filters.pdf (230 KB)</a></p>
<h2>Table of Contents</h2>
<blockquote>
<div id="_mcePaste">1 The Problem</div>
<div id="_mcePaste">2 Exact Algorithms</div>
<div id="_mcePaste">2.1 The Naive Algorithm</div>
<div id="_mcePaste">2.2 The Max-Queue</div>
<div id="_mcePaste">2.3 Implicit Queue Algorithm</div>
<div id="_mcePaste">2.4 The Monotonic Wedge Algorithm</div>
<div id="_mcePaste">3 Approximate Algorithms</div>
<div id="_mcePaste">3.1 The Power Mean Approximation</div>
<div id="_mcePaste">3.2 The Power Mean Variant Algorithm</div>
<div id="_mcePaste">3.3 The Contra-Harmonic Mean Approximation</div>
<div id="_mcePaste">4 Other Algorithm Concepts</div>
<div id="_mcePaste">4.1 Separation</div>
<div id="_mcePaste">4.2 Implementing Minimum Filters</div>
<div id="_mcePaste">4.3 Windows with Even Diameters</div>
<div id="_mcePaste">4.4 Filtering a Region of Interest</div>
<div id="_mcePaste">4.5 Maximum and Minimum Filters for Binary Images</div>
<div id="_mcePaste">A Image Containers</div>
<div id="_mcePaste">A.1 Image Class Interface</div>
<div id="_mcePaste">A.2 Image Loops</div>
<div id="_mcePaste">A.3 Image Iterators</div>
<div id="_mcePaste">A.4 Image Access Modifiers</div>
<div id="_mcePaste">B Fixed-width Deques</div>
<div id="_mcePaste">C Max-queues</div>
<div id="_mcePaste">D Summed Area Tables</div>
<div id="_mcePaste">D.1 Calculating a SAT</div>
<div id="_mcePaste">D.2 Finding a Sum from a SAT</div>
<div id="_mcePaste">D.3 Checking for Overflow 50</div>
<div id="_mcePaste">D.4 Large SATs 53</div>
</blockquote>


<p>Related posts:<ol><li><a href='http://code-spot.co.za/2010/04/16/simple-fast-approximate-minimum-maximum-filters/' rel='bookmark' title='Permanent Link: Simple, Fast* Approximate Minimum / Maximum Filters'>Simple, Fast* Approximate Minimum / Maximum Filters</a></li>
<li><a href='http://code-spot.co.za/2008/11/11/5-tips-for-prototyping-slow-algorithms/' rel='bookmark' title='Permanent Link: 5 Tips for Prototyping Slow Algorithms'>5 Tips for Prototyping Slow Algorithms</a></li>
<li><a href='http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/' rel='bookmark' title='Permanent Link: A simple texture algorithm – faster code and more results'>A simple texture algorithm – faster code and more results</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://code-spot.co.za/2011/01/24/2d-minimum-and-maximum-filters-algorithms-and-implementation-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Region Quadtrees in C++</title>
		<link>http://code-spot.co.za/2010/06/15/region-quadtrees-in-c/</link>
		<comments>http://code-spot.co.za/2010/06/15/region-quadtrees-in-c/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 11:14:14 +0000</pubDate>
		<dc:creator>herman.tulleken</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[Dev.Mag]]></category>
		<category><![CDATA[image partitioning]]></category>
		<category><![CDATA[quadtree]]></category>
		<category><![CDATA[quadtrees]]></category>
		<category><![CDATA[spatial partitioning]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://code-spot.co.za/?p=983</guid>
		<description><![CDATA[(Original image by GoAwayStupidAI). Below are four C++ implementations of the region quadtree (the kind used for image compression, for example). The different implementations were made in an attempt to optimise construction of quadtrees. (For a tutorial on implementing region quadtrees, see Issue 26 [6.39 MB zip] of Dev.Mag). NaiveQuadtree is the straightforward implementation. AreaSumTableQuadtree [...]


Related posts:<ol><li><a href='http://code-spot.co.za/2008/10/06/quadtrees/' rel='bookmark' title='Permanent Link: Quadtrees'>Quadtrees</a></li>
<li><a href='http://code-spot.co.za/2008/11/15/quadtrees-2/' rel='bookmark' title='Permanent Link: Quadtrees'>Quadtrees</a></li>
<li><a href='http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/' rel='bookmark' title='Permanent Link: A simple texture algorithm – faster code and more results'>A simple texture algorithm – faster code and more results</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img style="display: inline; border: 0px;" title="quadtree" src="http://code-spot.co.za/blog/wp-content/uploads/2010/06/quadtree.png" border="0" alt="quadtree" width="491" height="375" /></p>
<p>(<a href="http://www.flickr.com/photos/goawaystupidai/3106598088/">Original image</a> by <a href="http://www.flickr.com/photos/goawaystupidai/">GoAwayStupidAI</a>).</p>
<p>Below are four C++ implementations of the <a href="http://www.voronoi.com/wiki/index.php?title=Quadtree">region quadtree</a> (the kind used for image compression, for example). The different implementations were made in an attempt to optimise <em>construction </em>of quadtrees. (For a tutorial on implementing region quadtrees, see <a href="http://www.devmag.org.za/uploads/DevMag_Issue26.zip" class="broken_link">Issue 26</a> [6.39 MB zip] of <a href="http://devmag.org.za/">Dev.Mag</a>).</p>
<ul>
<li><strong>NaiveQuadtree </strong>is the straightforward implementation.</li>
<li><strong>AreaSumTableQuadtree </strong>uses a <a href="http://en.wikipedia.org/wiki/Summed_area_table">summed area table</a> to perform fast calculations of the mean and variance of regions in the data grid.</li>
<li><strong>AugmentedAreaSumTableQuadtree </strong>is the same, except that the area sum table has an extra row and column of zeros to prevents if-then logic that slows it down and makes it tricky to understand.</li>
<li><strong>SimpleQuadtree </strong>is the same as AugmentedAreaSumTableQuadtree , except that no distinction is made (at a class level) between different node types.</li>
</ul>
<p><span id="more-983"></span>The interfaces of all quadtrees are the same, but I did not want to extend from a base class. (Instead, a compile time check is performed on the classes, using <a href="http://www.boost.org/doc/libs/1_43_0/libs/concept_check/concept_check.htm">boost concepts</a>).</p>
<p>The results of the performance (on my machine!) of the trees are as follows:</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td style="text-align: left;" width="100" valign="top">(milliseconds)</td>
<td style="text-align: right;" width="100" valign="top"><strong>N</strong></td>
<td style="text-align: right;" width="100" valign="top"><strong>S</strong></td>
<td style="text-align: right;" width="100" valign="top"><strong>AST</strong></td>
<td style="text-align: right;" width="100" valign="top"><strong>AAST</strong></td>
</tr>
<tr>
<td style="text-align: right;" width="100" valign="top"></td>
<td style="text-align: right;" width="100" valign="top">3</td>
<td style="text-align: right;" width="100" valign="top">4</td>
<td style="text-align: right;" width="100" valign="top">4</td>
<td style="text-align: right;" width="100" valign="top">3</td>
</tr>
<tr>
<td width="100" valign="top"><strong>64×64</strong></td>
<td style="text-align: right;" width="100" valign="top">14</td>
<td style="text-align: right;" width="100" valign="top">14</td>
<td style="text-align: right;" width="100" valign="top">14</td>
<td style="text-align: right;" width="100" valign="top">13</td>
</tr>
<tr>
<td width="100" valign="top"><strong>128×128</strong></td>
<td style="text-align: right;" width="100" valign="top">55</td>
<td style="text-align: right;" width="100" valign="top">52</td>
<td style="text-align: right;" width="100" valign="top">55</td>
<td style="text-align: right;" width="100" valign="top">52</td>
</tr>
<tr>
<td width="100" valign="top"><strong>256×256</strong></td>
<td style="text-align: right;" width="100" valign="top">229</td>
<td style="text-align: right;" width="100" valign="top">233</td>
<td style="text-align: right;" width="100" valign="top">218</td>
<td style="text-align: right;" width="100" valign="top">214</td>
</tr>
<tr>
<td width="100" valign="top"><strong>512×512</strong></td>
<td style="text-align: right;" width="100" valign="top">950</td>
<td style="text-align: right;" width="100" valign="top">1036</td>
<td style="text-align: right;" width="100" valign="top">937</td>
<td style="text-align: right;" width="100" valign="top">922</td>
</tr>
<tr>
<td width="100" valign="top"><strong>1024×1024</strong></td>
<td style="text-align: right;" width="100" valign="top">4064</td>
<td style="text-align: right;" width="100" valign="top">4459</td>
<td style="text-align: right;" width="100" valign="top">5396</td>
<td style="text-align: right;" width="100" valign="top">3891</td>
</tr>
</tbody>
</table>
<p>As it turns out, the different implementations do not differ significantly. Constructing the nodes takes long, and not so much the calculations necessary to determine whether a node should split or not, and what data should be in the node. Had I profiled properly before I started I would not have gone through this exercise…</p>
<p>Between these four implementations, the NaiveQuadtree is the one I recommend; I left in the other implementations for anyone interested.</p>
<p>The one good thing that came from this experiment is that I found out that using a zero-augmented summed area table can increase performance quite a bit. This is useful for <a href="http://code-spot.co.za/2010/04/16/simple-fast-approximate-minimum-maximum-filters/">max-filters</a> and other algorithms that use these tables.</p>
<p>You can download the source code:</p>
<p><a href="http://www.code-spot.co.za/downloads/cpp/Quadtree.zip">Quadtree.zip</a> (44 KB, Visual Studio).</p>
<p>(It requires the <a href="http://www.boost.org/users/download/">boost library</a> for concept checking, but nothing else. Everything will still work if you remove all references to the boost library. If you already have boost, just hook up to the include path in Visual Studio).</p>
<p>&#8230;or read the <a href="http://www.code-spot.co.za/downloads/cpp/quadtrees/html/index.html">online documentation</a>.</p>


<p>Related posts:<ol><li><a href='http://code-spot.co.za/2008/10/06/quadtrees/' rel='bookmark' title='Permanent Link: Quadtrees'>Quadtrees</a></li>
<li><a href='http://code-spot.co.za/2008/11/15/quadtrees-2/' rel='bookmark' title='Permanent Link: Quadtrees'>Quadtrees</a></li>
<li><a href='http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/' rel='bookmark' title='Permanent Link: A simple texture algorithm – faster code and more results'>A simple texture algorithm – faster code and more results</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://code-spot.co.za/2010/06/15/region-quadtrees-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A simple texture algorithm – faster code and more results</title>
		<link>http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/</link>
		<comments>http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 11:22:29 +0000</pubDate>
		<dc:creator>herman.tulleken</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Image Processing]]></category>
		<category><![CDATA[2D]]></category>
		<category><![CDATA[blend animation]]></category>
		<category><![CDATA[blending]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[Perlin noise]]></category>
		<category><![CDATA[procedural texture]]></category>
		<category><![CDATA[prototyping]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://code-spot.co.za/?p=396</guid>
		<description><![CDATA[Faster Code A while back I wrote about a simple texture algorithm that I have been exploring. The Python implementation was very slow – so much, that I decided to implement it in C++ to see what performance gain I would get. Surprisingly, the C++ version is about 100 faster, if not more. I expected [...]


Related posts:<ol><li><a href='http://code-spot.co.za/2008/11/14/a-simple-procedural-texture-algorithm-more-results-and-code/' rel='bookmark' title='Permanent Link: A Simple Procedural Texture Algorithm &#8211; More Results and Code'>A Simple Procedural Texture Algorithm &#8211; More Results and Code</a></li>
<li><a href='http://code-spot.co.za/2008/11/07/a-simple-procedural-texture-algorithm/' rel='bookmark' title='Permanent Link: A Simple Procedural Texture Algorithm'>A Simple Procedural Texture Algorithm</a></li>
<li><a href='http://code-spot.co.za/python-image-code/' rel='bookmark' title='Permanent Link: Python Image Code'>Python Image Code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/header.png" alt="header" width="500" height="348" /></p>
<h2>Faster Code</h2>
<p>A while back I wrote about a <a href="http://code-spot.co.za/2008/11/07/a-simple-procedural-texture-algorithm/">simple texture algorithm</a> that I have been exploring. The <a href="http://code-spot.co.za/2008/11/14/a-simple-procedural-texture-algorithm-more-results-and-code/">Python implementation</a> was <a href="http://code-spot.co.za/2008/11/11/5-tips-for-prototyping-slow-algorithms/">very slow</a> – so much, that I decided to implement it in C++ to see what performance gain I would get. Surprisingly, the C++ version is about 100 faster, if not more. I expected a decent increase, but what once took several hours can now be done in a minute!</p>
<p><span id="more-396"></span></p>
<p>Not all of the performance gain is because of using C++ instead of Python. The Python version uses a data structure (an <a href="http://www.code-spot.co.za/downloads/python_image_code/doc/html/namespaceenhanced__grid.html">“enhanced” grid</a>) that provides a lot of fancy syntax for operating on a grid. For instance:</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td width="97" valign="top">grid[0, ...]</td>
<td width="400" valign="top">First column (1D)</td>
</tr>
<tr>
<td width="97" valign="top">grid[..., 1]</td>
<td width="400" valign="top">Second row (1D)</td>
</tr>
<tr>
<td width="97" valign="top">grid[0, ::2]</td>
<td width="400" valign="top">Every second item of the first column (1D)</td>
</tr>
<tr>
<td width="97" valign="top">grid[1:3,::2]</td>
<td width="400" valign="top">Every second item of the second and third column (2D)</td>
</tr>
<tr>
<td width="97" valign="top">grid[3, 4]</td>
<td width="400" valign="top">The item at the fourth column and fifth row (0D)</td>
</tr>
</tbody>
</table>
<p>The “enhanced” grid also provides several iterators that allow easy processing, for example:</p>
<ul>
<li>a cell iterator, that iterates over all values in the grid;</li>
<li>an index iterator, that iterates over all possible tuples that can be used to index the grid; and</li>
<li>a window iterator, that iterates over all cells in a rectangular portion of the grid.</li>
</ul>
<p>The speed problem is caused by the implementation that supports the above features – an implementation that I thought was rather elegant. I knew there was a performance penalty, but after seeing to what extent I realise that I must have a hard look at how these features are implemented.</p>
<p>I am a big fan of late optimisation, especially for experimental code. But this incident has made me re-evaluate my position. After I had the fast C++ version running, I could do hordes of experiments very quickly – which meant I got a much better intuition of how parameters influence the resulting texture.</p>
<p>It also made me realise how important it is to check the performance of supporting data structures, even if they are merely convenience structures in non-production code (as is the “enhanced” grid).</p>
<h2>More results</h2>
<p>One of the things that struck me about the textures that this algorithm typically produces is the shapes of blotches of similar colour. I have been trying to enhance (and take advantage) these shapes by applying various filters on the texture; below are the results.</p>
<table border="0" cellspacing="0" cellpadding="2" width="500">
<tbody>
<tr>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/original.png" alt="original" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/water.png" alt="water" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/brown.png" alt="brown" width="160" height="160" /></td>
</tr>
<tr>
<td width="166" valign="top">Original (generated from a random 5&#215;5 matrix)</td>
<td width="166" valign="top">Dilation</td>
<td width="166" valign="top">Posterisation</td>
</tr>
<tr>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/sobel.png" alt="sobel" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/sobel-median.png" alt="sobel_median" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/edge.png" alt="edge" width="160" height="160" /></td>
</tr>
<tr>
<td width="166" valign="top">Sobel edge detection</td>
<td width="166" valign="top">Median filter and Sobel edge detection</td>
<td width="166" valign="top">Median filter, differential edge detection</td>
</tr>
<tr>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/emboss.png" alt="emboss" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/alien.png" alt="alien" width="160" height="160" /></td>
<td width="166" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/green.png" alt="green" width="160" height="160" /></td>
</tr>
<tr>
<td width="166" valign="top">Emboss</td>
<td width="166" valign="top">Alien (Gimp filter)</td>
<td width="166" valign="top">Median filter.</td>
</tr>
</tbody>
</table>
<p>The texture is also suitable for organic blend animations (compare with organic blending using <a href="http://www.luma.co.za/labs/2008/01/20/perlin-noise/" class="broken_link">Perlin noise</a>).</p>
<table border="0" cellspacing="0" cellpadding="0" width="500">
<tbody>
<tr>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t1.png" alt="t1" width="80" height="80" /></td>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t2.png" alt="t2" width="80" height="80" /></td>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t3.png" alt="t3" width="80" height="80" /></td>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t4.png" alt="t4" width="80" height="80" /></td>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t5.png" alt="t5" width="80" height="80" /></td>
<td width="83" valign="top"><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t6.png" alt="t6" width="80" height="80" /></td>
</tr>
</tbody>
</table>
<p><img src="http://code-spot.co.za/blog/wp-content/uploads/2008/12/t1.gif" alt="t1" width="160" height="160" /></p>
<h2>Download</h2>
<h3>C++ Implementation</h3>
<p><a href="http://www.code-spot.co.za/downloads/cpp_examples/cpp_texture.zip">cpp_texture.zip</a> (1.78 MB) (Visual Studio Solution)</p>
<p>The example uses <a href="http://pngwriter.sourceforge.net/">PNG Writer</a> , <a href="http://www.libpng.org/">libpng</a> and <a href="http://www.zlib.net/">zlib</a> (library files included with the download).</p>


<p>Related posts:<ol><li><a href='http://code-spot.co.za/2008/11/14/a-simple-procedural-texture-algorithm-more-results-and-code/' rel='bookmark' title='Permanent Link: A Simple Procedural Texture Algorithm &#8211; More Results and Code'>A Simple Procedural Texture Algorithm &#8211; More Results and Code</a></li>
<li><a href='http://code-spot.co.za/2008/11/07/a-simple-procedural-texture-algorithm/' rel='bookmark' title='Permanent Link: A Simple Procedural Texture Algorithm'>A Simple Procedural Texture Algorithm</a></li>
<li><a href='http://code-spot.co.za/python-image-code/' rel='bookmark' title='Permanent Link: Python Image Code'>Python Image Code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://code-spot.co.za/2008/12/15/a-simple-texture-algorithm-faster-code-and-more-results/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

