Difference between revisions of "QtImageCodec"
(Draft version outlined.) |
(Refined document) |
||
Line 1: | Line 1: | ||
= Introduction = | = Introduction = | ||
− | QtImageCodec - image codec for CEGUI, that loads images using Qt. | + | QtImageCodec - image codec for CEGUI, that loads images using [http://qt.nokia.com Qt]. |
= Installation = | = Installation = | ||
== Compile image codec == | == Compile image codec == | ||
− | Download image codec sources. Extract it. In extracted directory open terminal and type: | + | Download image codec [http://sasha_sinicyn.users.sourceforge.net/projects/ceguiqtimagecodec.tar.gz sources]. Extract it. In extracted directory open terminal and type: |
− | + | qmake | |
− | + | make | |
− | Put compiled "libCEGUIQtImageCodec-0.7.0.so" from "bin" to system directory for shared libraries. This can be "/usr/local/lib" for example. Then run "ldconfig" as administrator. | + | Put compiled '''"libCEGUIQtImageCodec-0.7.0.so"''' from '''"bin"''' to system directory for shared libraries. This can be '''"/usr/local/lib"''' for example. Then run '''"ldconfig"''' as administrator. |
== Compile qt plugin for TGA support == | == Compile qt plugin for TGA support == | ||
− | Qt does not support | + | Qt does not support TGA image loading, but there is a plugin for it in [http://www.kde.org KDE] that supports doing that. To compile it download its source from the following locations: |
− | + | http://websvn.kde.org/*checkout*/trunk/KDE/kdelibs/kimgio/tga.h | |
− | + | http://websvn.kde.org/*checkout*/trunk/KDE/kdelibs/kimgio/tga.cpp | |
− | Put it into a separate directory, for example "qtga". In that directory open terminal and issue the following command: | + | Put it into a separate directory, for example '''"qtga"'''. In that directory open terminal and issue the following command: |
− | + | qmake -project | |
− | Open generated project file ("qtga.pro") and make sure it contains the following statements: | + | Open generated project file ('''"qtga.pro"''') and make sure it contains the following statements: |
− | + | TEMPLATE = lib | |
− | + | CONFIG += plugin | |
Then in the terminal type: | Then in the terminal type: | ||
− | + | qmake | |
− | + | make | |
− | Put the built shared library ("libqtga.so") to "imageformats" subdirectory of qt plugin directory. For example this can be something like "/usr/lib64/qt4/plugins/imageformats" on 64 bit linux system. | + | Put the built shared library ('''"libqtga.so"''') to '''"imageformats"''' subdirectory of qt plugin directory. For example this can be something like '''"/usr/lib64/qt4/plugins/imageformats"''' on 64 bit linux system. |
== Configure CEGUI library == | == Configure CEGUI library == | ||
Line 40: | Line 40: | ||
In order to make this codec the default image codec used by CEGUI before compiling CEGUI configure it with the following command: | In order to make this codec the default image codec used by CEGUI before compiling CEGUI configure it with the following command: | ||
− | + | ./configure --with-default-image-codec=QtImageCodec | |
Alternatively image codec used by CEGUI system can be changed in the source code of an application: | Alternatively image codec used by CEGUI system can be changed in the source code of an application: | ||
− | + | CEGUI::System::getSingleton ().setImageCodec ("QtImageCodec"); |
Revision as of 14:19, 3 October 2009
Contents
Introduction
QtImageCodec - image codec for CEGUI, that loads images using Qt.
Installation
Compile image codec
Download image codec sources. Extract it. In extracted directory open terminal and type:
qmake make
Put compiled "libCEGUIQtImageCodec-0.7.0.so" from "bin" to system directory for shared libraries. This can be "/usr/local/lib" for example. Then run "ldconfig" as administrator.
Compile qt plugin for TGA support
Qt does not support TGA image loading, but there is a plugin for it in KDE that supports doing that. To compile it download its source from the following locations:
http://websvn.kde.org/*checkout*/trunk/KDE/kdelibs/kimgio/tga.h http://websvn.kde.org/*checkout*/trunk/KDE/kdelibs/kimgio/tga.cpp
Put it into a separate directory, for example "qtga". In that directory open terminal and issue the following command:
qmake -project
Open generated project file ("qtga.pro") and make sure it contains the following statements:
TEMPLATE = lib CONFIG += plugin
Then in the terminal type:
qmake make
Put the built shared library ("libqtga.so") to "imageformats" subdirectory of qt plugin directory. For example this can be something like "/usr/lib64/qt4/plugins/imageformats" on 64 bit linux system.
Configure CEGUI library
In order to make this codec the default image codec used by CEGUI before compiling CEGUI configure it with the following command:
./configure --with-default-image-codec=QtImageCodec
Alternatively image codec used by CEGUI system can be changed in the source code of an application:
CEGUI::System::getSingleton ().setImageCodec ("QtImageCodec");