YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Drawing::Shaders 命名空间参考

着色器命名空间。 更多...

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)
 像素组合。 更多...
 

详细描述

着色器命名空间。

自从
build 442

函数说明

template<size_t _vSrcAlphaBits, typename _tPixel , typename _tSrcAlphaInt >
yconstfn _tPixel YSLib::Drawing::Shaders::Blend ( const _tPixel &  d,
const _tPixel &  s,
_tSrcAlphaInt  sa 
)

像素混合:使用指定的源 Alpha 。

注解
背景透明,输出 Alpha 饱和。
使用引用传递像素类型以便优化。
参见
BlendComponent
自从
build 442
待办事项:
支持浮点数。

在文件 YPixel.h573 行定义.

参考 BlendComponent().

函数调用图:

template<size_t _vSrcAlphaBits, typename _tSrcAlphaInt >
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 
)

在文件 YPixel.h584 行定义.

参考 platform_ex::Windows::s.

template<size_t _vSrcAlphaBits, typename _tDstInt , typename _tSrcInt , typename _tSrcAlphaInt >
yconstfn _tDstInt YSLib::Drawing::Shaders::BlendComponent ( _tDstInt  d,
_tSrcInt  s,
_tSrcAlphaInt  sa 
)

像素分量混合。

参见
GPixelCompositor
自从
build 442
待办事项:
支持浮点数。

在文件 YPixel.h479 行定义.

参考 YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, _vSrcAlphaBits >::CompositeComponentOver().

参考自 Blend().

函数调用图:

这是这个函数的调用关系图:

template<size_t _vAlphaBits>
u16 YSLib::Drawing::Shaders::BlendCore ( u32  d,
u32  s,
u8  a 
)

AXYZ1555 格式 PixelType 的 Alpha 混合。

模板参数
_vAlphaBits表示 Alpha 值的有效整数位数。
自从
build 442

设 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 位寄存器以减少总指令数。

在文件 YPixel.h549 行定义.

参考 yunseq.

template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel , typename _tSrcAlphaInt , typename _tAlphaInt >
yconstfn _tPixel YSLib::Drawing::Shaders::Composite ( const _tPixel &  d,
const _tPixel &  s,
_tSrcAlphaInt  sa,
_tAlphaInt  a 
)

像素组合:使用指定的源 Alpha 和结果 Alpha 。

注解
使用引用传递像素类型以便优化。
参见
CompositeComponent
自从
build 442
待办事项:
支持浮点数。

在文件 YPixel.h604 行定义.

参考 CompositeComponent().

参考自 YSLib::Drawing::Shaders::BlitAlphaPoint::operator()().

函数调用图:

这是这个函数的调用关系图:

template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel , typename _tAlphaInt >
yconstfn _tPixel YSLib::Drawing::Shaders::Composite ( const _tPixel &  d,
const _tPixel &  s,
_tAlphaInt  a 
)

像素组合:使用指定的结果 Alpha 。

在文件 YPixel.h620 行定义.

参考 platform_ex::Windows::s.

template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tPixel >
yconstfn _tPixel YSLib::Drawing::Shaders::Composite ( const _tPixel &  d,
const _tPixel &  s 
)

像素组合。

在文件 YPixel.h627 行定义.

参考 platform_ex::Windows::s.

template<size_t _vDstAlphaBits, size_t _vSrcAlphaBits, typename _tDstInt , typename _tSrcInt , typename _tSrcAlphaInt , typename _tAlphaInt >
yconstfn _tDstInt YSLib::Drawing::Shaders::CompositeComponent ( _tDstInt  d,
_tSrcInt  s,
_tSrcAlphaInt  sa,
_tAlphaInt  a 
)

像素分量组合。

参见
GPixelCompositor
自从
build 442
待办事项:
支持浮点数。

在文件 YPixel.h505 行定义.

参考 YSLib::Drawing::Shaders::GPixelCompositor< _vDstAlphaBits, _vSrcAlphaBits >::CompositeComponentOver().

参考自 Composite().

函数调用图:

这是这个函数的调用关系图: