<?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>Manuel&#039;s Coding Blog &#187; dev</title>
	<atom:link href="http://manuel.bit-fire.com/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://manuel.bit-fire.com</link>
	<description></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>
		<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_88512838"
			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_88512838"
			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_1446782242"
			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_1446782242"
			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>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_1255117767"
			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_1255117767"
			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>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>
		<item>
		<title>Flash Player v9.0.60.184</title>
		<link>http://manuel.bit-fire.com/2007/08/21/flash-player-v9060184/</link>
		<comments>http://manuel.bit-fire.com/2007/08/21/flash-player-v9060184/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 21:15:48 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/08/21/flash-player-v9060184/</guid>
		<description><![CDATA[It seems that with the r60.184 version the vertical bar thing went away, anyway still remains that very new singularity ;)]]></description>
			<content:encoded><![CDATA[<p>It seems that with the r60.184 version the vertical bar thing went away, anyway still remains <a href="http://manuel.bit-fire.com/2007/08/20/noticeable-difference/">that very new</a> singularity ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/08/21/flash-player-v9060184/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Noticeable difference</title>
		<link>http://manuel.bit-fire.com/2007/08/20/noticeable-difference/</link>
		<comments>http://manuel.bit-fire.com/2007/08/20/noticeable-difference/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 22:42:09 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flash player problem]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/08/20/noticeable-difference/</guid>
		<description><![CDATA[I haven&#8217;t had much time to test things out, but i managed to put together an ultra simple example on how 9.0.47 and 9.0.60.120 perform differently. This is the original image i&#8217;ve used to setup things: Here is the difference in rendering between Flash Player versions (image): I have no way to tell if it]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t had much time to test things out, but i managed to put together an ultra simple example on how 9.0.47 and 9.0.60.120 perform differently. This is the original image i&#8217;ve used to setup things:</p>
<p><a title="Original image" href="http://manuel.bit-fire.com/wp-content/uploads/2007/08/f4f.jpg"><img src="http://manuel.bit-fire.com/wp-content/uploads/2007/08/f4f.jpg" alt="Original image" /></a></p>
<p><span id="more-51"></span>Here is the difference in rendering between Flash Player versions (image):</p>
<p><a title="Differences" href="http://manuel.bit-fire.com/wp-content/uploads/2007/08/vm_diff.png"><img src="http://manuel.bit-fire.com/wp-content/uploads/2007/08/vm_diff.png" alt="Differences" /></a></p>
<p>I have no way to tell if it is the cause of the singularities i talked about in my previous posts (vertical bar / mid-height correct), nevertheless they perform differently.<br />
Anyone can confirm me this behavior?</p>
<p>Demo (swf):</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bmptest_1458150400"
			class="flashmovie"
			width="150"
			height="120">
	<param name="movie" value="http://manuel.bit-fire.com/wp-content/uploads/2007/08/bmptest.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://manuel.bit-fire.com/wp-content/uploads/2007/08/bmptest.swf"
			name="fm_bmptest_1458150400"
			width="150"
			height="120">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p><a title="Bitmap test" href="http://manuel.bit-fire.com/wp-content/uploads/2007/08/bmptest.zip">Sources</a></p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/08/20/noticeable-difference/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Player v9.0.60.120 issues</title>
		<link>http://manuel.bit-fire.com/2007/08/14/flash-player-v9060120-issues/</link>
		<comments>http://manuel.bit-fire.com/2007/08/14/flash-player-v9060120-issues/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 21:18:49 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/08/14/flash-player-v9060120-issues/</guid>
		<description><![CDATA[I&#8217;m trying to get a clue of that vertical bar and it just seems very closely related to how the BitmapData&#8217;s draw() method internally works: for instance, if you have the source at hand, at line 67 of the PostProcessor.as file there is the line: ppbmpData.draw( source, new Matrix( .5, 0, 0, .5 ), null,]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to get a clue of that vertical bar and it just seems very closely related to how the BitmapData&#8217;s <em>draw()</em> method internally works: for instance, if you have the source at hand, at line 67 of the PostProcessor.as file there is the line:</p>
<pre class="brush: cpp;">
ppbmpData.draw( source, new Matrix( .5, 0, 0, .5 ), null, BlendMode.NORMAL );
</pre>
<p>The <em>ppMatrix</em> is the precomputed transformation matrix and, by changing that with the following, the bar will go away and it won&#8217;t crash the VM anymore:</p>
<pre class="brush: cpp;">
ppbmpData.draw( source, new Matrix( .501, 0, 0, .501 ), null, BlendMode.NORMAL );
</pre>
<p>Since i do not think a mere transformation operation can be SO wrong, i&#8217;m trying to extrapolate the smallest context into which the problem can be reproduced: so far i also noticed i can get very different results between Flash Player v9.0.47 and v9.0.60.120 by changing the code in order to produce a predictable result.<br />
In other words, i got the expected result in v9.0.47 but only the top-most <em>output_height / 2</em> portion is correct in v9.0.60.120: i&#8217;m not sure if that can be related to multi-threaded optimizations in the Flash Player since by changing the process&#8217; affinity mask seems to affect framerate and flickering only&#8230; bah! I have to dig some more&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/08/14/flash-player-v9060120-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Carpet&#8217;s sources</title>
		<link>http://manuel.bit-fire.com/2007/08/11/carpets-sources/</link>
		<comments>http://manuel.bit-fire.com/2007/08/11/carpets-sources/#comments</comments>
		<pubDate>Sat, 11 Aug 2007 15:20:48 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[bitmapfilter]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[flash 9]]></category>
		<category><![CDATA[mouseevent]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/08/11/carpets-sources/</guid>
		<description><![CDATA[Here is the source code for the Magic Carpet demo, just unpack it in your project directory of choice and import the project in Flex Builder, making sure to resolve the dependancies as it makes use of the following packages: PaperVision3D in its head revision; ASWing in its 1.0 A3 Flex compiler release; APE in]]></description>
			<content:encoded><![CDATA[<p>Here is the source code for the Magic Carpet demo, just unpack it in your project directory of choice and import the project in Flex Builder, making sure to resolve the dependancies as it makes use of the following packages:</p>
<ul>
<li>PaperVision3D in its <a href="http://papervision3d.googlecode.com/svn/trunk">head revision</a>;</li>
<li>ASWing in its <a href="http://code.google.com/p/aswing/downloads/list">1.0 A3 Flex compiler</a> release;</li>
<li><a href="http://www.cove.org/ape/">APE</a> in its v0.45 alpha release (provided w/ modifications);</li>
</ul>
<p>Let me explain the modifications in APE: i just wanted the engine to perform the timestep in a fixed fashion, so i initially modified it to accept a value, expressed in Hz, that represents the integrator&#8217;s timestep to be used, this way no matter if different machines have different framerates, animating will be the same everywhere.<br />
<span id="more-48"></span><br />
Then i was in need to rebuild the mesh at runtime since i wanted to be able to define tesselation and spacing directly from the UI: by trying to modify the values i got huge slowdowns and hangs that i have no clue of what that was, until later on i realized that APE was creating and attaching hundred of Sprite objects to its container. I tried to use a NullSprite object since i thought it would be ok to provide a reference to a common null-painter object, but that won&#8217;t did the trick, so i just settled things once and for all and removed most of the &#8220;presentation&#8221; logic in it as also i really had no need to have Sprite objects instanced and added for every particle and spring.</p>
<p>Download <a title="Magic Carpet v1.0b5 src" href="http://manuel.bit-fire.com/wp-content/uploads/2007/08/magiccarpet_v10b5.zip">Magic Carpet v1.0b5 src</a></p>
<p>*UPDATE*<br />
I uploaded a video on YouTube if you just want to take a look at it:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_HUtjKIuauMk_1452369061"
			class="flashmovie"
			width="410"
			height="330">
	<param name="movie" value="http://www.youtube.com/v/HUtjKIuauMk" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://www.youtube.com/v/HUtjKIuauMk"
			name="fm_HUtjKIuauMk_1452369061"
			width="410"
			height="330">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/08/11/carpets-sources/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>
