DirectFB

From Yan-server-AMD1G

Jump to: navigation, search

This wiki is for sharing information on setting up and using DirectFB.

Contents

[edit] Introduction

  • A graphical accelerator bypassing X-Window using Linux Frame Buffer Device
  • Mostly used in Embedded devices with limited resources
  • Supported image types:
    • JPEG
    • PNG
    • GIF
  • Supported video types:
    • MPEG 1/2
    • AVI
    • MOV
    • Macromedia Flash
    • Video4linux
  • Supported font types:
    • bitmap fonts
    • freetype2


[edit] Architecture

Image:Dfb architecture.svg


[edit] Porting

[edit] DirectFB

  • Install packages
 sudo apt-get install libdirectfb-bin libdirectfb-dev libdirectfb-extra
  • Note the version number used

[edit] Enable Linux FrameBuffer Support

  • Enable the use of framebuffer (/dev/fb0) at bootRef
    • add vga=791 (1024x768) to kernel line in /boot/grub/menu.lst
 title		Ubuntu 8.04.2, kernel 2.6.24-23-generic
 root		(hd0,1)
 kernel	/vmlinuz-2.6.24-23-generic root=UUID=cb6371e9-d904-4d9f-a990-5a195956d747 ro quiet splash vga=791
 initrd	/initrd.img-2.6.24-23-generic
 quiet
  • Update database:
 sudo update-grub
  • Reboot system

[edit] DirectFB Examples

 sudo ./configure --prefix=/usr
  • Make project:
 sudo make
  • Install:
 sudo make install
  • Goto /DirectFB-examples-1.x.x/src
  • Run demo programs:
 sudo ./df_andi
 sudo ./df_window
 sudo ./df_neo [[--dfb:no-hardware]]


[edit] API Documentation


[edit] Developing DirectFB Programs


[edit] Terminologies

  • Blit: copy image data
  • Screen: the bottom level representing the displayable screen
  • Layer: a screen has at least 1 layer, or more. Layers can overlay on top of each other with transparency (alpha channel) support.
  • Window: multiple windows can be created on a layer. Each window has a (drawable) surface associated with it.
  • Surface: store pixel data using one or more buffers


[edit] References