简体   繁体   English

如何使用 vga 调色板

[英]How to use vga palettes

I switched to VESA mode 105h which is a 256 color mode.我切换到 VESA 模式 105h,这是一种 256 色模式。 When I checked the palette data using AX = 4F09h, I got values that matched the colors displayed on the screen.当我使用 AX = 4F09h 检查调色板数据时,我得到的值与屏幕上显示的 colors 相匹配。

When I switched the mode to 118h, a 16.8M color mode, I checked the palette table and the same values are still there even though the colors displayed are different.当我将模式切换到 118h(一种 16.8M 色彩模式)时,我检查了调色板表,即使显示的 colors 不同,仍然存在相同的值。

How do I get the palette data for the new mode I switched to?如何获取我切换到的新模式的调色板数据? Or maybe I am not getting the whole concept right.或者,也许我没有正确理解整个概念。 Can someone explain to me how to get the palette values for a specific mode?有人可以向我解释如何获取特定模式的调色板值吗?

With 256 colors, only an 8-bit color index is specified.对于 256 colors,仅指定了 8 位颜色索引。 the color to be displayed is then looked up in a color palette.然后在调色板中查找要显示的颜色。

But 118h is a 24-bit bit color mode and it's a little different there: No color palettes are used there, the color value is given directly as a 24-bit value (8 bits for the red component, 8 bits for the green component and 8 bits for the blue component).但是118h是一种 24 位颜色模式,它在那里有点不同:那里没有使用调色板,颜色值直接作为 24 位值给出(红色分量为 8 位,绿色分量为 8 位蓝色分量为 8 位)。 One could also say that the values that were previously in the color palette are now written directly into the screen buffer.也可以说,以前在调色板中的值现在直接写入屏幕缓冲区。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM