Directfb introduction and porting [1]

Source: Internet
Author: User
Tags gtk

**************************************** **************************************** **************************************** ***
Easywave time: 2014.09.13

Category: open-source GUI system-directfb introduction statement: reprinted, please keep the link

NOTE: If any error occurs, please correct it. These are my Learning Log articles ......

**************************************** **************************************** **************************************** ***

I. Introduction to directfb

Directfb is a lightweight graphics library that provides hardware graphics acceleration, input device processing, and abstraction. It integrates a translucent windows system and multi-layer display on the linuxframebuffer driver. It is a layer that uses software to encapsulate graphics algorithms that cannot be supported by the current hardware for hardware acceleration. Directfb is designed for embedded systems. It achieves the highest hardware acceleration performance with minimal resource overhead.

Directfb is a graphical API that exists on the frame buffer layer and under the high-level graphic management layer, such as GTK +. It can provide graphics and hardware acceleration with a small amount of system resources, and provides advanced image operations such as multi-channel a rendering model. It does not modify the Linux kernel, except for the Standard C library. It is applied to the development of DTV Display System Based on Linux system and other projects related to Linux display interface. Supports the vast majority of display cards on the market, and supports input devices such as keyboard, mouse, remote control, game handle, and touch screen. Supports audio and video files and fonts such as JPEG, PNG, GIF, mpeg1/2, Avi, mov, Flash, video4linux, directfb bitmap font, and TrueType.


Ii. Location of directfb IN THE SYSTEM
For the overall system architecture of the GUI, the following figure shows a classic structure for common DMPS, DTV, and STB. Directfb is under the advanced GUI framework such as QT, GTK +, and the driver of the Linux system. As shown in:

In terms of functions, the following figure compares the main functions of directfb: graphics and text processing (directfb adds the bitstream after ts is processed by decoder to form and text, the chip sent to the video together), as shown in:

 


Iii. directfb GUI Architecture

For the upper-layer GUI advanced framework, directfb is transparent and a more detailed structure of directfb:

For the underlying driver, the gfxdriver and the display system (system) of the video card responsible for dealing with hardware are related to various hardware platforms, you may need to write it yourself. To better understand directfb, we need to introduce several concepts in directfb:

  • Layers: Indicates independent image caching. Most embedded devices have multiple layers. Multiple layers are displayed based on the corresponding Alpha value.
  • Surface: represents a reserved memory to store pixel data. The drawing and bilitting operations in directfb are based on the surface. The surface memory can be allocated from the system or from the memory of the video card according to the settings.
  • Primary surface: special surface of a special layer. If the primary surface is a single buffer, any operation on the primary surface will directly respond to the display.
  • Subsurface: a subset of surfac, but does not own any memory.
  • Window/windowstack: controls the display of the surface in a layer. A window is a layer that can be set on a background. Each window has its own surface, which is used to combine images.

For example, there are three layers. The bottom layer is a background image, and the middle layer is a transparent layer with an igel, the top layer is a transparent layer with subtitle. What we see in the display is the mixture of layers.

For example, in the following figure, the lower layer is a layer in full screen mode, and its background image is rendered on its own surface. Video area is a surface used to display video. The upper layer displays the application content through the window stack/window, and the upper layer is a transparent layer. After mixing, you can see the video below through the above layer.

 


Iv. directfb porting

To port directfb, use the following third-party libraries, as shown in:


Introduction to third-party libraries required for directfb:

  • Fontconfig-2.10.92: manages the fonts installed by the system. Match is a font that fills in the various properties of the match font, depending on the font configuration of the application.
  • Freetype-2.5.0: FreeType library is a completely free (Open Source), high-quality and portable font engine that provides a unified interface to access a variety of font format files, including TrueType, OpenType, type1, CID, CFF, Windows Fon/fnt, X11 PCF, etc.
  • Jpeg-8d: Open Source JPEG Library
  • Libpng-1.5.8: PNG Library is used to create and operate PNG format image files, PNG format is designed to replace GIF, he for a smaller range of TIFF (labeled image file formats, with a lot of progress and expansion, and reduced the trouble of patent rights.
  • Libsigc ++-2.2.8: libsigc ++ is a C ++ template library that implements type security callback. Libsigc ++ provides the signal (signal) and slot concepts to implement the signal mechanism. Slot corresponds to a callback function. The signal (signal) is associated with the slot (attach). When a signal is sent (emit), the corresponding slot is called.
  • Libxml2-2.6.28: Contains support for the use of XPath expressions to retrieve a node set that matches a specified criterion. The libxml2 package provides a function library that allows users to manipulate XML files, including reading, modifying, and writing XML and HTML files.
4.1: jpeg-8d compilation configuration the script configuration for build. Sh of the jpeg-8d is as follows:
#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi             --target=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-silent-rules     --disable-dependency-tracking     --enable-maintainer-mode     --enable-ld-version-script     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock             --with-gnu-ldif [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1

Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!
4.2: Compile the libpng-1.5.8 and configure the script configuration of build. Sh for the libpng-1.5.8 as follows:
#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi             --target=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-dependency-tracking     --enable-maintainer-mode     --disable-arm-neon     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock             --with-gnu-ldif [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1
Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!
4.3: libxml2-2.6.28 compilation and Configuration

The script configuration for build. Sh for the libxml2-2.6.28 is as follows:

#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-dependency-tracking     --enable-maintainer-mode     --disable-silent-rules     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock     --disable-documentation     --enable-warnings=min             --with-sax1=yes             --with-catalog=yes             --with-gnu-ldif [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1
Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!


4.4: freetype-2.5.0 compilation and Configuration

The script configuration for build. Sh for the freetype-2.5.0 is as follows:

#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-dependency-tracking     --enable-biarch-config     --disable-mmap     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock             --without-bzip2             --without-zlib             --without-png             --with-gnu-ldif [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1
Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!


4.5: fontconfig-2.10.92 compilation and Configuration

The script configuration for build. Sh for the fontconfig-2.10.92 is as follows:

#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATHexport LDFLAGS="-L$INSTALL_PATH/lib"export CFLAGS="-I$INSTALL_PATH/include"export PKG_CONFIG_PATH="$INSTALL_PATH/lib/pkgconfig" export LIBS="-ldl -lpthread -lpng"if [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-dependency-tracking     --disable-silent-rules             --disable-largefile     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock     --enable-libxml2     --disable-iconv             --with-gnu-ld             FREETYPE_CFLAGS="-I$INSTALL_PATH/include/freetype2"             FREETYPE_LIBS="-L$INSTALL_PATH/lib -lfreetype"             LIBXML2_CFLAGS="-I$INSTALL_PATH/include/libxml2"             LIBXML2_LIBS="-L$INSTALL_PATH/lib -lxml2"if [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1
Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!


4.6: libsigc ++-2.2.8 compilation and Configuration

The script configuration for libsigc ++-2.2.8 build. Sh is as follows:

#!/bin/bashif [ "$1" == "" ]; thenINSTALL_PATH=`pwd`/_installelseif [ -d $1 ]; thenINSTALL_PATH=$1elseexit 1fifimkdir -p $INSTALL_PATH#autoreconf -ivfif [ -f config.log ]; thenmake distcleanfi./configure --prefix=$INSTALL_PATH             --host=arm-none-linux-gnueabi     --build=i486-linux-gnu     --disable-option-checking     --disable-dependency-tracking     --enable-maintainer-mode     --enable-shared=yes     --enable-static=no     --enable-fast-install=yes     --disable-libtool-lock     --enable-ipv6=no             --with-gnu-ldif [ $? -eq 0 ]; then        make        if [ $? -eq 0 ]; then                make install                exit 0        fifiexit 1
Compile and configure the database to a dynamic library. As shown in the build. Sh script above, you can view the specific configuration through the configure -- Help Command!


V. Transplantation Summary

The next article will introduce directfb porting in detail. This article will only detail compilation and configuration of third-party libraries required by directfb.




 


 

 

Directfb introduction and porting [1]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.