<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Manuel's Coding Blog</title>
	
	<link>http://manuel.bit-fire.com</link>
	<description />
	<lastBuildDate>Sun, 27 Jun 2010 12:35:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bit-fire" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="bit-fire" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Introducing WonderSharper</title>
		<link>http://manuel.bit-fire.com/2009/07/26/introducing-wondersharper/</link>
		<comments>http://manuel.bit-fire.com/2009/07/26/introducing-wondersharper/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 10:55:22 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[photography]]></category>
		<category><![CDATA[sharpening]]></category>
		<category><![CDATA[wondersharper]]></category>
		<category><![CDATA[computational]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[Farbman]]></category>
		<category><![CDATA[Fattal]]></category>
		<category><![CDATA[least]]></category>
		<category><![CDATA[Lischinski]]></category>
		<category><![CDATA[preserving]]></category>
		<category><![CDATA[smoothing]]></category>
		<category><![CDATA[squares]]></category>
		<category><![CDATA[Szeliski]]></category>
		<category><![CDATA[weighted]]></category>
		<category><![CDATA[wls]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=239</guid>
		<description><![CDATA[So i&#8217;ve been busy working on a photographic tool and i&#8217;m moving toward the first final release: it isn&#8217;t ready for the general public as of yet, and still we need some more beta testing, but we are on track. I decided to push the project and discuss something out with the cool guys behind]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft marginTop liteborder" style="padding: 12px;" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/aboutlogo.png" alt="" />So i&#8217;ve been busy working on a photographic tool and i&#8217;m moving toward the first final release: it isn&#8217;t ready for the general public as of yet, and still we need some more beta testing, but we are on track. I decided to push the project and discuss something out with the cool guys behind <a href="http://f4f-creative.it">the company i work for</a> so we arranged things a bit in order to start working on it by the beginning of May&#8230; and here we are, with our very first software production, <a href="http://wondersharper.com/"><strong>WonderSharper</strong></a>. Considering our primary food-feeding business are websites, packaging and branding, this new company&#8217;s project could be very well the starting point for some other interesting opportunities. Indeed this also imply quite some thinking on about <strong>how</strong> to effectively manage projects that are <strong>so</strong> different, with different priorities and, especially, of different <strong>nature</strong>; this is nothing new, of course, and sure we are going to tackle the problem by some strategic thinking, also because, hopefully, we intend to pursue some other software markets as well in the near future.</p>
<h3>YET ANOTHER SHARPENING TOOL?!</h3>
<p>Absolutely not! The primary goal of WonderSharper is to empower both the photographic professionals and the casual user with a simple tool to enable them to perform <em>halo-free</em> (given an halo-free source image, of course!), <em>edge-preserving</em>, <em>multi-scale</em> sharpening and <em>detail mapping</em> while maintaining a really simple and usable interface.<img class="alignright marginTop liteborder" style="padding: 6px;" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/detail_manipulation.png" alt="" /><br />
WonderSharper <em>absolutely loves</em> your edges and contours, it will accurately preserves them, no matter what: the amount of &#8220;percepted detail&#8221; at various <em><strong>individual</strong></em> scales can be changed and modulated via its simple interface, but that&#8217;s just the beginning.<br />
In fact, the real power comes from the possibility to export the so-called <em>detail maps</em>: aimed to the photographic professionals, with those maps at hand you&#8217;ll acquire <em>detail manipulation </em>capabilities to be used <strong>outside</strong> of the WonderSharper UI: this will enable you to perform various, custom and complex transformations on the original image by using your existing tools, strongly encouraging the development of new detail manipulation techniques.</p>
<p>Due to the vastness and complexity of the subject it would be rather unfair to try to condense everything into one single post and, instead,  we are now going to have a look at WonderSharper&#8217;s <em>halo-free</em> capabilities with the help of some screenshots: <em>multi-scale sharpening</em> and <em>detail mapping </em>are the subjects of one or more forthcoming articles, written and edited with the cooperation of <a href="http://albertobua.com">Alberto</a>, introducing these very interesting features with real-world applications, so to have a more photographic perspective on it.</p>
<h3>HALO-FREE SHARPENING</h3>
<p>In order to better explain why WonderSharper is different and what halo-free means, let&#8217;s have a look at some sample results computed by using photos available on the web.<br />
The first batch of four details comes from the <a href="http://www.flickr.com/photos/stevegarfield/3197571945/sizes/o/">President Obama&#8217;s official portrait</a> (courtesy of Pete Souza, thanks to <a href="http://www.flickr.com/photos/stevegarfield/">stevegarfield</a>), the second batch of details, instead, comes from <a href="http://web.canon.jp/imaging/eosd/eos5dm2/html/sample1_e.html">Canon&#8217;s demonstrative sample photos</a> of the EOS 5D Mark II camera (Copyright 2008 Canon Inc.) while the third one is a photo that&#8217;s part of a wedding photo shooting service performed with a Canon EOS 30D (courtesy of <a href="http://pixnoize.com/">Alberto Bua</a>, available on <a href="http://www.flickr.com/photos/apwizard/320818780/sizes/o/">Flickr</a>).<br />
Note that the enlarged detail images of the first two batches have been intentionally zoomed in (400%) so to have a clear view of the differences at pixel level, while the last batch, instead, depicts the situation on a bigger area.</p>
<h4>Barack Obama Official Portrait</h4>
<p>In this first batch of samples, at the first row, you can clearly note various aberrations, halos and color noises in both the &#8220;Sharpen&#8221; and &#8220;Unsharp Mask&#8221; filters applied by GIMP: color aberrations (green/cyan) on the flag&#8217;s red lines are easily spotted and the dark background also presents colored noise; these aberrations aren&#8217;t present in the WonderSharper result.</p>
<table class="centeredTable" border="0" cellspacing="8" cellpadding="2">
<tbody>
<tr>
<th>Source Image</th>
<th>Gimp&#8217;s Sharpen</th>
<th>Gimp&#8217;s Unsharp Mask</th>
<th>WonderSharper</th>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 1" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 1" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 1" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 1" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_1_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 2" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 2" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 2" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 2" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_2_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 3" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 3" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 3" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 3" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_3_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 4" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 4" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 4" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 4" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/obama_detail_4_wspro.png" alt="WonderSharper" width="100" height="100" /> </a></td>
</tr>
</tbody>
</table>
<p>Note how these local micro-contrasts variations, between the source image and the WonderSharper output slighty affect the whole chromaticity and color perception: although not depicted here, WonderSharper gives you some degree of control over the output image enabling you to control the saturation levels in the CiELab color space so that the lightness remains untouched.</p>
<h4>Canon EOS 5D Mark II Sample photo</h4>
<table class="centeredTable" style="width: 610px;" border="0" cellspacing="8" cellpadding="2">
<tbody>
<tr>
<th>Source Image</th>
<th>Gimp&#8217;s Sharpen</th>
<th>Gimp&#8217;s Unsharp Mask</th>
<th>WonderSharper</th>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 5" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 5" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 5" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 5" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_1_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 6" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 6" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 6" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 6" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_2_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 7" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 7" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 7" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 7" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_3_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 8" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Sharpen" rel="Detail 8" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_gimp_sharpen_big.png"><img class="size-full" title="GIMP's sharpen" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_gimp_sharpen.png" alt="GIMP's Sharpen" width="100" height="100" /></a></td>
<td><a class="fancybox" title="GIMP's Unsharp Mask" rel="Detail 8" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_gimp_unsharpmask_big.png"><img class="size-full" title="GIMP's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_gimp_unsharpmask.png" alt="GIMP's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 8" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/portrait_detail_4_wspro.png" alt="WonderSharper" width="100" height="100" /> </a></td>
</tr>
</tbody>
</table>
<h4>Canon EOS 30D Sample photo</h4>
<table class="centeredTable" style="width: 610px;" border="0" cellspacing="8" cellpadding="2">
<tbody>
<tr>
<th>Source Image</th>
<th>Adobe Photoshop&#8217;s<br />
Unsharp Mask</th>
<th>WonderSharper</th>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 9" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="Adobe Photoshop's Unsharp Mask" rel="Detail 9" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_ps_unsharpmask_big.png"><img class="size-full" title="Adobe Photoshop's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_ps_unsharpmask.png" alt="Adobe Photoshop's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 9" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_1_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 10" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="Adobe Photoshop's Unsharp Mask" rel="Detail 10" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_ps_unsharpmask_big.png"><img class="size-full" title="Adobe Photoshop's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_ps_unsharpmask.png" alt="Adobe Photoshop's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 10" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_2_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 11" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="Adobe Photoshop's Unsharp Mask" rel="Detail 11" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_ps_unsharpmask_big.png"><img class="size-full" title="Adobe Photoshop's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_ps_unsharpmask.png" alt="Adobe Photoshop's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 11" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_3_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
<tr>
<td><a class="fancybox" title="Source image" rel="Detail 12" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_original_big.png"><img class="size-full" title="Source image" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_original.png" alt="Source image" width="100" height="100" /></a></td>
<td><a class="fancybox" title="Adobe Photoshop's Unsharp Mask" rel="Detail 12" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_ps_unsharpmask_big.png"><img class="size-full" title="Adobe Photoshop's Unsharp Mask" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_ps_unsharpmask.png" alt="Adobe Photoshop's Unsharp Mask" width="100" height="100" /></a></td>
<td><a class="fancybox" title="WonderSharper" rel="Detail 12" href="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_wspro_big.png"><img class="size-full" title="WonderSharper" src="http://manuel.bit-fire.com/wp-content/uploads/2009/07/wedding_detail_4_wspro.png" alt="WonderSharper" width="100" height="100" /></a></td>
</tr>
</tbody>
</table>
<p><em><strong>Note: </strong>the source materials used herein are properties of their respective owners, if you hold the copyright and want your photo removed please let me know.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2009/07/26/introducing-wondersharper/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation</title>
		<link>http://manuel.bit-fire.com/2009/03/21/edge-preserving-decompositions-for-multi-scale-tone-and-detail-manipulation/</link>
		<comments>http://manuel.bit-fire.com/2009/03/21/edge-preserving-decompositions-for-multi-scale-tone-and-detail-manipulation/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 22:50:29 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[computational]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[Farbman]]></category>
		<category><![CDATA[Fattal]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Lischinski]]></category>
		<category><![CDATA[multi]]></category>
		<category><![CDATA[preserving]]></category>
		<category><![CDATA[scale]]></category>
		<category><![CDATA[sharpen]]></category>
		<category><![CDATA[sharpening]]></category>
		<category><![CDATA[smoothing]]></category>
		<category><![CDATA[Szeliski]]></category>
		<category><![CDATA[wls]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=199</guid>
		<description><![CDATA[&#8230;or more simply, sharpen on steroids. It was three weeks ago when my brother Alberto told me about a quite new paper entitled Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation [Lischinski et al. 2008]: in fact we had a talk or two about general photographic techniques some days before and, since i&#8217;m interested in]]></description>
			<content:encoded><![CDATA[<p>&#8230;or more simply, <em>sharpen on steroids</em>.<br />
It was three weeks ago when my brother <a href="http://pixnoize.com/">Alb</a><a href="http://flickr.com/apwizard">erto</a> told me about a quite new paper entitled <a href="http://www.cs.huji.ac.il/~danix/epd/epd.pdf">Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation</a> [Lischinski et al. 2008]: in fact we had a talk or two about general photographic techniques some days before and, since i&#8217;m interested in the computational side of the subject, i asked him to let me know more about it whenever he got the chance, and so he did.<br />
He was reading a <a href="http://www.bigano.com/index.php/en/consulting/40-davide-barranca/90-davide-barranca-notes-on-sharpening.html">Davide Barranca&#8217;s article</a> explaining the basics of image sharpening and exposing various different methods in order to achieve it, so that one can manage to construct his own sharpening strategy, depending on his needs: the aforementioned paper is being referred by the article due to the fact that the new technique demonstrates how it is possible to make use of a better edge-preserving operator called WLS (or <strong>w</strong>eighted <strong>l</strong>east <strong>s</strong>quares) that leads to <strong>better</strong> results with <strong>lot less artifacts</strong> and permitting detail manipulation at <strong>arbitrary scales</strong>: by looking at some sample images produced with it (and published on the <a href="http://www.cs.huji.ac.il/~danix/">Lischinski</a> project page <a href="http://www.cs.huji.ac.il/~danix/epd/">here</a>) i instantly grasped what my brother&#8217;s excitement was about and decided i needed to know more about it: i was so eager to dive into it to the point i didn&#8217;t even noticed there was an example movie right there to see more of it!</p>
<p>Anyhow, considering <em>computational photography</em> was a brand-new field to me, i&#8217;m rather satisfied with the results: the sharpen is polished and the gain in both detail and depth level are impressive, while trying to intentionally cause artifacts is somewhat difficult, in the sense one have to boost detail frequencies to rather extreme values in order to cause artifacts and chromatic aberrations: in fact, considering the way actual tools currently work, i wonder why WLS-based strategies have still to take the lead in well-known commercial applications.</p>
<p>Unfortunately, as you may already know, i don&#8217;t have much free time to dedicate to most of the things i&#8217;m interested in, so this post is sort of an introduction while the rest will follows: it could take a while for me to write more about it, but i&#8217;ll try to share the time between coding and blogging, in the meantime i&#8217;m posting some results with it, but please, don&#8217;t laugh at the GUI too badly, its still all of an experimental thing and it&#8217;s just.. well.. usable ;-P<br />
Note that the videos here don&#8217;t give justice to the real results due to the compression going on with both the Xvid codec and YouTube, so look at the HD version if you can.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_gv6Xw3hQgeQ&amp;hl=en&amp;fs=1_1793426983"
			class="flashmovie"
			width="480"
			height="221">
	<param name="movie" value="http://www.youtube.com/v/gv6Xw3hQgeQ&amp;hl=en&amp;fs=1" />
	<param name="allowfullscreen" value="true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.youtube.com/v/gv6Xw3hQgeQ&amp;hl=en&amp;fs=1"
			name="fm_gv6Xw3hQgeQ&amp;hl=en&amp;fs=1_1793426983"
			width="480"
			height="221">
		<param name="allowfullscreen" value="true" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>The following video try to demonstrate some more detail exaggeration:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_jsjtRfEQgac&amp;hl=en&amp;fs=1_123852763"
			class="flashmovie"
			width="480"
			height="221">
	<param name="movie" value="http://www.youtube.com/v/jsjtRfEQgac&amp;hl=en&amp;fs=1" />
	<param name="allowfullscreen" value="true" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.youtube.com/v/jsjtRfEQgac&amp;hl=en&amp;fs=1"
			name="fm_jsjtRfEQgac&amp;hl=en&amp;fs=1_123852763"
			width="480"
			height="221">
		<param name="allowfullscreen" value="true" />
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2009/03/21/edge-preserving-decompositions-for-multi-scale-tone-and-detail-manipulation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Happy New Year!</title>
		<link>http://manuel.bit-fire.com/2009/01/01/happy-new-year/</link>
		<comments>http://manuel.bit-fire.com/2009/01/01/happy-new-year/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 17:40:21 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=191</guid>
		<description />
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-192 aligncenter" title="Happy New Year!" src="http://manuel.bit-fire.com/wp-content/uploads/2009/01/hny.jpg" alt="Happy New Year!" /></p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2009/01/01/happy-new-year/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Compiz-like wobbling windows in AS3</title>
		<link>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/</link>
		<comments>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:01:09 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[hydra]]></category>
		<category><![CDATA[compiz]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[wobble]]></category>
		<category><![CDATA[wobbling]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=128</guid>
		<description><![CDATA[This code was intended to be released back in October last year, but i never managed to do it since it needed some refactoring, some changes and had to be quite decent to present: then in November i got the chance to work with some very talented guys over at Jooce, in Paris, so i]]></description>
			<content:encoded><![CDATA[<p>This code was intended to be released back in October last year, but i never managed to do it since it needed some refactoring, some changes and had to be quite decent to present: then in November i got the chance to work with some very talented guys over at <a title="Jooce! Try it, it's seriously cool!" href="http://jooce.com/">Jooce</a>, in Paris, so i never got back to write something about it.<br />
<em> Btw, if you never tried Jooce then give it a try, it really deserves it!</em><br />
<span id="more-128"></span><br />
While there, i used portions of this code to derive something from it and while working on that for some time i realized some key points for optimizations but i&#8217;m not going to share more details with you about that, since the NDA i agreed to sign doesn&#8217;t allow me to do that: i&#8217;ve to say this version is therefore unoptimized and proof-of-concept, especially for the real window drawings: in fact, i just did some cleanup before packaging it, but since i don&#8217;t plan to put some time on it sooner, better i publish it as-is, or it will lie on my disk for the next few months for sure.</p>
<p>The idea was to build the foundation for a fancy, compositing-based windowing system: beside the actual implementation that&#8217;s basically just <em>wobbling</em> the current target, i&#8217;m sure you&#8217;ll be able to come up with other effects as well, but that&#8217;s not the real point.<br />
Setting aside the concrete animator implementation that would be better to be used as a base to derive some more abstract definitions from it, the architecture is quite open to new approaches and ideas, especially for the ultra-simple opengl-like interface i chosen for the rasterizer that let&#8217;s you prototype things quite fast:</p>
<pre>
<pre class="brush: cpp;">
package rasterizer
{
	import flash.display.Sprite;
	import flash.display.BitmapData;
	import rasterizer.data.*;

	/**
	 * OpenGL-like interface for a generic rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer
	{
		function glTexture( tex: BitmapData, forceRecreate: Boolean = false, smooth: Boolean = false ): void;
		function glSetTarget( aTarget: Sprite ): void;

		function glBegin( rasterMode: int ): void;
		function glEnd(): void;

		function glPresent( aTarget: Sprite = null ): void;
	}

	/**
	 * OpenGL-like interface for a generic 2D rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer2D extends IRasterizer
	{
		function glVertex( vertex: Vertex2, uv: Vertex2 ): void;
	}

	/**
	 * OpenGL-like interface for a generic 3D rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer3D extends IRasterizer
	{
		function glVertex( vertex: Vertex3, uv: Vertex2 ): void;
	}
}
</pre>
</pre>
<p>Portions of the actual wobble animator took inspiration from the previous <a href="http://manuel.bit-fire.com/2007/08/10/the-magic-carpet/">Magic Carpet</a> demo and some stuff i found on the net: if you come up with some other effects let me know, i&#8217;ll be happy to link back to them!<br />
Here you can play with a basic demo i setup to try it out or get the <a title="AS3 Wobbling windows demo" href="http://manuel.bit-fire.com/code/wobble_webdemo.zip">source code</a> to do your own experiments:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_wobble_demo_733090830"
			class="flashmovie"
			width="100%"
			height="480">
	<param name="movie" value="http://manuel.bit-fire.com/code/wobble_demo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://manuel.bit-fire.com/code/wobble_demo.swf"
			name="fm_wobble_demo_733090830"
			width="100%"
			height="480">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Apple and the iPhone Developer Program</title>
		<link>http://manuel.bit-fire.com/2008/09/04/apple-and-the-iphone-developer-program/</link>
		<comments>http://manuel.bit-fire.com/2008/09/04/apple-and-the-iphone-developer-program/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 00:16:05 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=129</guid>
		<description><![CDATA[The iPhone it&#8217;s quite a nice device to play games on: if it weren&#8217;t for the horror with which software developers willing to support the iPhone platform are welcomed: it&#8217;s cool, it&#8217;s great, it&#8217;s the &#8220;iPhone Developer Program&#8220;! Hoorah. Hoorah. Basically, it&#8217;s a brutally stupid, slogan-centric three-points-nothing-more way to express the act of developing software:]]></description>
			<content:encoded><![CDATA[<p>The iPhone it&#8217;s quite a nice device to play games on: if it weren&#8217;t for the horror with which software developers willing to support the iPhone platform are welcomed: it&#8217;s cool, it&#8217;s great, it&#8217;s the &#8220;<a href="http://developer.apple.com/iphone/program/">iPhone Developer Program</a>&#8220;!</p>
<p>Hoorah. Hoorah.</p>
<p>Basically, it&#8217;s a brutally stupid, slogan-centric three-points-nothing-more way to express the act of developing software: &#8220;<a href="http://developer.apple.com/iphone/program/">1. Develop, 2. Test, 3. Distribute</a>&#8220;.</p>
<p><span id="more-129"></span>That&#8217;s the <em>real</em> program:</p>
<ol>
<li>You pay, you get the iPhone, note this is <strong>not</strong> part of the program;</li>
<li>You pay, they let&#8217;s you develop (to do this you must have a Mac/Intel, <strong>not</strong> part of the program);</li>
<li> You pay, they let&#8217;s you test on the device at point 1;</li>
<li>You pay, they let&#8217;s you distribute it;</li>
<li>You distribute, you could possibly earn something, <strong>they earn</strong> (30%) from this too, damn, again!</li>
</ol>
<p>Let me analyze it a bit:</p>
<ol>
<li>Apple wanna grow, make big money and get some important user-base;</li>
<li>Users come if the platform has something interesting to offer;</li>
<li>A good platform-enrichment thing could be some software;</li>
<li>Software possibly needs to be <em>developed</em> (sometimes it also has to be <em>2. deployed and tested</em> on the real device, and ultimately i heard someone also tried to <em>3. sell it</em>);</li>
<li>Software developers, thus, are needed (they&#8217;ll invest money, time, patience and experience, just to develop);</li>
<li>Apple needs developers;</li>
<li>I. Already. Heard. That.</li>
<li>Developers decide to support the platform and write/port software for it (best case);</li>
<li>Developers willing to support the platform, implicitly favoring Apple and it&#8217;s platform, are asked to pay for doing this;</li>
</ol>
<p>Fortunately, there are great ways to overcome the need to make a living out of <em>bread and onions</em>: make an i-Developer a favor and make sure to get him to know about <a href="http://code.google.com/p/iphone-dev/">this</a>, <a href="http://hackint0sh.org/forum/forumdisplay.php?f=123">this</a>, also <a href="http://www.iphonedevforums.com/forum/index.php">this</a>, this <a href="http://www.iphonedevsdk.com/forum/">one</a> too, and.. <a href="http://iphonefreakz.com/2008/09/01/idevkit-iphone-development-forum/">this</a>.</p>
<p>Oh. And <a title="Last but not least" href="http://www.linux.org/">this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2008/09/04/apple-and-the-iphone-developer-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello…2008?!</title>
		<link>http://manuel.bit-fire.com/2008/09/04/hello2008/</link>
		<comments>http://manuel.bit-fire.com/2008/09/04/hello2008/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 23:14:47 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=121</guid>
		<description><![CDATA[I know that&#8217;s a whole year without posting anything but since i taken the previous version down i never got the time to setup it on another host and always missed the chance to get some time for me.. In fact, the past year has been really busy: work and daily life take so much]]></description>
			<content:encoded><![CDATA[<p>I know that&#8217;s a whole year without posting anything but since i taken the previous version down i never got the time to setup it on another host and always missed the chance to get some time for me..</p>
<p>In fact, the past year has been really busy: work and daily life take so much that sometimes you have to fight with yourself to squeeze out every possible free minute to do your own things, so one whole year has gone, but this doesn&#8217;t mean i don&#8217;t have something to write about, even better, i struggled to post about it from September, and i really mean September 2007, but <em>better late than never!</em></p>
<p>But what did i do in all this time without even posting a blank post in 300 days? Well, in fact, <a href="http://bit-fire.com">we</a> <a href="http://f4f-creative.it">are</a> not dead for sure, i&#8217;m working really hard on the cross-platform framework of some posts <a href="http://manuel.bit-fire.com/2006/11/02/pocketsand-on-the-way/">ago</a> and we hope to be able to work full-time on the game idea we had in the past and, best of all, on the iPhone!</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2008/09/04/hello2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fixed point math in pure CPP</title>
		<link>http://manuel.bit-fire.com/2007/10/31/fixed-point-math-in-pure-cpp/</link>
		<comments>http://manuel.bit-fire.com/2007/10/31/fixed-point-math-in-pure-cpp/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 20:35:15 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[fixed]]></category>
		<category><![CDATA[point.math]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=78</guid>
		<description><![CDATA[NOTE This post has been previously published on 2007/Oct/31: due to my move to another server i&#8217;m now in the process to manually recover the comments for this article. Fixed! Some time ago i was asked to publish my implementation of fixed-point math, mainly regarding embedded architectures where IEEE floating point computations have really bad]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;"><em><strong>NOTE</strong><br />
This post has been previously published on 2007/Oct/31: due to my move to another server i&#8217;m now in the process to manually recover the comments for this article.</em></span><em> Fixed!<br />
</em></p>
<p>Some time ago i was asked to publish my implementation of fixed-point math, mainly regarding embedded architectures where IEEE floating point computations have really bad performances. What i want to give you here is a pure-c++, template-based implementation of a fixed-point datatype: this thing is more of a test in order to see how much an object-oriented implementation can perform, being in contrast to a more <a href="http://members.aol.com/form1/fixed.htm">traditional implementation</a>. As expected, operator overloading and temporary object creation overhead are the main issues with a full-oo implementation as this one, anyway, its a damn nice way to exercise yourself in writing c++ policy-based templated code ;)</p>
<p><span id="more-78"></span><br />
Big thank you goes to <a href="http://www.guntheroth.com/">Kurt</a> for having a great discussion with me on c++, math and for recommending me the most wonderful book on computer arithmetic as <a href="http://www.amazon.com/Hackers-Delight-Henry-Warren-Jr/dp/0201914654">Hacker&#8217;s Delight</a> delivers it in spades!<br />
Back to the fp stuff: usage of this code in testing environments is advised, since it could contain rounding errors and sometimes explicit casts are needed to get it to work correctly; as i said, this was some sort of test, i abandoned the O-O idea when i ack the performances&#8217; gap between OO vs. traditional implementation was remarkable (at least on embedded devices).<br />
Before showing some usage guidelines, i should say that using this datatype on a desktop machine hasn&#8217;t much sense: nowadays floating-point math is faster than the integer&#8217;s one!<br />
The class itself predefines a 24.8 and a 16.16:</p>
<pre class="brush: cpp;">
typedef AquaFixed&lt; 8, LowPrecision,  LowPrecision&gt; fixed8_t;
typedef AquaFixed&lt;16, HighPrecision, HighPrecision&gt; fixed16_t;
</pre>
<p>An usage example could be a generic, datatype-unaware Matrix implementation as this one:</p>
<pre class="brush: cpp;">
template&lt;class Number&gt;
class matrix {
private:
Number m[4][4];
public:
matrix();

// matrix indexing
inline Number&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; operator()(const int,const int);

// matrix operations
matrix&lt;Number&gt; operator*(const matrix&lt;Number&gt;);
matrix&lt;Number&gt; operator/(const matrix&lt;Number&gt;);
};
</pre>
<p>Doing it this way, you should be able to declare a Matrix as here and perform your own tests:</p>
<pre class="brush: cpp;">
matrix&lt;float_t&gt; float_matrix;
matrix&lt;fixed16_t&gt; fixed_matrix;
</pre>
<p><em><strong>NOTE! </strong>The AquaFixed class comes out straight from my framework, so you&#8217;ll have to define basic datatypes such as <strong>int32_t</strong>/<strong>int64_t</strong> for yourself, but that shouldn&#8217;t be a problem.</em></p>
<p>Get the code <a href="http://manuel.bit-fire.com/code/aquafixed.h">here</a> and let me know of your tests!</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/31/fixed-point-math-in-pure-cpp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An AS3 profiler</title>
		<link>http://manuel.bit-fire.com/2007/10/17/an-as3-profiler/</link>
		<comments>http://manuel.bit-fire.com/2007/10/17/an-as3-profiler/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 20:14:50 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[profiler]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=72</guid>
		<description><![CDATA[NOTE This post has been previously published on 2007/Oct/17: due to my move to another server i&#8217;m now in the process to manually recover the comments for this article. Fixed! I&#8217;m currently working on an early-stage, more of a proof-of-concept thing, but i needed to know more about the code performances: googling for an ActionScript]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;"><em><strong>NOTE</strong><br />
This post has been previously published on 2007/Oct/17: due to my move to another server i&#8217;m now in the process to manually recover the comments for this article.</em></span><em> Fixed!</em></p>
<p>I&#8217;m currently working on an early-stage, more of a proof-of-concept thing, but i needed to know more about the code performances: googling for an ActionScript profiler just showed up <a title="ASProf" href="http://www.nochump.com/asprof/">ASProf</a>, an AS2 profiler. So i decided to port to AS3 the C++ profiler i wrote for Aqua, the cross-platform framework i was working on until April: the original C++ implementation has been developed after being inspired by an article of <a title="Steve Rabin" href="http://www.aiwisdom.com/home_webmaster.html">Steve Rabin</a> in the <a title="GPG#1" href="http://www.gameprogramminggems.com/">Game Programming Gems 1</a> book, that&#8217;s a nice one to have on the shelf together with some other great books of which i could post something about them later.<br />
It is always wise to remember that if you are serious about code profiling, you&#8217;ll be better to search for some professional tools: in the C++ arena my choice would be <a title="Compuware DevPartner" href="http://www.compuware.com/products/devpartner/visualc.htm">this one</a>, but if you plan to have lunch and dinner for the next couple of months give <a title="GlowCode" href="http://www.glowcode.com/summary.htm">Eletric&#8217;s one</a> a try, it really deserves a look.<br />
Unfortunately for the AS3 world, i just haven&#8217;t found anything really usable for it up to now, so i just thought to release it under a zlib/png license and some hints on how it works here.</p>
<pre class="brush: cpp;">
ProfilerConfig.Width = stage.stageWidth;
ProfilerConfig.ShowMinMax = true;
prof = new Profiler( 32 );
addChild( prof );
</pre>
<p><span id="more-72"></span></p>
<p>Setup some custom configuration parameters and then create a Profiler and don&#8217;t forget to add it to your local render queue: the Profiler its a Sprite and it will render the results right there, all you have to do now is to profile some code:</p>
<pre class="brush: cpp;">
var i: int = 0;
var it: int = 1000000;

prof.beginProfiling();

i = it;
prof.begin( &quot;fadd&quot; );
while( i-- ) { fRes += 1.; }
prof.end( &quot;fadd&quot; );

i = it;
prof.begin( &quot;iadd&quot; );
while( i-- ) { iRes += 1; }
prof.end( &quot;iadd&quot; );

i = it;
prof.begin( &quot;fsub&quot; );
while( i-- ) { fRes -= 1.; }
prof.end( &quot;fsub&quot; );

i = it;
prof.begin( &quot;isub&quot; );
while( i-- ) { iRes -= 1; }
prof.end( &quot;isub&quot; );

prof.endProfiling();
</pre>
<p>With another couple of lines of code you&#8217;ll end up with something like this:</p>
<p><a href="http://manuel.bit-fire.com/wp-content/uploads/2008/09/profiler.png"><img class="alignnone size-medium wp-image-73" title="profiler" src="http://manuel.bit-fire.com/wp-content/uploads/2008/09/profiler.png" alt="" width="498" height="246" /></a></p>
<p>Cool graphing for your function-timing needs ;)<br />
And this is it!<br />
A thing i may point out is that you can always group code fragments belonging to your most logical schema by wrapping the same ProfileNode around the different fragments; here i&#8217;m grouping math operations by their type, just to keep the call-graph a little bit organized:</p>
<pre class="brush: cpp;">
var i: int = 0;
var it: int = 1000000;

prof.beginProfiling();

i = it;
prof.begin( &quot;float&quot;, true );
prof.begin( &quot;fadd&quot; );
while( i-- ) { fRes += 1.; }
prof.end( &quot;fadd&quot; );
prof.end( &quot;float&quot; );

i = it;
prof.begin( &quot;int&quot;, true );
prof.begin( &quot;iadd&quot; );
while( i-- ) { iRes += 1; }
prof.end( &quot;iadd&quot; );
prof.end( &quot;int&quot; );

i = it;
prof.begin( &quot;float&quot;, true );
prof.begin( &quot;fsub&quot; );
while( i-- ) { fRes -= 1.; }
prof.end( &quot;fsub&quot; );
prof.end( &quot;float&quot; );

i = it;
prof.begin( &quot;int&quot;, true );
prof.begin( &quot;isub&quot; );
while( i-- ) { iRes -= 1; }
prof.end( &quot;isub&quot; );
prof.end( &quot;int&quot; );

prof.endProfiling();
</pre>
<p><a href="http://manuel.bit-fire.com/wp-content/uploads/2008/09/profiler_grouped.png"><img class="alignnone size-full wp-image-74" title="profiler_grouped" src="http://manuel.bit-fire.com/wp-content/uploads/2008/09/profiler_grouped.png" alt="" width="498" height="246" /></a></p>
<p>That&#8217;s all there is to it, hope it will be useful!<br />
Grab the Profiler <a href="http://manuel.bit-fire.com/code/as3_profiler.zip">here</a> and take a look at the <a href="http://manuel.bit-fire.com/code/as3_profiler_demo.as">demo code</a> used for this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/17/an-as3-profiler/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Hydra considerations</title>
		<link>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/</link>
		<comments>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 15:32:44 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[hydra]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[kernel filters]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/10/03/hydra-considerations/</guid>
		<description><![CDATA[While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release: it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel]]></description>
			<content:encoded><![CDATA[<p>While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release:</p>
<ul>
<li> it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel as <a href="http://manuel.bit-fire.com/code/testfilter.hydra">here</a>, select two images and refresh; you should be now looking at the image you loaded via &#8220;Load Image 2&#8230;&#8221;: now rename &#8220;in image4 srca&#8221; to be &#8220;in image4 srcc&#8221; and refresh. Wrongly, you are now looking at the first image</li>
<li>the GUI doesn&#8217;t release cpu/gpu resources while minimized in order to relieve the machine from the rendering process</li>
</ul>
<p>Aside that, i&#8217;m looking forward to try all this cool stuff with <a href="http://labs.adobe.com/wiki/index.php/Astro">Astro</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hydra is here!</title>
		<link>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/</link>
		<comments>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 15:12:20 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[hydra]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[kernel filters]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/10/02/hydra-is-here/</guid>
		<description><![CDATA[Finally the Adobe team released the Hydra&#8217;s tech-preview package, available for download right here: reading the documentation, there are some cool things that aren&#8217;t expected to work in the Flash player, anyway Hydra signify a huge step forward for the Flash technology, enabling the next Flash Player for custom bitmap filters, blend modes and a]]></description>
			<content:encoded><![CDATA[<p><a title="Glassy look through" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/glassy.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/glassy.thumbnail.jpg" alt="Glassy look through" width="128" height="122" /></a><br />
Finally the Adobe team released the Hydra&#8217;s tech-preview package, available for download right <a title="Hydra" href="http://labs.adobe.com/wiki/index.php/AIF_Toolkit">here</a>: reading the documentation, there are some cool things that aren&#8217;t expected to work in the Flash player, anyway Hydra signify a huge step forward for the Flash technology, enabling the next Flash Player for custom bitmap filters, blend modes and a bunch of <a href="http://blogs.adobe.com/kevin.goldsmith/2007/10/its_alive_hydra.html">exciting new stuff</a>! Also, congrats to <a href="http://blog.je2050.de/2007/10/01/hydra/">Joa</a> as he wrote <a href="http://blogs.adobe.com/kevin.goldsmith/2007/10/joa_ebert_becom.html">the first non-Adobe hydra filter</a>!</p>
<p>I had some difficulties installing the package since it was keep asking to terminate another Adobe installation, anyway i managed to install the beast and give it a try: i wanted to simulate a &#8220;glassy look-through&#8221; effect (as you are watching something outside of a glass door): it goes without saying there is the need to use some of the &#8220;region needed&#8221; magic in order to crop the black borders out, but i have no time at the moment, so here it is.<br />
In order to use this filter you&#8217;ll have to <a title="Glassy look-through" href="http://manuel.bit-fire.com/code/glassy.hydra">download the kernel source</a> and these three images:</p>
<p><a title="Shower" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/shower.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/shower.thumbnail.jpg" alt="Shower" /></a><a title="Normal1" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal1.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal1.thumbnail.jpg" alt="Normal1" /></a><a title="Normal2" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal2.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal2.thumbnail.jpg" alt="Normal2" /></a></p>
<p style="clear: both; padding-top: 5px">Basically, once you launched the AIF Toolkit, you load the hydra source, then the <strong>shower</strong> as the <em>first image</em>, and then choose one of the two <strong>normal maps</strong> as the <em>second image</em>, press <strong>F5</strong> and try play with the parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
