25-11-2013

HowTo build Qt5.1.1 static with MinGW.

Reduce executable size with UPX.

A simple Color Picker 1.1.

Projects other

Qt5.1.1 static build with MinGW

This is a small step-by-step howto compile a static Qt5.1.1 framework from source, using the MinGW 4.8.1 development environment.

NOTES: (Will be updated to propper text and HTML soon...)

DOWNLOADS:
Download MinGW Installer:
http://sourceforge.net/projects/mingwbuilds/files/mingw-builds-install/

Download Qt5 Source Zip:
http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.zip

PATCH SOURCE:
Patch mkspecs (line 69):
<Qt5.1.x>\qtbase\mkspecs\win32-g++\qmake.conf
QMAKE_LFLAGS = -static -static-libgcc

Patch mkspecs (line 28) optional (reduce file size static builds):
QMAKE_CFLAGS = -ffunction-sections -fdata-sections ...

Patch Makefile.win32 (line 50):
<Qt5.1.x>\qtbase\qmake\Makefile.win32
LFLAGS = -static-libgcc ...

Patch for MinGW 4.8.1 (older MinGW 4.6.x works with-out patch):
https://codereview.qt-project.org/#change,63747
Replace file with patched version:
<Qt5.1.x>\qtbase\src\corelib\ioqfilesystemengine_win.cpp
https://codereview.qt-project.org/#patch,sidebyside,63747,3,src/corelib/io/qfilesystemengine_win.cpp

Patch for MinGW 4.8.1 (older MinGW 4.6.x works with-out patch):
https://codereview.qt-project.org/#change,64330,patchset=1
Replace file with patched version:
<Qt5.1.x>\qtbase\src\plugins\platforms\windows\qwindowstheme.cpp
https://codereview.qt-project.org/#patch,sidebyside,64330,1,src/plugins/platforms/windows/qwindowstheme.cpp

Python (needed by the qtjsbackend to fix the v8 error):
http://www.python.org/download/releases/
Add \Python to Path:
set PATH=%PATH%;C:\Python33

CONFIGURE:
Add MinGW to Path:
set PATH=%PATH%;C:\MinGWx32\mingw32\bin

In <Qt5.1.x>\
configure -platform win32-g++ -release -static -opensource -no-opengl -qt-zlib -qt-libpng -qt-libjpeg -nomake examples

BUILD:
In <Qt5.1.x>\
mingw32-make -j

Qt Creator:
Add to Qt Creator
Tools->Options
Build & Run
Compilers -> Add MinGW used to build Qt5.1.x -> Add->MinGW -> browse to <MinGW>\bin\g++.exe (Apply)
Qt Versions -> Add Qt5.1.x static MinGW build -> Add -> browse to <Qt5.1.x>\qtbase\bin\qmake.exe (Apply)
Kits -> Add Qt5.1.x static with MinGW compiler -> Add -> compiler:MinGW & qtVersion:Qt5.1.xStaticMinGW & qtmkspecs:win32-g++

Ready to build !!!

Reduce size (static) executables

This little (cross-platform) executable compression tool Ultimate Packer for eXecutables (UPX) can greatly reduce the size of (static build) executables. The executable filesize will be reduced to the size of a ZIP file containing the same executable.

The tool is very easy to use, just drag-and-drop your executable onto the upx.exe to use the default (fast) compression option of the tool, or type "upx <filename>" in the command-line. Adding the (much slower) "--utra-brute" command-line argument will reduce the filesize even further.

A static build Qt5.1.1 MinGW compiled application with a filesize of 12.972.032 bytes (12.3MB):

Default: 12.972.032 bytes (12.3MB) is reduced to 5.218.816 bytes (4.97 MB) using the (fast) default settings.

Ultra brute: 12.972.032 bytes (12.3MB) is reduced to 4.488.704 bytes (4.28 MB) using the (much slower) "--ultra-brute" argument.

Color Picker 1.1

I build a simple Color Picker 1.1 application that samples the pixel color under the mouse cursor point. The application is a stand alone (static build) Qt5 application with some minor Win32 API stuff, to sample the color at the cursor position.

Color Picker 1.1

The application supports a number of RGB based color formats and formating formats. The application can run in the background, and used the CTRL+1, CTRL+2, and CTRL+3 hotkey combinations to sample a color in one of its three sample slots. The CTRL+SHIFT+1, CTRL+SHIFT+2, and CTRL+SHIFT+3 hotkey combinations can be used to copy the sample slot content to the clibboard. This enables easy copy and paste access to the sampled color values.

Projects TU/e

Genome visualisation application

Graduation project at the Visualization Group of Eindhoven University of Technology, with the goal add genome size data support to the existing DNAVis2 sequence browser. The basic DNAVis2 sequence browser is an OpenGL accelerated visualization tool to visualize and explore a small number of annotated DNA sequences. The application is written in Java using the NetBeans framework and the JOGL OpenGL bindings.

The extended version is designed and implemented during this master project and adds the data structures and visualizations needed to visualize and explore the data of a complete genome, consisting of 10.000-100.000 annotated DNA sequences. Two approaches are used to provide more inside into the dataset as a whole.

The first approach makes use of the higher level DNA structures to visualize the data distribution and to provide a high level interface to lower level annotations and sequencing data. This provides the biologist with the tools to browse and create sub-selection using the DNA’s structural properties.

Circle Circle Circle Circle
Circle

The second approach provides a versatile interface to cross-reference various data properties across all abstraction levels. This tool provides the biologist with an inside into the annotation data of the dataset as a whole (or a predefined sub-selection of the data), this results cross-reference visualizations than can contain more then 10.000 row and column items.

Matrix Matrix Matrix Matrix
Matrix

Flow visualisation application

The flow visualization application is the result of a visualization master class, this application uses a number of visualization techniques that are implemented using (OpenGL and C99/C++) to simulate smoke flow in infinite space. This application can visualize the smoke density, particle flows, and pressure areas resulting for a dynamically created smoke source.

Smake SIM Smake SIM Smake SIM Smake SIM
Smake SIM

Eyes tracking application

The face and pupil recognition application is the result of a computer graphics class, this application makes use of C99/C++ and the OpenCV (Open Source Computer Vision) library to find the face of a user and track his pupils using an inexpensive webcam. The idea it to calculate the viewing position on the computer screen using the webcam images. The resulting application was able to calculate a raw approximation of the screen location after small calibration procedure that uses 5 points on the screen (center, and all four corners). The application is also able to locate the user’s nostrils and mouth.

Eye tracker

Wireless 3D Game Controller 2.0

The wireless 3D game controller version 2.0 is the result of a virtual reality class at the university. This was a very small project which reused the hardware of the version 1.0 (see 3D game controller version 1.0) project. But this time a three axis low-g micro-machined accelerometer (MMA7260Q) was used instead of the tilt switches and the AM signal-meters of the firest version. This resulted in a far more stable product, but it limited the use to either tilting or 3D movement detection because we could only afford a single accelerometer.

Projects Fontys

FPGA video encoder/decoder

Graduation project at Philips TASS (now TASS Software Professionals), with the goal to design and implement a FPGA based video encoder and decoder application using the Celoxica RC200 (Xilinx Virtex II FPGA based) development board and the Handel-C hardware description language.

The FPGA video encoder and decoder are based on the RmaxCmax compression algorithm developed by Philips Research Laboratories. This compression algorithm uses discrete cosine transforms (DCT), like MPEG and JPEG. The algorithm transforms pixel blocks (of 8x4 or 8x8) into DCT coefficient blocks. The bit-planes of these DCT coefficient blocks (starting with the most significant bit-plane) are then compressed using zonal coding (meaning that only a small area of the bit-plane will be transmitted/stored). This data is then serialized in a way that the most significant data is transmitted/stored first. The resulting bit-string can be cut off at any length (to increase the compression), the remaining bit-string will produce the “best possible” image quality for the remaining data size.

A graphical user interface (GUI) is programs within the FPGA itself, and provides the user with a fast and simple interface to view the encoding/decoding process and tweak the settings. The user can select a part of the video input, set the quality (read bit-rate), and can view the resulting decoded video output.

FPGA FPGA FPGA
FPGA

Wireless 3D Game Controller

The wireless 3D game controller version 1.0 is the result of HBO project (pre Wii era). The wireless game controller system uses four tilt switches and four AM signal-meters to determine the tilting position and location in 3D space of the wireless game controller. We liked to use accelerometers, but these were out of our budget.

The game controller itself is build around an Atmel AVR ATTiny15L microcontroller combined with a 433MHz AM transmitter, four tilt switches, and four normal pressure switches. The microcontroller controller is programmed using AVR assembler, the program scans all the 8 buttons (4 tilt + 4 normal) and transmits a data frame with their status using the AM transmitter.

The base station contains an Atmel C51 AT89C5132 microcontroller combined with a 433MHz AM receiver, four AM signal-meters divided over two columns (every column has one signal-meter in the  top and one in the bottom), and an USB1.1 connection to a PC. This controller is programmed using ANSI C, the program reads the data frame received from the wireless game controller, samples the signal-strength of the four AM signal-meters, and combines this information into a single USB data frame.

The PC reads the USB data from the base station using a small Delphi application, this application calculated the controller’s position using the signal strengths from the signal-meters, enables the user to calibrate the controller, and makes it possible to map virtual mouse and keyboard inputs to the controller inputs. This mapping makes it possible to use the controller in every existing application.

Controller Controller Controller Controller
Controller