i.MX31 PDK Board Alpha Blending

Document created by jesseg Employee on Aug 17, 2012Last modified by Jodi Paul on May 20, 2013
Version 3Show Document
  • View in full screen mode

Enter inside ~/ltibdir/rpm/BUILD and create a directory 'alpha':

$ cd ltib/rpm/BUILD 
$ mkdir alpha 

Enter in 'alpha' dir and create setalpha.c file:

$ cd alpha
#include <stdio.h> 
#include <stdlib.h> 
#include <sys/types.h>
 #include <sys/stat.h> 
#include <fcntl.h> 
#include <sys/ioctl.h> 
#include <unistd.h> 
#include <asm/arch/mxcfb.h>  

int main(int argc, char **argv) 
{ 
             int fb_fd; 
             struct mxcfb_gbl_alpha gbl_alpha;  

             if(argc != 2){ 
                      printf("Usage: %s alpha_val[0-255]\n",argv[0]); 
                      return -1; 
             }  

             fb_fd = open("/dev/fb0",O_RDWR,0); 
             gbl_alpha.enable = 1; 
             gbl_alpha.alpha = atoi(argv[1]); 
             ioctl(fb_fd, MXCFB_SET_GBL_ALPHA, &gbl_alpha); 
             close(fb_fd); 
             return 0; 
} 

Compile it using this command:

./ltib -m shell 
LTIB> cd rpm/BUILD/alpha 
LTIB> gcc -I../linux/include setalpha.c -o setalpha

In your board execute it:

root@freescale /home$ /unit_tests/mxc_v4l2_output.out -iw 320 -ih 240 -ow 480 -oh 640 -d 3 -r 4 -fr 5 qvga.yuv & 

While it is playing execute:

root@freescale /home$ setalpha 128 
root@freescale /home$ cat screen.raw > /dev/fb0

 

 

We used frame rate at 5 fps to have more time to execute next two commands.


Attachments

    Outcomes