YSTest
PreAlpha_b500_20140530
The YSLib Test Project
|
着色器命名空间。 更多...
类 | |
struct | BlitAlphaPoint |
像素计算:Alpha 混合。 更多... | |
struct | BlitTransparentPoint |
像素迭代器透明操作。 更多... | |
struct | GPixelCompositor |
像素组合器。 更多... | |
struct | GPixelCompositor< 0, 0 > |
struct | GPixelCompositor< 0, 1 > |
struct | GPixelCompositor< 0, _vSrcAlphaBits > |
struct | GPixelCompositor< 1, 0 > |
struct | GPixelCompositor< 1, 1 > |
struct | GPixelCompositor< 1, _vSrcAlphaBits > |
struct | GPixelCompositor< _vDstAlphaBits, 0 > |
struct | GPixelCompositor< _vDstAlphaBits, 1 > |
函数 | |
template<size_t _vSrcAlphaBits, typename _tDstInt , typename _tSrcInt , typename _tSrcAlphaInt > | |
yconstfn _tDstInt | BlendComponent (_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa) |
像素分量混合。 更多... | |
template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tDstInt , typename _tSrcInt , typename _tSrcAlphaInt , typename _tAlphaInt > | |
yconstfn _tDstInt | CompositeComponent (_tDstInt d, _tSrcInt s, _tSrcAlphaInt sa, _tAlphaInt a) |
像素分量组合。 更多... | |
template<size_t _vAlphaBits> | |
u16 | BlendCore (u32 d, u32 s, u8 a) |
AXYZ1555 格式 PixelType 的 Alpha 混合。 更多... | |
template<size_t _vSrcAlphaBits, typename _tPixel , typename _tSrcAlphaInt > | |
yconstfn _tPixel | Blend (const _tPixel &d, const _tPixel &s, _tSrcAlphaInt sa) |
像素混合:使用指定的源 Alpha 。 更多... | |
template<size_t _vSrcAlphaBits, typename _tSrcAlphaInt > | |
RGBA< 5, 5, 5, 1 > | Blend (const RGBA< 5, 5, 5, 1 > &d, const RGBA< 5, 5, 5, 1 > &s, _tSrcAlphaInt sa) |
template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel , typename _tSrcAlphaInt , typename _tAlphaInt > | |
yconstfn _tPixel | Composite (const _tPixel &d, const _tPixel &s, _tSrcAlphaInt sa, _tAlphaInt a) |
像素组合:使用指定的源 Alpha 和结果 Alpha 。 更多... | |
template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel , typename _tAlphaInt > | |
yconstfn _tPixel | Composite (const _tPixel &d, const _tPixel &s, _tAlphaInt a) |
像素组合:使用指定的结果 Alpha 。 更多... | |
template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel > | |
yconstfn _tPixel | Composite (const _tPixel &d, const _tPixel &s) |
像素组合。 更多... | |
着色器命名空间。
yconstfn _tPixel YSLib::Drawing::Shaders::Blend | ( | const _tPixel & | d, |
const _tPixel & | s, | ||
_tSrcAlphaInt | sa | ||
) |
像素混合:使用指定的源 Alpha 。
参考 BlendComponent().
RGBA<5, 5, 5, 1> YSLib::Drawing::Shaders::Blend | ( | const RGBA< 5, 5, 5, 1 > & | d, |
const RGBA< 5, 5, 5, 1 > & | s, | ||
_tSrcAlphaInt | sa | ||
) |
yconstfn _tDstInt YSLib::Drawing::Shaders::BlendComponent | ( | _tDstInt | d, |
_tSrcInt | s, | ||
_tSrcAlphaInt | sa | ||
) |
u16 YSLib::Drawing::Shaders::BlendCore | ( | u32 | d, |
u32 | s, | ||
u8 | a | ||
) |
AXYZ1555 格式 PixelType 的 Alpha 混合。
_vAlphaBits | 表示 Alpha 值的有效整数位数。 |
设 MaxAlpha := (1 << _vAlphaBits) - 1 , 使用下列公式进行像素的 Alpha 混合(其中 alpha = a / MaxAlpha): 输出分量: component := (1 - alpha) * d + alpha * s = ((MaxAlpha - a) * d + a * s) >> _vAlphaBits = d + ((a * (s - d)) >> _vAlphaBits) 。 背景透明,输出 Alpha 饱和。 像素格式: 16 位 AXYZ1555 。 以 ARGB1555 为例,算法实现示意: arrrrrgggggbbbbb 0000000000arrrrr gggggbbbbb000000 0000000000011111 0000000000011111 00000000000rrrrr 00000000000bbbbb : dbr 0000000000000000 000000ggggg00000 : dg 分解分量至 32 位寄存器以减少总指令数。
参考 yunseq.
yconstfn _tPixel YSLib::Drawing::Shaders::Composite | ( | const _tPixel & | d, |
const _tPixel & | s, | ||
_tSrcAlphaInt | sa, | ||
_tAlphaInt | a | ||
) |
像素组合:使用指定的源 Alpha 和结果 Alpha 。
参考自 YSLib::Drawing::Shaders::BlitAlphaPoint::operator()().
yconstfn _tPixel YSLib::Drawing::Shaders::Composite | ( | const _tPixel & | d, |
const _tPixel & | s, | ||
_tAlphaInt | a | ||
) |
yconstfn _tPixel YSLib::Drawing::Shaders::Composite | ( | const _tPixel & | d, |
const _tPixel & | s | ||
) |
yconstfn _tDstInt YSLib::Drawing::Shaders::CompositeComponent | ( | _tDstInt | d, |
_tSrcInt | s, | ||
_tSrcAlphaInt | sa, | ||
_tAlphaInt | a | ||
) |