22 Jan 2004 donscarletti   » (Master)

I am now implementing filters in librsvg. I enjoy doing such things because writing per-pixel algorithms seems to be one of the things that I like to think I am good at. I always enjoyed that sort of thing and have been doing filters and other graphical manipulation code since I was about 12 (no, I am not joking, I just had a very nerdy, depressing childhood).

Back then of cause I only could use QBasic. If you have never seen a DX386 chugging along doing an erosion algoritm in an interpreted language your life is effectivly a week longer than it would have been if you had. And of cause I didn't have your fancy off-screen pixmaps back then either (I guess most people did, I didn't because I was using a stupid language where you can't declare an array big enough to fit in a 640x480 screen). Now I am coding these filters in C I really appreciate the fact that I don't have to cut my screen in half and copy backwards and forwards betweeen the halves just for a simple blur (not to mention how difficult and pointless a blur is in a 16 colour palette)

The most challenging part of this rsvg thing is actually integrating it into the library itself. If I was coding it myself from scratch I would have used DOM, or failing that I would have used SAX but stored the objects in structures like a tree so I could go back to other information in case I needed to use it again (like multiple instances of an object etc.) Librsvg on the other hand renders everything as it reads it while only preserving data that has been explicitly placed as definitions and even then without their original heirachical context, which makes re-instancing (Is that even a word?) groups impossible. This will need to be fixed in the future, however the annoying thing at the moment is that since it does not preserve the data at lower levels, it relies on stacks for things like transperancys, which means I'll have to code a filter stack, or hack another stack to cover filters as well.

I am starting to like this advogarto thing, I am running into people that I have met before like Penix who I attended a lan with where he refused to run even a pirate copy of windows, so I couldn't kick his arse at anything but UT or Q3 :), and Stevey who contributed to late (my crappy game)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!