论文标题

没有部门操作的α融合

Alpha Blending with No Division Operations

论文作者

Van Aken, Jerry R.

论文摘要

高度准确的α混合物可以完全通过整数操作进行,而无需划分。为了减少整数乘积的数量,可以在同一32位或64位寄存器中并行混合多种颜色组件。本教程解释了当Alpha与32位RGBA像素混合时,如何避免分裂操作。 RGBA像素包含四个8位组件(红色,绿色,蓝色和alpha),其值范围从0到255。Alpha混合需要将颜色成分乘以Alpha值,之后(出于最高精度)这些产品中的每一种都被255除以255,然后圆形为最近的Integer。本教程提出了一个近似的alpha搅拌公式,该公式用整数移动代替了分区操作并添加 - 还可以减少乘法数量。当使用双精度浮点数分裂操作将相同的混合计算高精度进行高精度时,结果可以完全匹配该近似值所产生的结果。包括C ++代码示例。

Highly accurate alpha blending can be performed entirely with integer operations, and no divisions. To reduce the number of integer multiplications, multiple color components can be blended in parallel in the same 32-bit or 64-bit register. This tutorial explains how to avoid division operations when alpha blending with 32-bit RGBA pixels. An RGBA pixel contains four 8-bit components (red, green, blue, and alpha) whose values range from 0 to 255. Alpha blending requires multiplication of the color components by an alpha value, after which (for greatest accuracy) each of these products is divided by 255 and then rounded to the nearest integer. This tutorial presents an approximate alpha-blending formula that replaces the division operation with an integer shift and add -- and also enables the number of multiplications to be reduced. When the same blending calculation is carried out to high precision using double-precision floating-point division operations, the results are found to exactly match those produced by this approximation. C++ code examples are included.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源