android framebuffer adb pull
1. 读取设备的framebuffer,最简单的方式是通过 adb
adb shell
cd /dev/graphics
cat fb0 > screen ;得到当中主屏幕的内容
你可以切换屏幕,然后将之前暂存的屏幕内容写入到当前主屏幕当中,其显示的内容是之前的内容
cat screen > fb0
2. 得到本身机器的framebuffer的格式,可以使用系统自带的 test-fb-refresh bin,
其的源代码在pizza/system/extras/tests/framebuffer目录下面
执行的结果
using (fd=3)
id = fb0
xres = 2048 px
yres = 1536 px
xres_virtual = 2048 px
yres_virtual = 1536 px
bpp = 16
r = 16:8
g = 8:8
b = 0:8
width = 216 mm (240.829620 dpi)
height = 135 mm (288.995544 dpi)
refresh rate = 56.30 Hz
upper_margin=9, lower_margin=3, left_margin=5, right_margin=150, pixclock=5208, finfo.smem_len=37748736
refresh rate = 27562.446167 Hz
refresh rate = 23961.063272 Hz
refresh rate = 28283.542514 Hz
3. 发现launche与mylauncher其的界面与fb不一样。
4. linux RGB像素格式
Name
Packed RGB formats — Packed RGB formats
Description
These formats are designed to match the pixel formats of typical PC graphics frame buffers. They occupy 8, 16, 24 or 32 bits per pixel. These are all packed-pixel formats, meaning all the data for a pixel lie next to each other in memory.