位平面

来源:互联网 发布:软件的测试方案 编辑:程序博客网 时间:2024/04/27 19:27

一块水平放置的屏幕,其一个像素的颜色值需要用32位2进制数字(4字节)来表示

想象一下这个32位的存储空间是竖直方向上的32个格子。。。

那么。。


我们可以用煮酸菜鱼时片鱼片儿的方法把这个屏幕立方体片成32个片,

其中的一片就叫位平面。一个bitplane。它的大小就是屏幕的宽*高。

帧缓存的大小呢,可以理解为第三副图那个屏幕立方体的体积,即这个屏幕立方体的格子总数。

要注意的是位平面在帧缓存中的组织方式。

到底是以一个像素的颜色值为单位连续存储(即先存储一像素完整的32位的颜色值,接着再存下一像素的32位颜色值)?(1)

还是以一个位平面为单位连续存储(即4个连续的字节代表的不是一个像素的32位颜色值,而是32个连续像素在某个位平面上的值)? (2)

这不是确定的。貌似windows下的16色屏幕就是以(2)的方式在组织帧缓存。

(2011/6/15 update:一般情况下,帧缓存由window系统生成并管理,供OpenGL使用。)

并且帧缓存的存储方式也并不仅限以上两种。

尾记:起因是OpenGL红宝书中的一段话。

Information about the pixels (for instance, what color they’re supposed to be) is organized in memory into bitplanes. A bitplane is an area of memory(容易理解成位平面是物理连续的,wrong!) that holds one bit of information for every pixel on the screen; the bit might indicate how red a particular pixel is supposed to be (这bit描述了这个像素到底有多红,实际上是一定程度上描述了,比如,这个位面是红色数据字节的最高位,那么它描述的程度是比较大的了。描述它多红的位面很可能不只一个。), for example. The bitplanes are themselves organized into a framebuffer(很容易误解位面是frambuffer组织的最小单位,其实未必。), which holds all the information that the graphics display needs to control the color and intensity of all the pixels on the screen.

原创粉丝点击