Reusable two-texture alpha mask for immediate 2D composition. 更多...
#include <AlphaMask.h>
Public 成员函数 | |
| AlphaMask (Graphics *graphics) | |
| Create a mask renderer backed by the supplied graphics device. | |
| ~AlphaMask () | |
| Alpha mask. | |
| void | setThreshold (float threshold) |
| Set the mask cutoff in normalized alpha space. | |
| float | getThreshold () const |
| Return the current normalized cutoff. | |
| void | setSoftness (float softness) |
| Set the normalized soft-edge half width. | |
| float | getSoftness () const |
| Return the current soft-edge width. | |
| void | setInverted (bool inverted) |
| Invert mask coverage. | |
| bool | getInverted () const |
| Return whether mask coverage is inverted. | |
| void | draw (Texture *color, Texture *mask, float x, float y, float width, float height, float r=1.f, float g=1.f, float b=1.f, float a=1.f) |
| Draw a color texture multiplied by a same-UV alpha mask. | |
详细描述
Reusable two-texture alpha mask for immediate 2D composition.
在文件 AlphaMask.h 第 12 行定义.
构造及析构函数说明
◆ AlphaMask()
|
explicit |
Create a mask renderer backed by the supplied graphics device.
在文件 AlphaMask.cpp 第 16 行定义.
引用了 eve::graphics::Shader::declareFloat(), eve::graphics::Graphics::getBackendName(), eve::graphics::Graphics::newShaderFromSpv() , 以及 eve::graphics::Graphics::newShaderFromWgsl().
◆ ~AlphaMask()
|
default |
Alpha mask.
成员函数说明
◆ draw()
| void eve::graphics::AlphaMask::draw | ( | Texture * | color, |
| Texture * | mask, | ||
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| float | r = 1.f, |
||
| float | g = 1.f, |
||
| float | b = 1.f, |
||
| float | a = 1.f |
||
| ) |
Draw a color texture multiplied by a same-UV alpha mask.
- 参数
-
color Source color texture. mask Mask texture; its red channel supplies coverage. x Destination left edge. y Destination top edge. width Destination width. height Destination height. r Red tint. g Green tint. b Blue tint. a Alpha tint.
在文件 AlphaMask.cpp 第 72 行定义.
引用了 a, b, color, eve::graphics::Graphics::drawTexturedRectShaderDepth(), g, height, mask, r, width, x , 以及 y.
◆ getInverted()
|
inline |
Return whether mask coverage is inverted.
在文件 AlphaMask.h 第 30 行定义.
◆ getSoftness()
|
inline |
Return the current soft-edge width.
在文件 AlphaMask.h 第 26 行定义.
◆ getThreshold()
|
inline |
Return the current normalized cutoff.
在文件 AlphaMask.h 第 22 行定义.
◆ setInverted()
| void eve::graphics::AlphaMask::setInverted | ( | bool | inverted | ) |
Invert mask coverage.
在文件 AlphaMask.cpp 第 67 行定义.
◆ setSoftness()
| void eve::graphics::AlphaMask::setSoftness | ( | float | softness | ) |
Set the normalized soft-edge half width.
在文件 AlphaMask.cpp 第 62 行定义.
◆ setThreshold()
| void eve::graphics::AlphaMask::setThreshold | ( | float | threshold | ) |
Set the mask cutoff in normalized alpha space.
在文件 AlphaMask.cpp 第 57 行定义.
该类的文档由以下文件生成:
- src/modules/graphics/AlphaMask.h
- src/modules/graphics/AlphaMask.cpp