Qt::CheatTransform was supposed to be a joke in Qt Developer Days graphics talk (though some people took it seriously). It still resembles the idea of blazing-fast by cheating whenever you can. Basically this is about creating a thumbnail preview of a large image in an optimized way. Downscaling an image is usually done using QImage::scaled() function. You have two choices: Qt::SmoothTransformation gives the best quality but very slow or Qt::FastTransformation is extremely fast at the expense of the quality. But what if there is a compromise: not too slow but the quality is still acceptable? Well, apparently it is possible to do. Check out my latest Qt Labs blog which exactly exposes the trick.
In the above screenshot, the result of downscaling a 10-megapixel picture is depicted. There are three images, each for Qt::FastTransformation, Qt::SmoothTransformation and one "cheat scaling" method. Use the key 1 to 3 to switch the scaling method and watch out the bottom right image. If you flip back and forth using 2 (for Qt::SmoothTransformation) and 3 (using the cheat method), can you spot the different pixels immediately? Do you think the cheat downscaled image is good enough?
How about the speed? Check out the following chart (longer is better), which speaks for itself:
Of course your milage may vary. The above comparison is for downscaling a 10-megapixel image to something like 200x150 pixels. You may gain less for smaller source images, though.
Let us start with a comparison (longer is better):
If you see the my latest graphics example: 50% scaling of (A)RGB32 image, you will find a 10x faster way (compared to QImage::scaled() function) to downscale an image to the half its original size, of course with (approximately) the same visual quality as when you use Qt::SmoothTransformation.
For the readers who also did listened to my Qt Developer Days graphics talk, you can have an idea why I make so much fuss just for image halfscaling :-) Bear with me and we will reach that point.
Using WebKit, it is quite trivial to create a tool that grabs the contents of a web page and then saves everything as an image. Together with the new full page zoom feature, we can have the zoomed in or zoomed out version of the page, even at different viewport sizes (which may simulate different screen resolutions). In fact, that is what I describe in Qt Labs on the topic of Capturing web pages.
Just imagine you can have that small utility and you can run something like (web address, zoom factor in percent, output filename, optionally also the viewport width):
webcapture www.trolltech.com 50 trolltech.png
what would you do then?
One small step for Qt Software, one giant leap for mankind...
Here is step by step short instructions if you want to play Quake III: Arena using the bleeding-edge version of ioquake3. Reasons to do this (instead of using the vanilla Q3A executable): ioquake is still actively developed and maintained and it has new fancy features like in-game VoIP, SDL backend, OpenAL support, x86-64 JIT, MinGW build, and many others.
Get ioquake3 source code using subversion, git, or a normal plain web browser.
To get the source code using Subversion:
svn co svn://svn.icculus.org/quake3/trunk ioquake3
Windows users might want to use something like TortoiseSVN and enter svn://svn.icculus.org/quake3/trunk to check it out.
Since cool kids are using git these days, I set up an unofficial git mirror of the repository at github.com/ariya/ioquake3/. It is synchronized with the subversion repository. To get the code:
git clone git://github.com/ariya/ioquake3.git
Windows users might want to use something like msysgit.
If you are allergic to subversion and git, grab the most up-to-date source code as ZIP or tar.gz package. Use a web browser or tool like wget. How is the last one possible? Hint: download button at the github page.
Build ioquake3, which is quite easy.
On Windows, you need MinGW, MSYS, along with typical development packages (gcc, make, etc). Run MSYS, go to the ioquake3 source directory (e.g. C:\ioquake3), and just type make. If everything is OK, you will get the executable (e.g. at C:\ioquake3\build\release-mingw32-x86\ioquake3.x86.exe). After that, grab SDL 1.2.11 (try to match it with ioquake3, see e.g. C:\ioquake3\code\SDL12\include\SDL_version.h) development package for MinGW, extract it and put it in your MinGW directory (e.g. C:\MinGW).
On Linux/Unix, you need SDL and OpenAL development packages. Then go to the ioquake3 source (e.g. ~/ioquake3) directory and type make. You will find the executables at the build subdirectory (e.g. ~/ioquake/build/release-linux-i386/ioquake3.i386)
Start to play, since the executable is now ready. Before that, we need to copy the Q3A game data.
On Windows, get the pak0.pk3 from your Q3A CD. Afterwards, find and install Q3A point release 1.32 and then locate its additional data files (e.g. C:\Program Files\Quake III Arena\baseq3). Place all these *.pk3 files to your user Q3 directory (e.g. C:\Document and Settings\username\Application Data\Quake3\baseq3). Launch ioquake3 and you are set.
On Linux/Unix, copy all pk3 files to the baseq3 directory (e.g. ~/.q3a/baseq3). Again, if you have installed 1.32 point release, there will be 9 pk3 files needed. Now just launch the ioquake.i386 executable and have some fun.
Related note: if you don't own Quake 3, then just download and install OpenArena. Of course, it is not an exact 1:1 copy of Quake 3, but enough to have some fraggin' fun. You don't even need to bother with building ioquake3 at all because OpenArena already packages it. If you are bored with Q3A, there are other similar free and good games, like Warsow, Nexuiz, Tremulous, Urban Terror, and many others.
Let us start with a screenshot:
The graph itself is not something new, since I just recreated SquirrelFish Extreme comparison (against its predecessors). The focus is actually the tool which was used to generate that bar chart.
For the code and a little explanation, check out what I wrote on Qt Labs on the topic of QtScript-based bar chart.
Just like Jim Rohn said: Miss a meal if you have to, but don't miss a book, these days I force myself to read more books more often than before. Here is a list of English fictions that I managed to read fortnightly, in the order of my preference, just in case you are looking for good books and want to read some of them as well.
I may forget some other books. But maybe those are not really important after all.