<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/atom10full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom"><id>tag:www.mdk.org.pl,2009:atom-tools</id><title type="text">Michael Dominic K.</title><subtitle type="text">It doesn't mean you should just because you can</subtitle><updated>2008-05-07T23:36:21+02:00</updated><link href="http://www.mdk.org.pl" rel="alternate" type="text/html" /><rights type="text">Copyright © 2009, Michael Dominic K.</rights><link rel="self" href="http://feeds.feedburner.com/Mdk" type="application/atom+xml" /><entry><id>tag:www.mdk.org.pl,2008:hell-in-wroclaw</id><title type="text">Hell in Wrocław</title><content type="html">&lt;p&gt;I&amp;rsquo;ll be attending and giving a presentation at &lt;a href="http://www.libregraphicsmeeting.org"&gt;Libre Graphics Meeting&lt;/a&gt; this year in Wrocław. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Title:&lt;/strong&gt; &lt;em&gt;&amp;ldquo;Programmer&amp;rsquo;s hell: working with a UI designer&amp;rdquo;&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time:&lt;/strong&gt; Friday, 14:25. &lt;/p&gt;

&lt;p&gt;Lot&amp;rsquo;s of fun guaranteed, come to feel some hot flames. &lt;/p&gt;
</content><published>2008-05-07T23:35:15+02:00</published><updated>2008-05-07T23:36:21+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2008/5/7/hell-in-wroclaw" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2008:nordea-sucks</id><title type="text">Nordea sucks</title><content type="html">&lt;p&gt;I rarely feel like blogging about personal stuff but today my patience finally went off. Since I switched from &lt;a href="http://www.nordea.fi"&gt;Finnish Nordea&lt;/a&gt; (which provides excellent service BTW) to a &lt;a href="http://www.nordea.pl"&gt;Polish one&lt;/a&gt; I'm having only problems. Not the only one being that for &lt;em&gt;two months now&lt;/em&gt; they&amp;rsquo;re unable to send me a banking card for my account. &lt;/p&gt;

&lt;p&gt;Today, however, something much more scary happened. When trying to send them email (using their own banking account messaging system) I got this nice failure:&lt;/p&gt;

&lt;pre&gt;Warning: pg_exec() [function.pg-exec]: Query failed: ERROR: syntax error at or near 
"u" at character 2101 in /www/pglib/libs/c_db_postgres.php on line 106
error: query(): ERROR: syntax error at or near "u" at character 2101 
INSERT INTO cms.tabmail ( sto, ssubject, scontent, sheaders ) VALUES 
( 'solopl@nordea.com', 'produkty i usługi bankowe', 
'Temat: produkty i usługi bankowe...
&lt;/pre&gt;


&lt;p&gt;As &lt;a href="http://linuxart.com/"&gt;garrett&lt;/a&gt; pointed out &amp;mdash; of all the places you want to see this kind of error, your bank is not one. For those unfamiliar with the problem &amp;mdash; it&amp;rsquo;s esentially an &lt;a href="http://en.wikipedia.org/wiki/SQL_injection"&gt;Sql injection&lt;/a&gt; bug which, in short, means that your system security is &lt;em&gt;a piece of shit&lt;/em&gt;. &lt;/p&gt;
</content><published>2008-04-18T17:13:43+02:00</published><updated>2008-04-18T17:16:33+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2008/4/18/nordea-sucks" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2008:moonlight-flicks</id><title type="text">Moonlight flicks</title><content type="html">&lt;p&gt;&lt;a href="http://www.tirania.org"&gt;Miguel&lt;/a&gt; has a good &lt;a href="http://tirania.org/blog/archive/2008/Mar-03.html"&gt;status update on Moonlight&lt;/a&gt;. Complementing that I recorded a few simple demos presenting current state of our &lt;a href="http://anonsvn.mono-project.com/source/trunk/moon/"&gt;Moonlight trunk&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;While talking to friends at &lt;a href="http://www.fosdem.org"&gt;FOSDEM&lt;/a&gt; I noticed that while everybody pretty much heard about Moonlight/Silverlight, not so many people have actually seen it in action. This is understandable &amp;mdash; at the moment &lt;a href="http://www.mono-project.com/Moonlight#Getting_Started"&gt;building Moon&lt;/a&gt; from source is not trivial. Hopefully those little videos will help a little. &lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.mdk.org.pl/assets/moonlight_showcase_thumb.png" style="float:left; padding: 5px"/&gt;&lt;a href="http://silverlight.net/showcase/default.aspx"&gt;Microsoft showcase&lt;/a&gt; &amp;mdash; a website collecting links to various Silverlight-enabled pages and web apps. Users can browse sites and rate them. Built with &lt;a href="http://en.wikipedia.org/wiki/Xaml"&gt;Xaml&lt;/a&gt; and Javascript. &lt;a href="http://www.viddler.com/explore/michaldominik/videos/40/"&gt;Watch demo&lt;/a&gt; / &lt;a href="http://files.mdk.am/demos/moonlight-showcase-hq.avi"&gt;Download high-res avi&lt;/a&gt;.&lt;/p&gt;

&lt;br style="clear: left" /&gt;


&lt;p&gt;&lt;img src="http://www.mdk.org.pl/assets/moonlight_podium_thumb.png" style="float:left; padding: 5px"/&gt;&lt;a href="http://election.msn.com/podium08.aspx"&gt;Podium&lt;/a&gt; &amp;mdash; A dynamic mashup of various news related to US election candidates. Shows some more advanced text-flowing and formatting capabilities. Again &amp;mdash; Xaml and Javascript. &lt;a href="http://www.viddler.com/explore/michaldominik/videos/41/"&gt;Watch demo&lt;/a&gt; / &lt;a href="http://files.mdk.am/demos/moonlight-podium-hq.avi"&gt;Download high-res avi&lt;/a&gt;.&lt;/p&gt;

&lt;br style="clear: left" /&gt;


&lt;p&gt;&lt;img src="http://www.mdk.org.pl/assets/moonlight_surfaces_thumb.png" style="float:left; padding: 5px"/&gt;&lt;a href="http://delay.members.winisp.net/SilverlightSurface/"&gt;Surfaces&lt;/a&gt; &amp;mdash; A very simple surface manipulation/D&amp;amp;D example. &lt;a href="http://clutter-project.org/"&gt;Clutter&lt;/a&gt; has a similiar demo. &lt;a href="http://www.viddler.com/explore/michaldominik/videos/42/"&gt;Watch demo&lt;/a&gt; / &lt;a href="http://files.mdk.am/demos/moonlight-surfaces-hq.avi"&gt;Download high-res avi&lt;/a&gt;.&lt;/p&gt;

&lt;br style="clear: left" /&gt;


&lt;p&gt;This is only a small selection of Silverlight-enabled sites which was easier to record (ie. not using media playback). A bigger list we use for testing is available at &lt;a href="http://www.mono-project.com/Moonlight_1.0_TestSites"&gt;Moonlight 1.0 test sites&lt;/a&gt;. &lt;/p&gt;
</content><published>2008-03-04T20:46:00+01:00</published><updated>2008-04-09T16:43:49+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2008/3/4/moonlight-flicks" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2008:changes-of-n</id><title type="text">Changes of "N"</title><content type="html">&lt;p&gt;Just a small status update: I recently quit &lt;a href="http://www.nokia.com"&gt;Nokia&lt;/a&gt; and joined the &lt;a href="http://grendello.blogspot.com/"&gt;new&lt;/a&gt; &lt;a href="http://www.gnome.org/%7Efherrera/"&gt;old&lt;/a&gt; &lt;a href="http://tirania.org/blog/"&gt;faces&lt;/a&gt; at &lt;a href="http://www.novell.com"&gt;Novell&lt;/a&gt; for a brighter future. Cheers guys! Helsinki folks &amp;mdash; don&amp;rsquo;t despair, you still have &lt;a href="http://www.meritahti.net/"&gt;Meritahti&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Also, like last year, I&amp;rsquo;ll be coming to Brussels for &lt;a href="http://www.fosdem.org/2008/"&gt;FOSDEM&lt;/a&gt; this year. Let&amp;rsquo;s meet!&lt;/p&gt;
</content><published>2008-01-31T23:27:47+01:00</published><updated>2008-01-31T23:27:52+01:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2008/1/31/changes-of-n" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:on-gnome-mobile</id><title type="text">On GNOME mobile</title><content type="html">&lt;p&gt;&lt;a href="http://www.murrayc.com/blog/permalink/2007/11/26/gnome-board-2007-candidates-the-bad/"&gt;Murray writes&lt;/a&gt; about &lt;a href="http://www.gnome.org/mobile/"&gt;GNOME mobile&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The is currently most obvious in the GMAE (or GNOME Mobile) group, which Jeff insists on controlling, which the board allowed despite knowing what would happen. After almost two years it has produced nothing more than a press release announcing its existence, and that happened six months later than the members wanted.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I don&amp;rsquo;t think &lt;a href="http://perkypants.org/"&gt;Jeff&lt;/a&gt; is to be blamed here first. I don&amp;rsquo;t know about other players involved but I personally feel that we at &lt;a href="http://www.nokia.com"&gt;nokia&lt;/a&gt; simply didn&amp;rsquo;t put enough effort into GNOME mobile. &lt;/p&gt;

&lt;p&gt;This is to be read carefully. We did put &lt;strong&gt;a lot&lt;/strong&gt; of serious work (directly and indirectly) into &lt;a href="http://www.gnome.org"&gt;GNOME&lt;/a&gt; and various GNOME mobile components. A lot of those efforts are invisible. Where we so far failed is to make this work standardized, reusable and transparent &amp;mdash; what (if I understand correctly) was the original goal of the GNOME mobile. &lt;/p&gt;

&lt;p&gt;Hopefully this can be changed. But I don&amp;rsquo;t think it&amp;rsquo;s fair to blame Jeff for this particular issue.&lt;/p&gt;
</content><published>2007-11-27T00:37:10+01:00</published><updated>2007-11-27T00:37:18+01:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/11/26/on-gnome-mobile" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:gl-colorspace-conversions</id><title type="text">GL colorspace conversions</title><content type="html">&lt;p&gt;A fellow sushi-lover &lt;a href="http://macslow.thepimp.net/"&gt;MacSlow&lt;/a&gt; was blogging some time ago about &lt;a href="http://macslow.thepimp.net/?p=123"&gt;various cool things that can be done with OpenGL and video&lt;/a&gt;. Mirco writes:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&amp;ldquo;The remaining things to implement are: using fragment-shaders for the colorspace-conversion too, hooking up some implicit-animation love for switching between different videos.&amp;rdquo;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'd like to pick a little bit on the first part of his todo (using hardware-accelerated colorspace conversions). &lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/yuv-screenshot.png" /&gt;&lt;/p&gt;


&lt;h2&gt;RGB vs. YUV&lt;/h2&gt;

&lt;p&gt;Computer graphics is an RGB-world. Every point/pixel on the screen is represented by an intensity of red, green and blue. Any visible color can be coded with a combination of those three values. RGB is the way to specify colors in various drawing API&amp;rsquo;s, HTML color coding, etc. However &amp;mdash; RGB gamut is not modeling well the way human eye works. Our perception has certain characteristics that are not well expressed in the RGB universe. For example &amp;mdash; a human eye is very sensitive to changes in lightness (intensity) but is not very keen on noticing differences between dark shades of blue. This is where &lt;a href="http://en.wikipedia.org/wiki/YUV"&gt;YUV&lt;/a&gt; colorspace kicks in. YUV (just like RGB) can be used to represent any color but the representation is more interesting from the video compression point of view &amp;mdash; which is mostly about benefiting from the imperfections in our sight.&lt;/p&gt;

&lt;p&gt;In YUV colors are represented by luminance (Y) and two chrominance components (U and V). For example, in RGB the white color is represented with [1.0; 1.0; 1.0] triple while in YUV it would be a [1.0; 0.0; 0.0] set. In a way YUV predates RGB and computers as it&amp;rsquo;s the format used in the analog TV (the cable essentially contains YUV signals at different bands).&lt;/p&gt;

&lt;h2&gt;Conversion&lt;/h2&gt;

&lt;p&gt;The reason why YUV is important is that it&amp;rsquo;s used as the native format in video compression. The raw (fast) output we get from a modern video decoder is a (some kind of) YUV buffer. YUV can be fairly easily converted to RGB (and vice versa) but it comes at a price. Since it&amp;rsquo;s a per-pixel operation the processing time gets steep fast. With high-resolution DVD-quality video we&amp;rsquo;re talking about ~10 million points per second. With numbers like that &lt;strong&gt;any&lt;/strong&gt; operation becomes a bottleneck. Since in the end we somehow need to get the RGB representation, the only thing we can do is delegate the conversion from the CPU to the graphical hardware. &lt;/p&gt;

&lt;h2&gt;Overlays to the rescue&lt;/h2&gt;

&lt;p&gt;The traditional way of dealing with this problem was to use overlay capabilities of the graphics board. Overlays are around since long time (way longer than 3d acceleration) and are fairly well established. Overlays, being a hardware capability, allow us to &amp;ldquo;take over&amp;rdquo; a certain (more or less rectangular) area of the screen and dump there some pixel data &amp;mdash; bypassing the traditional drawing pipeline. The data pushed can be in YUV format. Modern graphics hardware supports all popular YUV formats and the conversion is handled by the hardware.&lt;/p&gt;

&lt;p&gt;The limitation of this approach is that the video (overlay) is not really a first-class citizen in the UI pipeline. It&amp;rsquo;s something that is (simplification here) &amp;ldquo;burnt over&amp;rdquo; other elements of the UI. We can&amp;rsquo;t transform it, we can&amp;rsquo;t use it in the 3d/2d effects pipeline and it&amp;rsquo;s problematic (slow) to draw over it (think transparent playback controls drawn over playing video). Overlays are more than enough for implementing standard desktop players but are useless when we want to do more fancy stuff. &lt;/p&gt;

&lt;p&gt;For the fancy effects we want to use video as a native texture/source image while &lt;strong&gt;still&lt;/strong&gt; delegating the colorspace conversion to the hardware. OpenGL API/pipeline does not support YUV formats but we can easily fix that with custom GPU code. &lt;/p&gt;

&lt;h2&gt;YUV formats&lt;/h2&gt;

&lt;p&gt;One problem with YUV is that it comes in different flavors (formats) and there are quite many of them. &lt;a href="http://www.fourcc.org"&gt;FourCC&lt;/a&gt; website &lt;a href="http://www.fourcc.org/yuv.php"&gt;has a good overview&lt;/a&gt;. The good thing is that there are just a couple of popular formats used in practice and the huge rest is mostly exotic or legacy. &lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s take a quick look at the popular IYUV/I420 format we get from a &lt;a href="http://www.divx.com/"&gt;DivX&lt;/a&gt; decoder. It&amp;rsquo;s a planar format which means that (unlike most RGB formats) the components are &lt;strong&gt;not&lt;/strong&gt; interleaved. We can graphically represent an I420 buffer:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/yuv-buffer.png" /&gt;&lt;/p&gt;


&lt;p&gt;The buffer contains the full Y plane followed by two U and V planes. And here comes the rub &amp;mdash; the U and V planes are sub-sampled at half the resolution. So, assuming we&amp;rsquo;re dealing with a 400x240 video we first get the luminance (Y) plane at full resolution (400x240) followed by U/V planes at half the resolution (200x120). Again, this is because the information about the lightness of the picture (Y) is more important than the information about the chrominance (&amp;ldquo;colors&amp;rdquo;) of the video. In other YUV formats it&amp;rsquo;s common to assign less bits for the U and V. &lt;/p&gt;

&lt;h2&gt;GL implementation&lt;/h2&gt;

&lt;p&gt;In the GL implementation we particularly want to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid any data processing on the software side&lt;/li&gt;
&lt;li&gt;Avoid extra mem copies/unpacking of the data&lt;/li&gt;
&lt;li&gt;Benefit from the hw-accelerated scaling/filtering (linear, cubic, etc.)&lt;/li&gt;
&lt;li&gt;Get a high-quality image&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;To achieve this we need to use three GL elements which are not part of the GL 1.x standard but are commonly available as extensions &amp;mdash; &lt;strong&gt;multitexturing&lt;/strong&gt;, &lt;strong&gt;fragment programs&lt;/strong&gt; and &lt;strong&gt;rectangular texture&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Multitexturing"&gt;Multi-texturing&lt;/a&gt; allows us to use three different textures (Y, U and V plane respectively) as the source for the output image. A custom &lt;a href="http://en.wikipedia.org/wiki/Fragment_shader"&gt;fragment shader&lt;/a&gt; executes the proper blending function to create the RGB data out of the YUV source. &lt;a href="http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt"&gt;Rectangular texture&lt;/a&gt; is necessary to be able to use non-power-of-two resolution source as the texture.&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/yuv-pipeline.png" /&gt;&lt;/p&gt;


&lt;p&gt;For the textures/planes we use a &lt;code&gt;GL_LUMINANCE&lt;/code&gt; 1-byte texture format. We also need to use a separate set of texture coordinates for each plane due to the resolution differences. The texture-filtering step (ie. during scaling) happens before the shading step so in the shader we automatically get properly filtered data (each texture separately). &lt;/p&gt;

&lt;p&gt;For other YUV formats (ie. the interleaved ones) we need to do a bit more work. As the UV components are usually scattered across many triples automatic GL scaling/filtering will destroy our data before it reaches the shader. To counter that we need to first draw (with hw-accelerated conversion) to an off-screen &lt;a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt"&gt;FBO&lt;/a&gt;/texture and reuse that data as a native RGB texture for further rendering in the UI/scene. Alternatively one can use &lt;a href="http://oss.sgi.com/projects/ogl-sample/registry/SGIX/pbuffer.txt"&gt;pbuffers&lt;/a&gt; (less optimal performance-wise).&lt;/p&gt;

&lt;h2&gt;Source code&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://www.mdk.org.pl/assets/yuv-gl-video.tar.gz"&gt;Here is an example program&lt;/a&gt; + source which renders a sample video (&lt;a href="http://www.nseries.com/n810"&gt;Nokia n810&lt;/a&gt; ad) using GStreamer + hardware-accelerated colorspace conversion and some effects. The example uses a rather primitive way of syncing video using timers. The proper way would be to write a decent &lt;a href="http://www.gstreamer.org"&gt;GStreamer&lt;/a&gt; video sink or extend the existing GL-sink to use fragment programs. This approach would prolly be the right way to handle video in ie. &lt;a href="http://clutter-project.org/"&gt;clutter&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;A rendering of the program output just for reference (might not show up in RSS, full resolution video can be &lt;a href="http://files.mdk.am/demos/opengl-video.avi"&gt;downloaded here&lt;/a&gt;):&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="437" height="370" id="viddler_michaldominik_36"&gt;&lt;param name="movie" value="http://www.viddler.com/player/755b2fff/" /&gt;&lt;param name="allowScriptAccess" value="always" /&gt;&lt;param name="allowFullScreen" value="true" /&gt;&lt;embed src="http://www.viddler.com/player/755b2fff/" width="437" height="370" type="application/x-shockwave-flash" allowScriptAccess="always" allowFullScreen="true" name="viddler_michaldominik_36" &gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;

</content><published>2007-11-17T14:38:05+01:00</published><updated>2007-11-17T14:38:11+01:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/11/17/gl-colorspace-conversions" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:curvy-blues</id><title type="text">Curvy blues</title><content type="html">&lt;p&gt;I was looking in the &lt;a href="http://www.mdk.org.pl/2007/8/16/vector-drawing-opengl-polygon-tessellation"&gt;past&lt;/a&gt; (and &lt;a href="http://www.mdk.org.pl/2007/8/6/vector-drawing-opengl-shaders-and-cairo"&gt;some more&lt;/a&gt;) at various solutions for efficient hardware-aided curve rasterization methods. Those ideas mostly focused on using the graphical hardware for accelerating the geometry generation process. But what happens, when we completely skip the geometry generation step? Even more blazing performance and totally resolution-independent rendering. Thanks to some tips by &lt;a href="http://jonsmirl.googlepages.com/graphics.html"&gt;Jon&lt;/a&gt; and interesting math discussions I had in the past weeks, I'm glad to present my current thinking.&lt;/p&gt;

&lt;h2&gt;Quadratic curves&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Quadratic_function"&gt;Quadratic curves&lt;/a&gt; (second-degree polynomials) consist of a starting point, an end point and one control point. Such curves cannot self-intersect nor inflect. The representation of a quadratic curve is a parabola, a straight line or (a degenerate case) &amp;mdash; a point. Quadratic curves are not the most popular ones in modern graphical packages. Cubic types (more about them later) are the basic unit of notation. In example, &lt;a href="http://www.cairographics.org"&gt;cairo&lt;/a&gt; doesn&amp;rsquo;t provide direct quadratic API. It&amp;rsquo;s understandable as any quadratic can be trivially represented in a cubic form. However, since (due to their limited properties) quadratics are usually much faster to process it makes sense to look at them separately. Quadratics are part of the &lt;a href="http://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands"&gt;SVG standard&lt;/a&gt; and have some interesting uses &amp;mdash; including &lt;a href="http://en.wikipedia.org/wiki/True_type"&gt;TrueType&lt;/a&gt; fonts (which are represented only with 2nd degree curves) and Flash (which uses quadratics as the native curve representation and represents cubics by subdividing them into quadratics). Few examples of quadratic curves:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/quadratic-examples.png" alt="Quadratic curve examples"/&gt;&lt;/p&gt;


&lt;p&gt;Now, let&amp;rsquo;s look at how we can hook up the programmable GPU hardware to rasterize quadratics. The first observation is that the three points describing the curve form a triangle and this triangle covers the whole area of the curve. Triangle is the most basicrasterization primitive in modern graphics hardware. Let&amp;rsquo;s assign two texture coordinates (&lt;em&gt;v&lt;/em&gt; and &lt;em&gt;w&lt;/em&gt;) for each of the three points. We&amp;rsquo;re going to use &lt;strong&gt;[0.0; 0.5]&lt;/strong&gt; , &lt;strong&gt;[0.0; 1.0]&lt;/strong&gt; and &lt;strong&gt;[1.0; 1.0]&lt;/strong&gt; for, respectively &amp;mdash; the start point, the control point and the end point.&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/quadratic-triangle.png" alt="Quadratic triangle"/&gt;&lt;/p&gt;


&lt;p&gt;As the triangle is being rendered the hardware will interpolate &lt;em&gt;v&lt;/em&gt; and &lt;em&gt;w&lt;/em&gt; across the three vertices. For each pixel belonging to the triangle we get a unique, interpolated &lt;em&gt;v&lt;/em&gt; and &lt;em&gt;w&lt;/em&gt; texture coords pair. And here comes the crucial part &amp;mdash; as the actual &amp;ldquo;texture&amp;rdquo; for this triangle we use a dynamic fragment program that evaluates the following expression:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/quadratic-expression_1.png" alt="Quadratic shader expression"/&gt;&lt;/p&gt;


&lt;p&gt;If the expression evaluates to &lt;em&gt;true&lt;/em&gt;, we pass the pixel. If not, we discard it. What we get is:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/quadratic-shader.png" alt="Quadratic shader rendering"/&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href="http://www.mdk.org.pl/assets/quadratic-shader.pso"&gt;Here is a shader implementation&lt;/a&gt; that does this operation. As we see, the rastered picture represents the curve we&amp;rsquo;re trying to visualize. To be precise, we get the fill for the curve. If we replaced the &lt;em&gt;&amp;lt;&lt;/em&gt; sign with &lt;em&gt;=&lt;/em&gt; sign we would get the actual stroke (the green line). As we zoom towards the curve, the shader generates more pixels giving a more accurate representation. A true resolution-independent rendering.&lt;/p&gt;

&lt;p&gt;I'm going to come back to why this is so fundamentally amazing later on, but now let&amp;rsquo;s move on to the cubics.&lt;/p&gt;

&lt;h2&gt;Cubic curves&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Cubic_curve"&gt;Cubics&lt;/a&gt; (third-degree polynomials, the bezier-curves) are a bit more complex. They consist of two arbitrary control points plus start/end points. As a result a cubic can self-intersect, loop, inflect or cusp. Beziers are &lt;strong&gt;the thing&lt;/strong&gt; in vector drawing and most of the data we get to render these days (icons, buttons, UI elements&amp;hellip;) are sets of shapes defined by cubic curves.&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/cubic-examples.png" alt="Cubic curve examples"/&gt;&lt;/p&gt;


&lt;p&gt;For blazing-fast rendering of cubics we&amp;rsquo;re going to use a similar approach that we used for quadratics. Since cubics consist of four points we need more than a single triangle. Actually, depending on the control points set we&amp;rsquo;re dealing with, we need 2 or 3 triangles. In other words &amp;mdash; we need to triangulate the points. In this case (very fixed) triangulation is trivial and essentially we can discover the case we have by doing a few &lt;a href="http://en.wikipedia.org/wiki/Dot_product"&gt;dot products&lt;/a&gt; between the vectors of the control points.&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/cubic-triangle.png" alt="Cubic curve triangulation"/&gt;&lt;/p&gt;


&lt;p&gt;Since we&amp;rsquo;re dealing with a cubic equation, we need &lt;strong&gt;three&lt;/strong&gt; texture coordinates per point (that&amp;rsquo;s perfectly fine with the &lt;a href="http://www.opengl.org/sdk/docs/man/xhtml/glTexCoord.xml"&gt;OpenGL API&lt;/a&gt;). Let&amp;rsquo;s call those three coords: &lt;em&gt;v&lt;/em&gt;, &lt;em&gt;w&lt;/em&gt; and &lt;em&gt;t&lt;/em&gt;. In our fragment shader (&lt;a href="http://www.mdk.org.pl/assets/cubic-shader.pso"&gt;implementation here&lt;/a&gt;) we&amp;rsquo;re going to evaluate the following expression:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/cubic-expression_1.png" alt="Cubic shader expression"/&gt;&lt;/p&gt;


&lt;p&gt;And the last hard part &amp;mdash; unlike quadratics, for cubics there are no static texture coords to use. We need to calculate them separately for each curve. The method to do that is a subject for a separate article, but it&amp;rsquo;s enough to say that it&amp;rsquo;s a fast fixed-time operation that involves few matrix multiplications. Essentially we need to put the control point coordinates in a matrix, move it to power basis and analyze the determinants. Depending on the number of square roots, we have one of the few distinct cubic-cases which further dictate which &lt;em&gt;v&lt;/em&gt;, &lt;em&gt;w&lt;/em&gt;, &lt;em&gt;t&lt;/em&gt; coords to use. Those computations could be put in hardware-accelerated matrix pipeline but I haven&amp;rsquo;t found that to be critical enough to do so.&lt;/p&gt;

&lt;p&gt;In the end we end up with:&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/cubic-shader.png" alt="Cubic shader rendering"/&gt;&lt;/p&gt;


&lt;p&gt;Using this technique we can render any cubic at any resolution in a fixed time.&lt;/p&gt;

&lt;h2&gt;Practical results&lt;/h2&gt;

&lt;p&gt;Two following screenshots (click for bigger versions) show sample renderings (a font glyph and a mono-project logo) obtained using this method. Shapes consist of roughly 30 cubics/lines. The first figure represents the inner-mesh hardware-accelerated triangulation. The second one &amp;mdash; a rendering of the curve data. By combining the two we end up with a final mask for the shape. This method works for any polygon including complex self-intersecting concave/convex shapes.&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;a href="http://www.mdk.org.pl/assets/gpu-rendering-font.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/gpu-rendering-font-thumb.png" alt="GPU font rendering"/&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p style="text-align: center"&gt;&lt;a href="http://www.mdk.org.pl/assets/gpu-rendering-mono-logo.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/gpu-rendering-mono-logo-thumb.png" alt="GPU mono logo shape rendering"/&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;Why it&amp;rsquo;s cool&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Traditional approaches to curve rasterization usually require recursive subdividing of the curve towards a certain level of line-approximation or reaching a pixel-precision. The complexity/processing time grows exponentially and the result might be not correct. With the approach presented above we achieve high quality by keeping the mathematically-correct (not compromised) information about the curve till the very last step &amp;mdash; the rasterization . The precision of the final image (output) is only limited by the resolution of the display system, not the implementation. The complexity of the algorithm is linear and the processing time is only constrained by the pixel fill rate of the GPU board (that value approaching hundreds of millions for modern equipment).&lt;/li&gt;
&lt;li&gt;From my experiments, attaching the (presented) fragment shaders to the triangle rasterization process has no any impact on the performance. In other words, it seems that on modern hardware rendering a solid-filled triangle is equally fast as rendering a triangle with a simple shader.&lt;/li&gt;
&lt;li&gt;As we&amp;rsquo;re not generating/storing any extra geometry data and just using two (max three) triangles per curve, the memory requirements are minimal &amp;mdash; even for extremally complex shapes.&lt;/li&gt;
&lt;li&gt;By using some additional extensions (such as a &lt;a href="http://oss.sgi.com/projects/ogl-sample/registry/EXT/compiled_vertex_array.txt"&gt;compiled vertex array&lt;/a&gt;) after the initial pre-calculation step we can completely move the geometry data to the GPU unit and render by just invoking display lists. In this case the expose events theoretically come cost-free for the CPU.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Smart curve rasterization is the first step towards efficient drawing API implementation. By combining the solution with additional dynamical GPU-programmable pipeline elements (gradients, triangulation, anti-aliasing, multi-sample rendering) we can achieve blazing-fast vector-based drawing tool. This is my current approach towards building a new OpenGL-based cairo backend. World domination follows. Obviously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; for better math overview check &lt;a href="http://research.microsoft.com/%7Ecloop/loopblinn05.pdf"&gt;this&lt;/a&gt; article by Loop &amp;amp; Blinn. It&amp;rsquo;s a good starting point even though it&amp;rsquo;s not complete and has certain mistakes (check comments). &lt;/p&gt;
</content><published>2007-10-27T18:40:45+02:00</published><updated>2007-10-31T18:35:26+01:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/10/27/curvy-blues" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:nokia-n810-announced</id><title type="text">Nokia N810 announced!</title><content type="html">&lt;p&gt;It&amp;rsquo;s announced, we did it!&lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;a href="http://www.nokia.com/A4136017?category=n810#"&gt;&lt;img src="http://www.mdk.org.pl/assets/n810.png" alt="Nokia n810 Internet Tablet"/&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;a href="http://jaaksi.blogspot.com/"&gt;Ari&lt;/a&gt; has some &lt;a href="http://jaaksi.blogspot.com/2007/10/nokia-n810-announced.html"&gt;more gory details&lt;/a&gt; about what&amp;rsquo;s new and cool. From the toolkit point of view one thing worth mentioning is that we&amp;rsquo;re now running the full &lt;strong&gt;gtk-2.10&lt;/strong&gt; stack in &lt;a href="http://maemo.org/news/announcements/view/1190039774.html"&gt;Chinook&lt;/a&gt; (the OS release powering the n810). Now, there are two things to that:&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;bad&lt;/em&gt; thing is that due to the consolidation efforts the API compatibility is broken. Let me stress that again: if your application uses UI, it won&amp;rsquo;t run &lt;em&gt;at all&lt;/em&gt; on Chinook without (often trivial) modifications. We have &lt;a href="http://live.gnome.org/Hildon/TwoPointZero"&gt;documents&lt;/a&gt; and &lt;a href="https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-audit/"&gt;tools&lt;/a&gt; to assist you in porting the applications. So go ahead, &lt;a href="http://maemo.org/development/sdks/maemo_4_0_chinook_beta_sdk.html"&gt;download Chinook beta&lt;/a&gt; and update your app &amp;mdash; there is a lot of cool stuff in maemo garage that we need to make run on Chinook also. You can nag us on the IRC channel or mailing lists for help on specific issues. We&amp;rsquo;ll help.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;good&lt;/em&gt; thing is that we&amp;rsquo;re now very much closer to the gtk upstream and you can expect the toolkit stack to behave in a much more sane and predictable way. We&amp;rsquo;ll also now be able to actually track the API stability more closely. &lt;/p&gt;

&lt;p&gt;As Ari also mentioned, Chinook is going to be available for n800 also. While it&amp;rsquo;s common for companies to provide firmware/bugfix updates for legacy hardware, it&amp;rsquo;s pretty rare to get a full new OS release + new features for free. I'm glad we did it since&amp;hellip; well&amp;hellip; it&amp;rsquo;s exactly the &lt;em&gt;right&lt;/em&gt; thing to do! &lt;/p&gt;
</content><published>2007-10-17T19:41:48+02:00</published><updated>2007-10-17T19:41:53+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/10/17/nokia-n810-announced" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:service-interrupted</id><title type="text">Service interrupted</title><content type="html">&lt;p&gt;I finally manged to go through the maintenance pain and migrated my blog to a completely new system and design. I put effort into making sure that all links &amp;amp; serivces work like they did but in some corner cases the RSS feed might stop working for you. If that happens and you&amp;rsquo;re still interested in reading, please re-subscribe.&lt;/p&gt;

&lt;p&gt;I'd also like to appologize to all people who commented and put their opinions on my blog in the past despite the commenting system being completely bolox. It&amp;rsquo;s finally fixed now and works as expected.&lt;/p&gt;

&lt;p&gt;Sorry for the inconviences. More interesting service to follow.&lt;/p&gt;
</content><published>2007-10-14T19:10:28+02:00</published><updated>2007-10-14T19:39:08+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/10/14/service-interrupted" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:vector-drawing-opengl-polygon-tessellation</id><title type="text">Vector drawing: OpenGL polygon tessellation</title><content type="html">&lt;p&gt;After having looked into the &lt;a href="http://www.mdk.org.pl/articles/2007/08/06/vector-drawing-opengl-shaders-and-cairo"&gt;hardware-accelerated bezier curve computations&lt;/a&gt; I checked something more difficult and closer to the reality: hardware-accelerated arbitrary polygon tessellation with &lt;a href="http://www.opengl.org"&gt;OpenGL&lt;/a&gt;. This topic has been covered by &lt;a href="http://zrusin.blogspot.com/2006/07/hardware-accelerated-polygon-rendering.html"&gt;Zack&lt;/a&gt; some time ago, spawning a lot of flame (as most of the &lt;a href="http://www.gnome.org"&gt;GNOME&lt;/a&gt; vs. &lt;a href="http://www.kde.org"&gt;KDE&lt;/a&gt; performance comparisons do). All benchmarks are flawed, of course. &lt;/p&gt;

&lt;h2&gt;Test case&lt;/h2&gt;

&lt;p&gt;I used same setup as with my previous experiment. This time I measured the real framerate to make sure that no anomaly occurs due to GL async API. Each frame of the test consists of random flowers being drawn to screen with random parameters. Each flower is a polygon outlined by eight bezier curves. The flower shape is not special/optimized in any way. Any closed polygon made out of any number of curves could be used for this purpose. Summarizing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.notebookreview.com/default.asp?newsID=2285"&gt;Thinkpad t43&lt;/a&gt; with ATI mobility x300 card (fglrx proprietary driver with GL support)&lt;/li&gt;
&lt;li&gt;200 flowers being drawn in each frame&lt;/li&gt;
&lt;li&gt;Each flower has a random position, rotation, scale and fill&lt;/li&gt;
&lt;li&gt;Fill is a linear gradient from a random RGBA color to another random RGBA color&lt;/li&gt;
&lt;li&gt;640x480 space is used &lt;/li&gt;
&lt;li&gt;Same set of random data was used in both examples&lt;/li&gt;
&lt;li&gt;Anti-aliasing was turned on&lt;/li&gt;
&lt;li&gt;cairo 1.4.10-1 was used in the cairo version&lt;/li&gt;
&lt;li&gt;&lt;a href="http://files.mdk.am/other/flower.tar.gz"&gt;Source code for the programs&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;


&lt;p style="text-align: center"&gt;&lt;a href="http://www.mdk.org.pl/assets/polygon-cairo.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/polygon-cairo-thumb.png" alt="Cairo flower"/&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://www.mdk.org.pl/assets/polygon-gl.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/polygon-gl-thumb.png" alt="OpenGL flower"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align:center"&gt;&lt;img src="http://www.mdk.org.pl/assets/polygon-chart.png" alt="Performance graph"/&gt;&lt;/p&gt;


&lt;p&gt;The OpenGL rendering seems to be a pixel &amp;ldquo;fatter&amp;rdquo; than the cairo version (prolly a bug in my code). The GL output seems to be slightly brighter blended. I guess the significant difference between cairo x surface performance and cairo image surface performance also comes from the intensive blending. &lt;/p&gt;

&lt;h2&gt;Optimizations&lt;/h2&gt;

&lt;p&gt;Some optimizations in the GL code could be made to speed up the code even further:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Computed bezier vertices could be stored (even as compiled vertices, if available) to skip the need to generate them twice for the anti-aliasing run.&lt;/li&gt;
&lt;li&gt;As in my prev example, vertex shader could be used to generate bezier points. That would require a different way to get the polygon extents though.&lt;/li&gt;
&lt;li&gt;The quality of the curve approximation (detail level) doesn&amp;rsquo;t seem to affect performance much and could be increased.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Algorithm&lt;/h2&gt;

&lt;p&gt;To render the polygons I'm using a variation of the &lt;a href="http://en.wikipedia.org/wiki/Stencil_buffer"&gt;stencil-based&lt;/a&gt; algorithm described in the &lt;a href="http://www.glprogramming.com/red/chapter14.html#name13"&gt;OpenGL Red Book&lt;/a&gt;. It relies on a 1bit stencil buffer, which is commonly available. The basic method is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Disable framebuffer, enable stencil buffer &amp;amp; stencil testing.&lt;/li&gt;
&lt;li&gt;Draw triangle fans for every vertex in the polygon with an odd-even stencil flip rule.&lt;/li&gt;
&lt;li&gt;Enable framebuffer, disable stencil writes, keep stencil testing.&lt;/li&gt;
&lt;li&gt;Draw anti-aliased outline of the polygon but only where the stencil bit is &lt;em&gt;not&lt;/em&gt; set (those are the anti-aliasing artifact pixels that theoretically doesn&amp;rsquo;t belong to the shape).&lt;/li&gt;
&lt;li&gt;Switch stencil test rule to pass only when stencil bit &lt;em&gt;is&lt;/em&gt; set.&lt;/li&gt;
&lt;li&gt;Switch stencil write to zero the bit when passed (spares us a separate stencil clear call later on).&lt;/li&gt;
&lt;li&gt;Render the actual polygon shape with ie. quad.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Worthy benefit of this approach is that it fits (works with) all the standard OpenGL matrix transformations, depth buffer testing, texturing model etc. It can be easily extended with 2d boolean operations. The CPU is not performing any calculations (except the original path calculation which can be offset to the GPU with a vertex shader). &lt;/p&gt;

&lt;p&gt;Once in a while I'm getting questions how did I implement hardware-accelerated video color space conversions in &lt;a href="http://www.diva-project.org"&gt;Diva&lt;/a&gt;. I'm going to write a bit about that soon along with some boolean operations coverage. &lt;/p&gt;
</content><published>2007-08-16T09:50:39+02:00</published><updated>2007-09-24T20:12:28+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/8/16/vector-drawing-opengl-polygon-tessellation" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:vector-drawing-opengl-shaders-and-cairo</id><title type="text">Vector drawing: OpenGL shaders and cairo</title><content type="html">&lt;h2&gt;The mystery&lt;/h2&gt;

&lt;p&gt;Some time ago I had a chance to talk to &lt;a href="http://zrusin.blogspot.com/"&gt;Zack Rusin&lt;/a&gt; about the differences between QT and the Gnome/Gtk drawing stack. Zack was showing some impressive visual toolkit demos using tiny fractions of the CPU horse power. One of the subjects we started arguing about was using GPU hardware to perform tessellation &amp;mdash; as opposed to &lt;a href="http://cairographics.org/"&gt;cairo&lt;/a&gt;, where tessellation happens always on the software side. The idea seemed tempting though the practical benefits were unclear to me. &lt;/p&gt;

&lt;p&gt;During &lt;a href="http://www.guadec.org"&gt;GUADEC&lt;/a&gt; I poked a few people about the possibility of using &lt;a href="http://www.opengl.org"&gt;OpenGL&lt;/a&gt; and shader programs with cairo to perform hw-accelerated tessellation. I got some constructive and interesting (yet discouraging) feedback about the problems and complications related to this approach. A lot of those (highly valid) points are &lt;a href="http://blogs.gnome.org/timj/2007/07/17/17072007-opengl-for-gdkgtk/"&gt;summarized by Tim Janik in his blog&lt;/a&gt;. Still, the possible gains/performance improvements were highly unclear.&lt;/p&gt;

&lt;h2&gt;Investigation&lt;/h2&gt;

&lt;p&gt;I therefore decided to write a small benchmark to see what kind of speed differences we could possibly be talking about. To see if the game is worth playing at all. As the testbed I've chosen one of the most fundamental bits of the vector graphics &amp;mdash; a bezier curve drawing algorithm. I implemented a 100% hw-accelerated version as a &lt;a href="http://en.wikipedia.org/wiki/Vertex_shader"&gt;vertex shader program&lt;/a&gt; running on the GPU. I compared it against cairo software version in two scenarios &amp;mdash; using xsurface and image surface. The following setup was used for the test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.notebookreview.com/default.asp?newsID=2285"&gt;Thinkpad t43&lt;/a&gt; with ATI mobility x300 card (fglrx proprietary driver with GL support)&lt;/li&gt;
&lt;li&gt;A time to draw 100 random (pre-generated) bezier curves was measured&lt;/li&gt;
&lt;li&gt;Curves were randomized in a 640x480 space with a random width (1-10pixels) and a random color (red, green, blue, alpha)&lt;/li&gt;
&lt;li&gt;Same set of random curves was used in both examples&lt;/li&gt;
&lt;li&gt;Anti-aliasing was turned off&lt;/li&gt;
&lt;li&gt;An best of 3 test runs was taken&lt;/li&gt;
&lt;li&gt;&lt;a href="http://files.mdk.am/other/bezier.tar.gz"&gt;Source code&lt;/a&gt; (&lt;a href="http://developer.nvidia.com/object/cg_toolkit.html"&gt;CG toolkit&lt;/a&gt; from NVidia is needed to compile the shader program)&lt;/li&gt;
&lt;/ul&gt;


&lt;p style="text-align: center"&gt;&lt;a href="http://www.mdk.org.pl/assets/bezier-cairo.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/bezier-cairo-thumb.png" alt="Cairo bezier" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://www.mdk.org.pl/assets/bezier-shader.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/bezier-shader-thumb.png" alt="Shader bezier" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center"&gt;&lt;a href="http://www.mdk.org.pl/assets/flower-cairo.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/flower-cairo-thumb_1.png" alt="Cairo flower" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://www.mdk.org.pl/assets/flower-shader.png"&gt;&lt;img src="http://www.mdk.org.pl/assets/flower-shader-thumb_1.png" alt="Shader flower" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/bezier-chart.png" alt="Performance graph" /&gt;&lt;/p&gt;


&lt;p&gt;The rough-rough result of the test is that drawing using hardware opengl tessellation is 30 times faster than current software cairo implementation. By overlying the resulting images in ie. GIMP one can see tiny pixel differences between the two implementations (cairo implementation begin prolly more accurate) but essentially it&amp;rsquo;s the same thing. The OpenGL shader implementation is not optimized at all and could be made faster by using a geometry shader instead of a vertex shader.&lt;/p&gt;

&lt;h2&gt;Not only about speed&lt;/h2&gt;

&lt;p&gt;Using GPU to perform things normally happening on the CPU has one additional advantage &amp;mdash; it frees the processor to do other things. In my setup, with the cairo implementation drawing random curves as fast as possible, I can get a ~10fps animation (100 curves per frame). This keeps the CPU busy at 100% and the framerate will drop as soon as CPU starts doing anything else. &lt;/p&gt;

&lt;p&gt;With my 100% GPU implementation I get around 400fps and the CPU usage never goes beyond the 30% threshold (lots of it being the random-number generation I presume). &lt;/p&gt;

&lt;h2&gt;Caveats&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OpenGL shader program support is not yet a commodity, even though it&amp;rsquo;s coming fast even to the mobile space (ie. &lt;a href="http://www.imgtec.com/PowerVR/Products/Graphics/MBX/index.asp"&gt;MBX&lt;/a&gt; chip having vertex shader support and the &lt;a href="http://www.imgtec.com/PowerVR/Products/Graphics/SGX/index.asp"&gt;SGX&lt;/a&gt; chip having a full set of pixel/vertex/geometry shaders support).&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.gnome.org/timj/2007/07/17/17072007-opengl-for-gdkgtk/"&gt;As Tim pointed out&lt;/a&gt;, OpenGL implementations vary and per-implementation fine tuning might be in order&lt;/li&gt;
&lt;li&gt;To efficiently use shader programs one needs a full OpenGL-based drawing stack&lt;/li&gt;
&lt;li&gt;Shader programs + math + drawing algorithms are hard&lt;/li&gt;
&lt;li&gt;OpenGL drivers suck on Linux&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I still think that the results are interesting though. I quickly hacked another shader implementation to draw solid-filled bezier shapes (more about that soon). The performance differences seem to be even bigger. My gut feeling here is that the programmable hardware drawing might be the only way to go for the resolution-independent fully vector-drawn UI&amp;rsquo;s. Especially on the mobile where the CPU power is scarce, it scales badly, and everything that doesn&amp;rsquo;t throttle the processor means longer battery life.&lt;/p&gt;
</content><published>2007-08-06T14:52:34+02:00</published><updated>2007-09-24T21:02:35+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/8/6/vector-drawing-opengl-shaders-and-cairo" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:guadec-2007</id><title type="text">GUADEC 2007</title><content type="html">&lt;p&gt;I&amp;rsquo;ll be attending &lt;a href="http://www.guadec.org"&gt;GUADEC&lt;/a&gt; this year in Birmingham. During the tutorial day (Friday) I&amp;rsquo;ll be giving a practical introduction to the &lt;a href="http://www.maemo.org"&gt;maemo&lt;/a&gt; UI and showing some key differences from the full-blown desktop &lt;a href="http://www.gnome.org"&gt;GNOME&lt;/a&gt; interface. If you&amp;rsquo;re an application developer and you'd like to learn few new quirks about making your software feel responsive and look good on the mobile &amp;mdash; please do come. &lt;/p&gt;

&lt;p&gt;There is quite a bunch of us from &lt;a href="http://www.nokia.com"&gt;nokia&lt;/a&gt; coming to the event including a strong representation of our magnificent three-letter tookit team starring &lt;a href="http://oluc.blogspot.com"&gt;luc&lt;/a&gt;, &lt;a href="http://blogs.gnome.org/tko"&gt;tko&lt;/a&gt;, &lt;a href="http://www.gnome.org/%7Efherrera/blog"&gt;fer&lt;/a&gt;, &lt;a href="http://blogs.gnome.org/xan"&gt;xan&lt;/a&gt; and &lt;a href="http://www.mdk.org.pl"&gt;mdk&lt;/a&gt;. Great chance to poke us about our future plans regarding hildon, bitch about &lt;a href="http://sardine.garage.maemo.org"&gt;sardine&lt;/a&gt; and discuss some revolutionary UI ideas you might have for the internet tablets. &amp;ldquo;Hildon &amp;mdash; now open more than ever!&amp;rdquo;. Ehm.&lt;/p&gt;

&lt;p&gt;See you in the UK.&lt;/p&gt;
</content><published>2007-07-12T17:42:14+02:00</published><updated>2007-09-24T20:51:32+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/7/12/guadec-2007" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:chapter-1-in-which-we-meet-graff</id><title type="text">Chapter #1 in which we meet Graff</title><content type="html">&lt;p&gt;Long time, no news.&lt;/p&gt;

&lt;p&gt;I'm working now on a (new) set of libraries called Graff. Graff is a lighweight high-performance graphics rendering library. I guess it falls into the category of &lt;em&gt;canvas&lt;/em&gt; &amp;mdash; as currently discussed on the &lt;a href="http://mail.gnome.org/archives/gtk-devel-list/2007-April/msg00076.html"&gt;gtk mailing list&lt;/a&gt;. It&amp;rsquo;s a bit more generic though and focused on providing ways of &lt;em&gt;animating graphical elements over time&lt;/em&gt;.  It knows about motion paths, timelines, animating parameters, etc. The use case here is building new rich custom UI&amp;rsquo;s, providing a building-block for higher-level toolkits and abstracting hardware-specific quirks. It provides a basic model-view-controller environment with the UI elements (&amp;ldquo;faces&amp;rdquo;) being cleanly separated from the &amp;ldquo;motors&amp;rdquo; driving them. &amp;ldquo;Touches&amp;rdquo; provide event sources. &lt;/p&gt;

&lt;p&gt;Graff can currently render using two runtime-selectable backends &amp;mdash; a hardware-accelerated OpenGL backend or a software-only driver. The software backend is extremelly highly optimized using all the ugly demo-scene tips&amp;amp;tricks straight form the &amp;lsquo;90ties. It performs suprisingly well and the demo applications mentioned below can actually run good on our existing hardware (nokia 770, nokia n800). &lt;/p&gt;

&lt;p&gt;Speaking of demos, I made a few simplistic test applications to sketch the idea of what Graff can already do. Video recordings available below. It&amp;rsquo;s a work in progress, early on. &lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;a href="http://files.mdk.am/demos/graff-demo-1.avi"&gt;&lt;img src="http://www.mdk.org.pl/assets/graff_demo_1.png" alt="Graff Demo 1" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://files.mdk.am/demos/graff-demo-2.avi"&gt;&lt;img src="http://www.mdk.org.pl/assets/graff_demo_2.png" alt="Graff Demo 2" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center"&gt;&lt;a href="http://files.mdk.am/demos/graff-demo-3.avi"&gt;&lt;img src="http://www.mdk.org.pl/assets/graff_demo_3.png" alt="Graff Demo 3" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://files.mdk.am/demos/graff-demo-4.avi"&gt;&lt;img src="http://www.mdk.org.pl/assets/graff_demo_4.png" alt="Graff Demo 4" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Image viewer:&lt;/strong&gt; a basic image viewer controlled with thumbs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dancing emotes:&lt;/strong&gt; an example showing objects running along morphable paths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scrolling list:&lt;/strong&gt; contact list with inertia scrolling. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drag:&lt;/strong&gt; trivial drag and drop with some smooth blending.&lt;/p&gt;

&lt;p&gt;The image viewer example uses &lt;a href="http://www.flickr.com/photos/jakubsteiner/"&gt;Jakub&amp;rsquo;s&lt;/a&gt; nice photos. Icons come from our awsome &lt;a href="http://tango.freedesktop.org/Tango_Desktop_Project"&gt;Tango artists&lt;/a&gt;. &lt;/p&gt;
</content><published>2007-04-23T17:14:22+02:00</published><updated>2007-09-24T20:54:05+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/4/23/chapter-1-in-which-we-meet-graff" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:fosdem-2007</id><title type="text">Fosdem 2007</title><content type="html">&lt;p&gt;There is a few of us from &lt;a href="http://www.nokia.com"&gt;nokia&lt;/a&gt; coming to &lt;a href="http://www.fosdem.org"&gt;fosdem&lt;/a&gt;, Brussels. Catch us to chat about gtk, hildon and &lt;a href="http://www.maemo.org"&gt;maemo&lt;/a&gt;. Or we&amp;rsquo;ll catch you.&lt;/p&gt;

&lt;p&gt;I also released nflick 0.4.0 &amp;mdash; a &lt;a href="http://www.flickr.com"&gt;flickr&lt;/a&gt; browser for the maemo platform. Binaries for &lt;strong&gt;scirocco&lt;/strong&gt; and &lt;strong&gt;bora&lt;/strong&gt; can be found &lt;a href="https://garage.maemo.org/projects/nflick/"&gt;at the usual place&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Main changes are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding hw-keys navigation to fullscreen view&lt;/li&gt;
&lt;li&gt;Pressing &amp;ldquo;escape&amp;rdquo; key while viewing a photo will return to the photo list&lt;/li&gt;
&lt;li&gt;Worker dialogs have now proper transiency so they don&amp;rsquo;t block whole device&lt;/li&gt;
&lt;li&gt;Other dialogs have now proper transiency too&lt;/li&gt;
&lt;li&gt;Fixing the bad-paging bug for good&lt;/li&gt;
&lt;/ul&gt;

</content><published>2007-02-22T15:01:10+01:00</published><updated>2007-09-24T20:55:16+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/2/22/fosdem-2007" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:maemo-theming</id><title type="text">Maemo theming</title><content type="html">&lt;p&gt;A bit old news, but &lt;a href="http://www.tigert.com/"&gt;Tuomas&lt;/a&gt; recently released a new version of his awesome &lt;a href="http://www.tigert.com/archives/2007/01/30/new-maemo-development-theme/"&gt;plankton theme&lt;/a&gt;. Judging by the comments on his blog and the screenshots posted on planet maemo, It looks like the theme is liked and appreciated.&lt;br/&gt;
&lt;/p&gt;

&lt;p&gt;I also find tigert&amp;rsquo;s theme aesthetically pleasing and nicely-balanced. It reminds me of a well-formed piece of metal that just feels good in the hands. This is, quite unfortunately, in contrast to default n800 stock themes that remind me of &lt;a href="http://www.epartyunlimited.com/mirrorballs.html"&gt;disco mirror balls&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/German_Democratic_Republic"&gt;DDR&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I sometimes have a feeling that the psychological effect of good theming artwork (understood as well-drawn artwork) is underestimated. After all, this is what the user of the product is going to be living with on a daily basis. It&amp;rsquo;s the face of the device. It can cover-up for many shortcomings of the software or badly expose them &amp;mdash; very much like a pretty-faced girl can often cover up for a plump figure (it doesn&amp;rsquo;t seem to work the other way round, does it?).&lt;/p&gt;

&lt;p&gt;For developing the themes we created a system that decouples the layouts from the actual graphics. The &lt;a href="https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-theme-layout-4/"&gt;layout&lt;/a&gt; contains the common gtkrc styles and other internal bits shared among all themes. The graphics consists of a single &lt;a href="https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-theme-plankton/template/template.png"&gt;template file&lt;/a&gt; that can be easily handled by the artist. A set of &lt;a href="https://stage.maemo.org/svn/maemo/projects/haf/trunk/hildon-theme-tools/"&gt;tools&lt;/a&gt; can be used for various helper tasks. &lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;img src="http://www.mdk.org.pl/assets/theme_diagram.png" alt="Theming diagram" /&gt;&lt;/p&gt;


&lt;p&gt;This dual system is very much similar to the libraries vs. applications in software development. Library (layout) contains some common bits shared among all applications (themes). &lt;/p&gt;

&lt;p&gt;The only things missing in this system is some documentation &amp;mdash; so that someone can actually use it. Coming soon. &lt;/p&gt;
</content><published>2007-02-13T15:23:55+01:00</published><updated>2007-09-24T23:28:54+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/2/13/maemo-theming" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:mono-on-maemo</id><title type="text">Mono on maemo</title><content type="html">&lt;p&gt;I've created some tarballs and a &lt;a href="http://www.maemo.org/maemowiki/mono"&gt;wiki page&lt;/a&gt; describing the process of getting &lt;a href="http://www.mono-project.org"&gt;mono&lt;/a&gt; to work on nokia 770/n800. The solution is a bit dirty &amp;amp; temporary &amp;mdash; but works. &lt;/p&gt;

&lt;p&gt;The biggest limitation now (besides the packaging) is the lack of working Hildon C# bindings. If someone would like to improve the situation, please work against the &lt;a href="https://stage.maemo.org/svn/maemo/projects/haf/branches/hildon-libs/hildon-1/"&gt;new hildon 1.0.0 branch&lt;/a&gt; which should work smoothly with the gapi parser.&lt;/p&gt;

&lt;p&gt;Comments are welcome on our &lt;a href="https://maemo.org/mailman/listinfo/maemo-developers"&gt;mailing list&lt;/a&gt; .&lt;/p&gt;
</content><published>2007-02-04T14:56:00+01:00</published><updated>2007-09-24T23:30:05+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/2/4/mono-on-maemo" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:clone-wars</id><title type="text">Clone wars</title><content type="html">&lt;p style="text-align: center"&gt;&lt;a href="http://www.flickr.com/photos/michaeldominic/372018046/"&gt;&lt;img src="http://farm1.static.flickr.com/164/372018046_3cb84cc06d_m.jpg" alt="Mono eye 1" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://www.flickr.com/photos/michaeldominic/372015630/"&gt;&lt;img src="http://farm1.static.flickr.com/129/372015630_fd61731f1f_m.jpg" alt="Mono eye 2" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="text-align: center"&gt;&lt;a href="http://www.flickr.com/photos/michaeldominic/372018049/""&gt;&lt;img src="http://farm1.static.flickr.com/145/372018049_f365f6dc0c_m.jpg" alt="Mono eye 3" /&gt;&lt;/a&gt; &amp;nbsp; &lt;a href="http://www.flickr.com/photos/michaeldominic/372018057/"&gt;&lt;img src="http://farm1.static.flickr.com/146/372018057_7419260947_m.jpg" alt="Mono eye 4" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;On the above four screenshots one can see a simple &lt;a href="http://www.mono-project.org"&gt;mono&lt;/a&gt; application running in four different environments &amp;mdash; windows xp, linux, nokia 770 and nokia n800. The binary has been compiled &lt;em&gt;once&lt;/em&gt; and executed &lt;em&gt;without any changes&lt;/em&gt; on the four different platforms. &lt;/p&gt;

&lt;p&gt;The application in question (&lt;a href="http://svn.mdk.am/monoeye/"&gt;MonoEye&lt;/a&gt;) is a somewhat more advanced &amp;ldquo;hello world&amp;rdquo; &amp;mdash; it&amp;rsquo;ll show a random picture of whatever the user enters in the entry box. It does so by picking up a random photo from flickr that has a given tag applied. So, when you enter &amp;lsquo;monkey&amp;rsquo; you get a random photo of a monkey. Actually, sometimes you get other strange results &amp;mdash; apparently some people are &lt;strike&gt;sane&lt;/strike&gt; weird enough to &lt;a href="http://www.flickr.com/photos/damienjones/367842738/"&gt;tag their girlfriend photos with a &amp;lsquo;monkey&amp;rsquo; tag&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;In any case this simple application does something &amp;ldquo;real&amp;rdquo; and useful:
&lt;em&gt; A little bit of network http access
&lt;/em&gt; A little bit of regexp for RSS parsing
&lt;em&gt; A little bit of threading (the photo is downloaded in a separate thread)
&lt;/em&gt; A little bit of gtk&lt;/p&gt;

&lt;p&gt;&amp;hellip;and all this stuff works nicely on all the four mentioned platforms.&lt;/p&gt;

&lt;p&gt;I don&amp;rsquo;t think being cross-platform is the biggest advantage of mono, but I smell some interesting opportunities here.&lt;/p&gt;
</content><published>2007-01-28T09:40:00+01:00</published><updated>2007-09-24T23:37:02+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/1/28/clone-wars" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:m-is-for-monkey</id><title type="text">M is for monkey</title><content type="html">&lt;p style="text-align: center"&gt;&lt;a href="http://www.flickr.com/photos/michaeldominic/363791993/"&gt;&lt;img src="http://farm1.static.flickr.com/132/363791993_93eb62a735.jpg" alt="Mono" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;A while back &lt;a href="http://www.advogato.org/person/lupus/diary.html?start=20"&gt;lupus&lt;/a&gt; did a great job of porting &lt;a href="http://www.mono-project.org"&gt;mono&lt;/a&gt; to run on &lt;strong&gt;arm&lt;/strong&gt;. I did some raw experimenting over the weekend and managed to get the whole C# gtk stack running on the &lt;a href="http://www.nokia.com/n800"&gt;N800&lt;/a&gt;. The initial impressions are very positive &amp;mdash; pretty fast startup time, low memory usage.&lt;/p&gt;

&lt;p&gt;Since now all the bits are figured out, the only thing left to do is the boring task &amp;mdash; correct packaging &amp;amp; handling of the whole debian mono tree. We clearly need a &lt;a href="http://www.gnome.org/%7Efherrera/"&gt;real hero&lt;/a&gt; here&amp;hellip;&lt;/p&gt;
</content><published>2007-01-21T15:37:00+01:00</published><updated>2007-09-25T20:49:40+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/1/21/m-is-for-monkey" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2007:next-step-moon</id><title type="text">Next step: moon</title><content type="html">&lt;p style="text-align: center"&gt;&lt;a href="http://www.flickr.com/photos/michaeldominic/350897368/"&gt;&lt;img src="http://farm1.static.flickr.com/159/350897368_7020ee4752.jpg?v=1168294942" alt="N800" /&gt;&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;Nokia &lt;a href="http://www.nseries.com/n800"&gt;N800&lt;/a&gt; is out, we just released it!&lt;/p&gt;

&lt;p&gt;This is not the most sexy-looking babe in town, but she has a lot of punch and she&amp;rsquo;ll get you through the night, the day and all the other horrible stories. &lt;a href="http://www.youtube.com/"&gt;YouTube&lt;/a&gt; works, &lt;a href="http://www.teemuharju.net/2007/01/08/skype-coming-from-n800/"&gt;skype is coming&lt;/a&gt;. The gorgeous high-resolution display rocks hard and is easily the best display in this kind of consumer electronics. &lt;/p&gt;

&lt;p&gt;Oh, and there is a &lt;a href="http://www.maemo.org/#date_07012007a"&gt;developer program&lt;/a&gt; availible so that all the naughty kids that like to tinker with things can get a device for a mere 99 euros. 500 devices are available this way. That&amp;rsquo;s a lot I'd say!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.maemo.org"&gt;Maemo&lt;/a&gt; kicks. &lt;a href="http://www.maemo.org/community/mailing-lists.html"&gt;Join&lt;/a&gt; now. &lt;/p&gt;
</content><published>2007-01-08T15:56:00+01:00</published><updated>2007-09-25T20:51:47+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2007/1/8/next-step-moon" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2006:state-of-diva</id><title type="text">State of Diva</title><content type="html">&lt;p&gt;Over the past few weeks I received a lot of questions regarding the state of the Diva project. I&amp;rsquo;ll try to address them here in a slightly broader context.&lt;/p&gt;

&lt;p&gt;It all started with a goal to create an an easy to use, &amp;ldquo;just working&amp;rdquo; solution to video editing on Linux. It started &amp;ldquo;high up&amp;rdquo; &amp;mdash; as I personally think that our community is now too mature and too creative to just copy solutions seen elsewhere. It&amp;rsquo;s worth trying to aim high, instead of believing in the magic of incremental approach.&lt;/p&gt;

&lt;p&gt;I spent &lt;em&gt;a lot&lt;/em&gt; of time and sweet during the past year hacking on Diva and trying hard to get it working. To some degree it was a success &amp;mdash; some ideas turned out really well, the overall application design &amp;amp; UI is something I'm very satisfied with. Unfortunately, the core video muscle powering Diva was one of the bits that never really worked as expected.&lt;/p&gt;

&lt;p&gt;There were at least two &amp;ldquo;major engine rewrites&amp;rdquo; involved &amp;mdash; adjusting to changes in the gst framework, trying out completely different approaches. It has been a great learning experience and a fun ride. There comes a time however, when you realize you have to stop banging your head against the wall, look around and get a bit more real. &lt;/p&gt;

&lt;p&gt;Over the past month I was trying to wash my head fresh and get out of the &amp;ldquo;burned out&amp;rdquo; state towards the project. I realized that I still want to work on this stuff, even though my clock runs for other cool projects too. I still feel like trying to get it done, but I don&amp;rsquo;t want to repeat any mistakes. It&amp;rsquo;s a shame, that you have to screw the thing many times to learn how to do it right.&lt;/p&gt;

&lt;p&gt;I'm going to start with replacing GStreamer with another framework. Experience tells me now, that (your mileage may vary) GStreamer cannot be used directly to build an advanced video editor. GStreamer is a powerfull framework, and I personally have a big professional respect towards people who hack on it &amp;mdash; they deal with an extremely complex matter. GStreamer solves a lot of problems on the GNOME desktop but it doesn&amp;rsquo;t solve the problem of video editing. &lt;/p&gt;

&lt;p&gt;Gst is a &lt;em&gt;playback&lt;/em&gt; framework, and for video editing you need &lt;em&gt;editing&lt;/em&gt; framework. The later is not, as it&amp;rsquo;s commonly believed, just a superset of the former. The MLT framework is an interesting example of the &amp;ldquo;video editing&amp;rdquo; architecture. &lt;/p&gt;

&lt;p&gt;Only one thing bothers me &amp;mdash; there are so many people who sent me nice and encouraging comments about the project, but somehow it doesn&amp;rsquo;t translate well into code contributions. I used to think this is related to the fact that multimedia is just darn scary and there are not many people who want to deal with it. But recently I realized, that maybe it&amp;rsquo;s just my fault of sending the wrong community &amp;ldquo;signals&amp;rdquo;. Therefore, I want to make one thing clear:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your help and skills can make this thing happen. This is open-source, let&amp;rsquo;s do it together.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;PS: The diva-project website (http://www.diva-project.org) is down because of a dos attack. I believe this is random net stuff since we had some wild spam attacks in the past. But in case someone has something to say &amp;mdash; please, you have to make the message more clear. I'm not getting it. &lt;/p&gt;

&lt;p&gt;I hope it&amp;rsquo;ll be back soon, but in any case &amp;mdash; the subversion server is up and running, the diva sources can be accessed as usual on http://svn.diva-project.org/diva/. &lt;/p&gt;
</content><published>2006-12-07T14:49:00+01:00</published><updated>2007-09-25T20:52:57+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2006/12/7/state-of-diva" rel="alternate" type="text/html" /></entry><entry><id>tag:www.mdk.org.pl,2006:nflick-0-3-0</id><title type="text">NFlick 0.3.0</title><content type="html">&lt;p&gt;It seems one of the more annoying limitations of &lt;strong&gt;NFlick&lt;/strong&gt; was it&amp;rsquo;s inability to display photos that don&amp;rsquo;t belong to any photoset (unsetted photos). A lot of flickers don&amp;rsquo;t use photosets at all, and for them NFlick wouldn&amp;rsquo;t show a single photo. Not good. &lt;/p&gt;

&lt;p&gt;So I did a little bit of work and the just-released version 0.3.0 addresses this issue. &lt;/p&gt;

&lt;p style="text-align: center"&gt;&lt;a href="http://files.mdk.am/screenshots/"&gt;&lt;img src="http://www.mdk.org.pl/assets/nflick_without_set.jpg" alt="NFlick 0.3.0" /&gt;&lt;/a&gt;

Other new features include:

  * A slightly "hildonized" UI look &amp; feel.
  * Informational dialog about the cache size.
  * A possibility to clear the cache.
  * Menu option to reset (remove) all private data stored.
  * Cache can be disabled. 
  * Maemo-launcher is being used for faster startup.

The usual collection of links:

   * [NFlick 0.3.0 binary package](http://files.mdk.am/packages/nflick_0.3.0_armel.deb)
   * [NFlick 0.3.0 source package](http://files.mdk.am/releases/nflick-0.3.0.tar.gz)
   * [Subversion repository](http://svn.mdk.am/nflick)
   * [Troubleshooting &amp; suggestions](http://groups-beta.google.com/group/nflick)

NFlick is a side-project of mine, but [tigert](http://www.tigert.com/) has this neat idea to turn your [770](http://www.nokia.com/770) into a [flickr](http://www.flickr.com) photoframe that cycles through the recent photos posted by your contacts. It would sit quietly on your desk (connected to power &amp; net obviously) and light-up when new content is available. I hope we'll sit down to it at some point. 

</content><published>2006-11-26T16:42:00+01:00</published><updated>2007-09-25T20:58:30+02:00</updated><author><name>Michael Dominic K.</name><uri>http://www.mdk.org.pl</uri></author><link href="http://www.mdk.org.pl/2006/11/26/nflick-0-3-0" rel="alternate" type="text/html" /></entry></feed>
