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
本文介绍了一种在嵌入式系统中通过编写C语言程序来设置全局Alpha透明度值的方法,并提供了从编译到执行的完整流程。
5490

被折叠的 条评论
为什么被折叠?



