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

文本区域。 更多...

#include <TextRenderer.h>

类 YSLib::Drawing::TextRegion 继承关系图:
YSLib::Drawing::TextRegion 的协作图:

Public 成员函数

 TextRegion ()
 无参数构造。
 
template<typename... _tParams>
 TextRegion (_tParams &&...args)
 构造:使用指定参数确定文本状态。
 
 TextRegion (const TextRegion &)=default
 复制构造:默认实现。
 
 TextRegion (TextRegion &&)=default
 转移构造:默认实现。
 
TextRegionoperator= (const TextState &ts)
 从文本状态中恢复状态。
 
TextRegionoperator= (const TextRegion &)=default
 复制赋值:默认实现。
 
TextRegionoperator= (TextRegion &&)=default
 转移赋值:默认实现。
 
void operator() (ucs4_t)
 渲染单个字符。
 
const TextStateGetTextState () const ynothrow
 
TextStateGetTextState () ynothrow
 
const GraphicsGetContext () const ynothrow
 
void ClearLine (u16 l, SDst n)
 清除缓冲区第 l 行起始的 n 行像素。
 
void ClearTextLine (u16)
 清除缓冲区中的指定行号的文本行。
 
void Scroll (ptrdiff_t n)
 缓冲区特效:整体移动 n 像素。
 
void Scroll (ptrdiff_t n, SDst h)
 缓冲区特效:整体移动 n 像素。
 
- Public 成员函数 继承自 YSLib::Drawing::GTextRendererBase< TextRegion >
u16 GetTextLineN () const
 取按当前行高和行距所能显示的最大行数。
 
u16 GetTextLineNEx () const
 取按当前行高和行距(行间距数小于行数 1 )所能显示的最大行数。
 
- Public 成员函数 继承自 YSLib::Drawing::TextState
 TextState (const Drawing::Font &={})
 构造:使用指定字体。
 
 TextState (FontCache &)
 构造:使用指定字体缓存。
 
TextStateoperator= (const PenStyle &ps)
 赋值:笔样式。
 
TextStateoperator= (const Padding &ms)
 赋值:边距。
 
void PutNewline ()
 打印换行。
 
void ResetPen ()
 复位笔:按字体大小设置笔位置为默认位置。
 
void ResetPen (const Point &, const Padding &={})
 按指定显示区域左上角位置和附加边距重新设置笔位置。
 
- Public 成员函数 继承自 YSLib::Drawing::BitmapBufferEx
 BitmapBufferEx ()
 无参数构造。
 
 BitmapBufferEx (ConstBitmapPtr, SDst, SDst)
 构造:使用指定位图指针和大小。
 
 BitmapBufferEx (const BitmapBufferEx &)
 
 BitmapBufferEx (BitmapBufferEx &&) ynothrow
 转移构造:转移资源。
 
 ~BitmapBufferEx () override
 析构:释放资源。
 
BitmapBufferExoperator= (const BitmapBufferEx &buf)
 
BitmapBufferExoperator= (BitmapBufferEx &&buf) ynothrow
 
u8GetBufferAlphaPtr () const ynothrow
 取 Alpha 缓冲区的指针。
 
size_t GetSizeOfBufferAlpha () const ynothrow
 取 Alpha 缓冲区占用空间。
 
void SetSize (SDst, SDst) override
 重新设置缓冲区大小。
 
void ClearImage () const override
 清除缓冲区。
 
BitmapBufferExClone () const override
 
void Swap (BitmapBufferEx &buf) ynothrow
 
- Public 成员函数 继承自 YSLib::Drawing::BitmapBuffer
 BitmapBuffer ()=default
 无参数构造:默认实现。
 
 BitmapBuffer (ConstBitmapPtr, SDst, SDst)
 构造:使用指定位图指针和大小。
 
 BitmapBuffer (const BitmapBuffer &)
 
 BitmapBuffer (BitmapBuffer &&) ynothrow
 转移构造:转移资源。
 
virtual ~BitmapBuffer ()
 析构:释放资源。
 
BitmapBufferoperator= (const BitmapBuffer &buf)
 
BitmapBufferoperator= (BitmapBuffer &&buf) ynothrow
 
void SetContent (ConstBitmapPtr, SDst, SDst)
 设置内容。
 
void SetSizeSwap ()
 交换宽和高;同时清除缓冲区。
 
void Swap (BitmapBuffer &buf) ynothrow
 
const GraphicsGetContext () const ynothrow
 

Protected 成员函数

void InitializeFont ()
 初始化字体。
 

额外继承的成员函数

- Public 属性 继承自 YSLib::Drawing::TextState
Padding Margin
 边距:文本区域到显示区域的距离。
 
Point Pen
 笔坐标。
 
u8 LineGap
 行距。
 
- Protected 属性 继承自 YSLib::Drawing::PenStyle
Drawing::Font Font
 字体。
 
Drawing::Color Color
 笔颜色。
 
- Protected 属性 继承自 YSLib::Drawing::BitmapBufferEx
u8pBufferAlpha
 Alpha 缓冲区指针。
 
- 静态 Protected 属性 继承自 YSLib::Drawing::Graphics
static const Graphics Invalid
 无效图形接口上下文。
 

详细描述

文本区域。

自带缓冲区的文本渲染器,通过 Alpha 贴图刷新至位图缓冲区显示光栅化文本。

自从
早于 build 132

在文件 TextRenderer.h391 行定义.

构造及析构函数说明

TextRegion::TextRegion ( )

无参数构造。

在文件 TextRenderer.cpp108 行定义.

参考 InitializeFont().

函数调用图:

template<typename... _tParams>
YSLib::Drawing::TextRegion::TextRegion ( _tParams &&...  args)
inlineexplicit

构造:使用指定参数确定文本状态。

自从
build 368

在文件 TextRenderer.h405 行定义.

YSLib::Drawing::TextRegion::TextRegion ( const TextRegion )
default

复制构造:默认实现。

自从
build 296
YSLib::Drawing::TextRegion::TextRegion ( TextRegion &&  )
default

转移构造:默认实现。

自从
build 296

成员函数说明

void TextRegion::ClearLine ( u16  l,
SDst  n 
)

清除缓冲区第 l 行起始的 n 行像素。

注解
n 为 0 时清除之后的所有行。

在文件 TextRenderer.cpp130 行定义.

参考 YSLib::Drawing::ClearPixel(),GetContext(),YSLib::Drawing::BitmapBufferEx::pBufferAlpha,YB_LIKELY,YB_UNLIKELY , 以及 yunseq().

参考自 ClearTextLine().

函数调用图:

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

void TextRegion::ClearTextLine ( u16  l)

清除缓冲区中的指定行号的文本行。

注解
参数为 0 表示首行。

在文件 TextRenderer.cpp149 行定义.

参考 ClearLine(),YSLib::Drawing::GetTextLineHeightExOf(),GetTextState() , 以及 h.

函数调用图:

const Graphics& YSLib::Drawing::TextRegion::GetContext ( ) const
inline

在文件 TextRenderer.h452 行定义.

参考自 ClearLine() , 以及 operator()().

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

const TextState& YSLib::Drawing::TextRegion::GetTextState ( ) const
inline

在文件 TextRenderer.h449 行定义.

参考自 ClearTextLine() , 以及 operator()().

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

TextState& YSLib::Drawing::TextRegion::GetTextState ( )
inline

在文件 TextRenderer.h450 行定义.

void TextRegion::InitializeFont ( )
protected

初始化字体。

在文件 TextRenderer.cpp123 行定义.

参考 YSLib::Drawing::Font::DefaultSize,YSLib::Drawing::TextState::ResetPen() , 以及 YSLib::Drawing::Font::SetSize().

参考自 TextRegion().

函数调用图:

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

void TextRegion::operator() ( ucs4_t  c)
TextRegion& YSLib::Drawing::TextRegion::operator= ( const TextState ts)
inline

从文本状态中恢复状态。

在文件 TextRenderer.h426 行定义.

TextRegion& YSLib::Drawing::TextRegion::operator= ( const TextRegion )
default

复制赋值:默认实现。

自从
build 296
TextRegion& YSLib::Drawing::TextRegion::operator= ( TextRegion &&  )
default

转移赋值:默认实现。

自从
build 296
void TextRegion::Scroll ( ptrdiff_t  n)

缓冲区特效:整体移动 n 像素。

注解
除上下边界区域。
n > 0 时下移, n < 0 时上移。

在文件 TextRenderer.cpp158 行定义.

参考 YSLib::Drawing::Padding::Bottom,YSLib::Drawing::Graphics::GetHeight(),YSLib::Drawing::TextState::Margin , 以及 YB_LIKELY.

函数调用图:

void TextRegion::Scroll ( ptrdiff_t  n,
SDst  h 
)

缓冲区特效:整体移动 n 像素。

注解
从缓冲区顶端起高 h 的区域内,除上下边界区域。
n > 0 时下移, n < 0 时上移。

在文件 TextRenderer.cpp164 行定义.

参考 YSLib::Drawing::Padding::Bottom,YSLib::Drawing::Graphics::GetHeight(),YSLib::Drawing::Graphics::GetWidth(),YSLib::Drawing::TextState::Margin,YSLib::Drawing::Graphics::pBuffer,YSLib::Drawing::BitmapBufferEx::pBufferAlpha,ystdex::pod_move_n(),YSLib::Drawing::Padding::Top,YB_LIKELY , 以及 yunseq().

函数调用图:


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