载入中...
搜索中...
未找到
eve::graphics::AlphaMask类 参考

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()

eve::graphics::AlphaMask::AlphaMask ( Graphics *  graphics)
explicit

◆ ~AlphaMask()

eve::graphics::AlphaMask::~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.

参数
colorSource color texture.
maskMask texture; its red channel supplies coverage.
xDestination left edge.
yDestination top edge.
widthDestination width.
heightDestination height.
rRed tint.
gGreen tint.
bBlue tint.
aAlpha tint.

在文件 AlphaMask.cpp 第 72 行定义.

引用了 a, b, color, eve::graphics::Graphics::drawTexturedRectShaderDepth(), g, height, mask, r, width, x , 以及 y.

◆ getInverted()

bool eve::graphics::AlphaMask::getInverted ( ) const
inline

Return whether mask coverage is inverted.

在文件 AlphaMask.h 第 30 行定义.

◆ getSoftness()

float eve::graphics::AlphaMask::getSoftness ( ) const
inline

Return the current soft-edge width.

在文件 AlphaMask.h 第 26 行定义.

◆ getThreshold()

float eve::graphics::AlphaMask::getThreshold ( ) const
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 行定义.


该类的文档由以下文件生成: