[企业管理] 对《Visual C++实践与提高——数字图像处理与工程应用篇》一书的

[复制链接]
发表于 2022-9-22 15:16:42
该书说到:位图的一个像素值所占的字节数:当biBitCount=1时,8个像素占1个字节;当biBitCount=4时,2个像素占1个字节;当biBitCount=8时,1个像素占1个字节;当biBitCount=24时,1个像素占3个字节,此刻图画为真彩图画。当图画不是真彩色时,图画文件中包括色彩表,位图的数据表明对应像素点在色彩表中相应的索引值......
当看到这儿我感到很疑惑。我以为色彩表的存在是为了提供一个索引。一般是由于在真彩色呈现之前,由于技术上的因素,计算机在管理时并没有时并没有达到每像素24位的真彩色水平,为此人们创造了索引色彩。可是假如当biBitCount=4时,2个像素占1个字节,即是说图画是一幅是非图画,由于像素值不是0即是1;当biBitCount=8时,1个像素占1个字节,即是图画是一幅灰度图画。在这两种状况下,像素的位已足以表达一切的像素值,那还要色彩表何用?
因而我觉得“当图画不是真彩色时,图画文件中包括色彩表,位图的数据表明对应像素点在色彩表中相应的索引值”似乎是有错误的,由于我觉得索引图画才需求色彩表啊。
BMP_FORMAT.pdf

(The book says: the number of bytes occupied by a pixel value of a bitmap: when biBitCount=1, 8 pixels occupy 1 byte; when biBitCount=4, 2 pixels occupy 1 byte; when biBitCount=4 =8, 1 pixel occupies 1 byte; when biBitCount=24, 1 pixel occupies 3 bytes, and the picture is a true color picture at this moment. When the picture is not true color, the picture file includes a color table, and the data of the bitmap indicates the corresponding index value of the corresponding pixel in the color table.
I was puzzled when I saw this. I thought the color table existed to provide an index. It is generally due to the fact that before the presentation of true color, due to technical factors, the computer did not reach the level of true color of 24 bits per pixel when it was managed. For this reason, people created indexed color. But if when biBitCount=4, 2 pixels occupy 1 byte, that is to say, the picture is a right or wrong picture, because the pixel value is either 0 or 1; when biBitCount=8, 1 pixel occupies 1 byte , that is, the picture is a grayscale picture. In both cases, the bits of the pixel are enough to express all the pixel values, so what is the use of the color table?
Therefore, I think "when the picture is not true color, the picture file includes a color table, and the bitmap data indicates the corresponding index value of the corresponding pixel in the color table" seems to be wrong, because I think the index picture only needs the color table. what.
BMP_FORMAT.pdf)

[下载]15164324483.rar




上一篇:简单的OPENGL应用实例
下一篇:推荐的c语言案例

使用道具 举报

Archiver|手机版|小黑屋|吾爱开源 |网站地图

Copyright 2011 - 2012 Lnqq.NET.All Rights Reserved( ICP备案粤ICP备14042591号-1粤ICP14042591号 )

关于本站 - 版权申明 - 侵删联系 - Ln Studio! - 广告联系

本站资源来自互联网,仅供用户测试使用,相关版权归原作者所有

快速回复 返回顶部 返回列表