91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 10KB
    文件類(lèi)型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-05-10
  • 語(yǔ)言: 其他
  • 標(biāo)簽: linux??fb??幀緩沖??

資源簡(jiǎn)介

linux fb-test-幀緩沖 兩個(gè)例子(完整源代碼),在Ubuntu上實(shí)驗(yàn)通過(guò)。

資源截圖

代碼片段和文件信息

#if?0
#include?
#include?
#include?
#include?
#include?
#include?

int?main()
{
????int?fbfd?=?0;
????struct?fb_var_screeninfo?vinfo;
????struct?fb_fix_screeninfo?finfo;
????long?int?screensize?=?0;
????char?*fbp?=?0;
????int?x?=?0?y?=?0;
????long?int?location?=?0;
????fbfd?=?open(“/dev/fb0“?O_RDWR);
????if?(!fbfd)?{
????????printf(“Error:?cannot?open?framebuffer?device.\n“);
????????exit(1);
????}
????printf(“The?framebuffer?device?was?opened?successfully.\n“);
????if?(ioctl(fbfd?FBIOGET_FSCREENINFO?&finfo))?{
????????printf(“Error?reading?fixed?information.\n“);
????????exit(2);
????}
????if?(ioctl(fbfd?FBIOGET_VSCREENINFO?&vinfo))?{
????????printf(“Error?reading?variable?information.\n“);
????????exit(3);
????}
????printf(“%dx%d?%dbpp\n“?vinfo.xres?vinfo.yres?vinfo.bits_per_pixel?);
????screensize?=?vinfo.xres?*?vinfo.yres?*?vinfo.bits_per_pixel?/?8;
????fbp?=?(char?*)mmap(0?screensize?PROT_READ?|?PROT_WRITE?MAP_SHARED
???????????????????????fbfd?0);
????if?((int)fbp?==?-1)?{
????????printf(“Error:?failed?to?map?framebuffer?device?to?memory.\n“);
????????exit(4);
????}
????printf(“l(fā)sq--1->The?framebuffer?device?was?mapped?to?memory?successfully.\n“);
????x?=?100;
????y?=?100;
????for?(?y?=?100;?y?????????for?(?x?=?100;?x?????????????location?=?(x?+?vinfo.xoffset)?*?(vinfo.bits_per_pixel?/?8)?+
???????????????????????(y?+?vinfo.yoffset)?*?finfo.line_length;
????????????if?(?vinfo.bits_per_pixel?==?32?)?{
????????????????*(fbp?+?location)?=?100;
????????????????*(fbp?+?location?+?1)?=?15?+?(x?-?100)?/?2;
????????????????*(fbp?+?location?+?2)?=?200?-?(y?-?100)?/?5;
????????????????*(fbp?+?location?+?3)?=?0;
????????????}?else??{
????????????????int?b?=?10;
????????????????int?g?=?(x?-?100)?/?6;
????????????????int?r?=?31?-?(y?-?100)?/?16;
????????????????unsigned?short?int?t?=?r?<????????????????*((unsigned?short?int*)(fbp?+?location))?=?t;
????????????}
????????}
????munmap(fbp?screensize);
????close(fbfd);
????printf(“l(fā)sq--2->??close(fbfd).\n“);
????return?0;
}

#endif

#include?
#include?
?#include?
?#include?
?#include?
?#include?
?#include?

?int?main()
?{
?????int?fbfd?=?0;
?????struct?fb_var_screeninfo?vinfo;
?????struct?fb_fix_screeninfo?finfo;
?????long?int?screensize?=?0;
?????char?*fbp?=?0;
?????int?x?=?0?y?=?0;
?????long?int?location?=?0;
?????int?startx=0?starty=0;
?????int?width?height;

?????//?Open?the?file?for?reading?and?writing
?????fbfd?=?open(“/dev/fb0“?O_RDWR);
?????if?(fbfd?==?-1)?{
?????????perror(“Error:?cannot?open?framebuffer?device“);
?????????exit(1);
?????}
?????printf(“The?framebuffer?device?was?opened?successfully.\n“);

?????//?Get?fixed?screen?information
?????if?(ioctl(fbfd?FBIOGET_FSCREENINFO?&finfo)?==?-1)?{
?????????perror(“Error?reading?fixed?information“);
?????????exit(2);
?????}

?????//?Get?variable?sc

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----

?????文件???????4925??2017-05-12?15:23??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)\fb-test1.c

?????文件???????1945??2017-05-12?15:16??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)\fb-tst2.c

?????文件??????13224??2017-05-12?15:23??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)\test1

?????文件???????9344??2017-05-12?15:22??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)\test2

?????文件????????724??2017-05-12?16:03??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)\在Ubuntu16.04系統(tǒng)下測(cè)試幀緩沖(frame?buffer)的說(shuō)明.txt

?????目錄??????????0??2017-06-18?18:05??linux?fb-test-幀緩沖?兩個(gè)例子(完整源代碼)

-----------?---------??----------?-----??----

????????????????30162????????????????????6


評(píng)論

共有 條評(píng)論