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

图形处理。 更多...

class  FontFamily
 字型家族 (Typeface Family) 标识。 更多...
 
class  Typeface
 字型标识。 更多...
 
class  CharBitmap
 字符位图。 更多...
 
class  FontCache
 字体缓存。 更多...
 
class  Font
 字体:字模,包含字型、样式和大小。 更多...
 
class  GBinaryGroup
 屏幕二元组。 更多...
 
class  Size
 屏幕区域大小。 更多...
 
class  Rect
 屏幕标准矩形:表示屏幕矩形区域。 更多...
 
class  Graphics
 二维图形接口上下文。 更多...
 
struct  PaintContext
 
class  PenStyle
 笔样式:字体和笔颜色。 更多...
 
class  TextState
 文本状态。 更多...
 
class  EmptyTextRenderer
 空文本渲染器。 更多...
 
class  GTextRendererBase
 文本渲染器静态多态基类模板。 更多...
 
class  TextRenderer
 文本渲染器。 更多...
 
class  TextRegion
 文本区域。 更多...
 
struct  PixelFiller
 像素填充器。 更多...
 
struct  SequenceTransformer
 序列转换器。 更多...
 
struct  VerticalLineTransfomer
 竖直线转换器。 更多...
 
struct  RectTransformer
 标准矩形转换器。 更多...
 
struct  BlitLoop
 循环:按指定扫描顺序复制一块矩形区域的像素。 更多...
 
struct  BlitTransparentLoop
 循环:按指定扫描顺序复制一块矩形区域的像素。 更多...
 
struct  BlitBlendLoop
 循环:按指定扫描顺序复制一块矩形区域的像素。 更多...
 
struct  Padding
 空白样式。 更多...
 
class  BitmapBuffer
 标准矩形位图缓冲区。 更多...
 
class  BitmapBufferEx
 扩展的标准矩形位图缓冲区。 更多...
 
class  Image
 图像资源。 更多...
 
struct  hsl_t
 HSL 颜色。 更多...
 

类型定义

typedef u8 FontSize
 字体大小。
 
typedef std::string FontPath
 字体文件路径。
 
typedef std::string FamilyName
 字型家族名称。
 
typedef std::string StyleName
 字型样式名称。
 
typedef GBinaryGroup< SPos > Point
 屏幕二维点(直角坐标表示)。
 
typedef GBinaryGroup< SPos > Vec
 屏幕二维向量(直角坐标表示)。
 
typedef ystdex::pair_iterator
< ConstBitmapPtr, const u8 * > 
IteratorPair
 Alpha 光栅化源迭代器对。
 
typedef ystdex::pair_iterator
< ystdex::pseudo_iterator
< const PixelType >, const u8 * > 
MonoIteratorPair
 Alpha 单色光栅化源迭代器对。
 
typedef ystdex::fixed_point
< u16, 9 > 
Hue
 色调。
 

枚举

enum  FontStyle : u8
 字体样式。 更多...
 
enum  Rotation { RDeg0 = 0, RDeg90 = 1, RDeg180 = 2, RDeg270 = 3 }
 逆时针旋转角度指示输出指向。 更多...
 
enum  Orientation { Horizontal = 0, Vertical = 1 }
 二元方向。 更多...
 

函数

yconstfn FontStyle operator& (FontStyle _x, FontStyle _y)
 
yconstfn FontStyle operator| (FontStyle _x, FontStyle _y)
 
yconstfn FontStyle operator^ (FontStyle _x, FontStyle _y)
 
yconstfn FontStyle operator~ (FontStyle _x)
 
FontStyleoperator&= (FontStyle &_x, FontStyle _y)
 
FontStyleoperator|= (FontStyle &_x, FontStyle _y)
 
FontStyleoperator^= (FontStyle &_x, FontStyle _y)
 
yconstfn const char * FetchName (FontStyle style) ynothrow
 取样式名称。
 
YF_API const TypefaceFetchDefaultTypeface () ythrow(LoggedEvent)
 取默认字型引用。
 
template<typename _type >
yconstfn bool operator== (const GBinaryGroup< _type > &a, const GBinaryGroup< _type > &b) ynothrow
 比较:屏幕二元组相等关系。
 
template<typename _type >
yconstfn bool operator!= (const GBinaryGroup< _type > &a, const GBinaryGroup< _type > &b) ynothrow
 比较:屏幕二元组不等关系。
 
template<typename _type >
yconstfn GBinaryGroup< _type > operator+ (const GBinaryGroup< _type > &a, const GBinaryGroup< _type > &b) ynothrow
 加法:屏幕二元组。
 
template<typename _type >
yconstfn GBinaryGroup< _type > operator- (const GBinaryGroup< _type > &a, const GBinaryGroup< _type > &b) ynothrow
 减法:屏幕二元组。
 
template<typename _type , typename _tScalar >
yconstfn GBinaryGroup< _type > operator* (const GBinaryGroup< _type > &val, _tScalar l) ynothrow
 数乘:屏幕二元组。
 
yconstfn bool operator== (const Size &a, const Size &b) ynothrow
 比较:屏幕区域大小相等关系。
 
yconstfn bool operator!= (const Size &a, const Size &b) ynothrow
 比较:屏幕区域大小不等关系。
 
template<typename _type >
yconstfn GBinaryGroup< _type > operator+ (GBinaryGroup< _type > val, const Size &s) ynothrow
 加法:使用屏幕二元组和屏幕区域大小分量对应相加构造屏幕二元组。
 
template<class _tBinary >
yconstfn _tBinary Transpose (_tBinary &obj) ynothrow
 二元对象转置。
 
yconstfn auto GetAreaOf (const Size &s) ynothrow-> decltype(s.Width *s.Height)
 取面积。
 
yconstfn bool operator== (const Rect &x, const Rect &y) ynothrow
 比较:屏幕标准矩形相等关系。
 
yconstfn bool operator!= (const Rect &x, const Rect &y) ynothrow
 比较:屏幕标准矩形不等关系。
 
yconstfn Rect operator+ (const Rect &r, const Vec &v) ynothrow
 加法:使用标准矩形 r 和偏移向量 v 构造屏幕标准矩形。
 
yconstfn Rect operator- (const Rect &r, const Vec &v) ynothrow
 减法:使用标准矩形 r 和偏移向量的加法逆元 v 构造屏幕标准矩形。
 
Rect operator& (const Rect &, const Rect &) ynothrow
 求两个屏幕标准矩形的交。
 
Rect operator| (const Rect &, const Rect &) ynothrow
 求两个屏幕标准矩形的并。
 
template<template< bool > class _gBlitLoop, typename _tOut , typename _tIn >
void BlitChar (_tOut dst, _tIn src, const Size &ss, const PaintContext &pc)
 字符块传输。
 
YF_API void RenderChar (PaintContext &&pc, Color, CharBitmap::BufferType, const Size &)
 渲染单个字符。
 
YF_API void RenderCharAlpha (PaintContext &&pc, Color, CharBitmap::BufferType, const Size &, u8 *)
 渲染带 Alpha 缓冲的单个字符。
 
template<class _tRenderer >
SDst GetEndOfLinePositionOf (const _tRenderer &r)
 取文本渲染器的行末位置(横坐标)。
 
template<class _tRenderer >
void PrintChar (_tRenderer &r, ucs4_t c)
 打印单个可打印字符。
 
YF_API u8 PutCharBase (TextState &, SDst, ucs4_t)
 使用指定的文本状态和行末位置(横坐标)打印并判断是否需要具体渲染单个字符。
 
template<class _tRenderer >
u8 PutChar (_tRenderer &r, ucs4_t c)
 打印单个字符。
 
yconstexpr Padding DefaultMargin (2, 2, 2, 2)
 默认边距。
 
SDst GetTextLineHeightOf (const TextState &ts)
 取当前指定文本状态的字体设置对应的行高。
 
SDst GetTextLineHeightExOf (const TextState &ts)
 取当前指定文本状态的字体设置对应的行高与行距之和。
 
u16 GetCurrentTextLineNOf (const TextState &ts)
 取笔所在的当前行数。
 
SPos GetTextLineBaseOf (const TextState &ts)
 取第一行的基线位置(纵坐标)。
 
void SetPenOf (TextState &ts, SPos x, SPos y)
 设置笔位置。
 
YF_API void SetCurrentTextLineNOf (TextState &, u16)
 设置笔的行位置。
 
void AdjustEndOfLine (TextState &ts, const Rect &r, SDst w)
 按指定显示区域和文本区域的宽重新设置右边距。
 
void CarriageReturn (TextState &ts)
 回车。
 
YF_API void MovePen (TextState &, ucs4_t)
 按字符跨距移动笔。
 
YF_API SDst FetchResizedBottomMargin (const TextState &, SDst)
 取指定文本状态和文本区域高调整的底边距。
 
YF_API u16 FetchResizedLineN (const TextState &ts, SDst)
 取指定文本状态和文本区域高所能显示的最大文本行数。
 
YF_API SPos FetchLastLineBasePosition (const TextState &, SDst)
 取指定文本状态在指定高的区域中表示的最底行的基线位置(纵坐标)。
 
SDst FetchResizedBottomMargin (const TextRegion &tr)
 取按字体高度和行距调整文本区域的底边距。
 
SDst AdjustBottomMarginOf (TextRegion &tr)
 按字体高度和行距调整文本区域的底边距。
 
YF_API SDst FetchCharWidth (const Font &, ucs4_t)
 取指定的字符使用指定字体的显示宽度。
 
template<typename _tIn >
SDst FetchStringWidth (const Font &fnt, _tIn s)
 取迭代器指定的字符串在字体指定、无边界限制时的显示宽度。
 
template<typename _tIn >
SDst FetchStringWidth (const Font &fnt, _tIn s, _tIn g, ucs4_t c={})
 取迭代器指定的单行字符串在字体指定、无边界限制时的显示宽度。
 
SDst FetchStringWidth (const Font &fnt, const String &str)
 取单行字符串在字体指定、无边界限制时的显示宽度。
 
template<typename _tIn >
SDst FetchStringWidth (TextState &ts, SDst h, _tIn s)
 取迭代器指定的单行字符串在指定文本状态和高度限制时的显示宽度。
 
template<typename _tIn >
SDst FetchStringWidth (TextState &ts, SDst h, _tIn s, _tIn g, ucs4_t c={})
 取迭代器指定的单行字符串在指定文本状态和高度限制时的显示宽度。
 
SDst FetchStringWidth (TextState &ts, SDst h, const String &str)
 取单行字符串在指定文本状态和高度限制时的显示宽度。
 
template<typename _tIn >
SDst FetchMaxTextWidth (const Font &font, _tIn first, _tIn last)
 取指定字体显示的迭代器范围中的文本的最大宽度。
 
template<typename _tIn , class _tRenderer >
_tIn PrintLine (_tRenderer &r, _tIn s)
 打印迭代器指定的字符串,直至行尾或字符迭代终止。
 
template<typename _tIn , class _tRenderer >
_tIn PrintLine (_tRenderer &r, _tIn s, _tIn g, ucs4_t c={})
 打印迭代器指定的字符串,直至行尾或字符迭代终止。
 
template<class _tRenderer >
String::size_type PrintLine (_tRenderer &r, const String &str)
 打印字符串,直至行尾或字符串结束。
 
template<typename _tIn , class _tRenderer >
_tIn PutLine (_tRenderer &r, _tIn s)
 打印迭代器指定的字符串,直至行尾或字符迭代终止。
 
template<typename _tIn , class _tRenderer >
_tIn PutLine (_tRenderer &r, _tIn s, _tIn g, ucs4_t c={})
 打印迭代器指定的字符串,直至行尾或字符迭代终止。
 
template<class _tRenderer >
String::size_type PutLine (_tRenderer &r, const String &str)
 打印字符串,直至行尾或字符串结束。
 
template<typename _tIn , class _tRenderer >
_tIn PrintString (_tRenderer &r, _tIn s)
 打印迭代器指定的字符串,直至区域末尾或字符迭代终止。
 
template<typename _tIn , class _tRenderer >
_tIn PrintString (_tRenderer &r, _tIn s, _tIn g, ucs4_t c={})
 打印迭代器指定的字符串,直至区域末尾或字符迭代终止。
 
template<class _tRenderer >
String::size_type PrintString (_tRenderer &r, const String &str)
 打印字符串,直至区域末尾或字符串结束。
 
template<typename _tIn , class _tRenderer >
_tIn PutString (_tRenderer &r, _tIn s)
 打印迭代器指定的字符串,直至区域末尾或字符迭代终止。
 
template<typename _tIn , class _tRenderer >
_tIn PutString (_tRenderer &r, _tIn s, _tIn g, ucs4_t c={})
 打印迭代器指定的字符串,直至区域末尾或字符迭代终止。
 
template<class _tRenderer >
String::size_type PutString (_tRenderer &r, const String &str)
 打印字符串,直至区域末尾或字符串结束。
 
YF_API void DrawClippedText (const Graphics &g, const Rect &mask, TextState &ts, const String &str, bool line_wrap)
 绘制剪切区域的文本。
 
YF_API void DrawClippedText (const Graphics &g, const Rect &mask, const Rect &bounds, const String &str, const Padding &m, Color, bool line_wrap, const Font &fnt={})
 绘制剪切区域的文本。
 
YF_API void DrawText (const Graphics &g, TextState &ts, const String &str, bool line_wrap)
 绘制文本。
 
YF_API void DrawText (const Graphics &g, const Rect &bounds, const String &str, const Padding &m, Color, bool line_wrap, const Font &fnt={})
 绘制文本。
 
YF_API void DrawText (TextRegion &r, const Graphics &g, const Point &pt, const Size &s, const String &str, bool line_wrap)
 绘制文本。
 
YF_API bool BlitBounds (const Point &dp, const Point &sp, const Size &ds, const Size &ss, const Size &cs, int &min_x, int &min_y, int &delta_x, int &delta_y)
 贴图边界计算器。
 
template<bool _bDec, typename _fCallable , typename _tScalar , typename _tDiff , typename _tOut , typename _tIn >
void BlitScan (_fCallable &&f, _tScalar d_width, _tScalar s_width, _tDiff delta_x, _tDiff delta_y, _tOut dst, _tIn src)
 贴图扫描函数模板。
 
template<template< bool > class _gBlitLoop, bool _bSwapLR, bool _bSwapUD, typename _tOut , typename _tIn >
void Blit (_tOut dst, const Size &ds, _tIn src, const Size &ss, const Point &dp, const Point &sp, const Size &sc)
 贴图函数模板。
 
template<typename _tPixel >
_tPixel * ClearPixel (_tPixel *dst, size_t n) ynothrow
 清除指定位置的 n 个连续像素。
 
template<typename _tPixel >
void FillPixel (_tPixel *dst, size_t n, _tPixel c)
 使用 n 个指定像素连续填充指定位置。
 
template<typename _tPixel >
void FillVerticalLine (_tPixel *dst, size_t n, SDst dw, _tPixel c)
 使用 n 个指定像素竖直填充指定位置。
 
template<typename _tPixel >
void FillRect (_tPixel *dst, const Size &ds, const Point &sp, const Size &ss, _tPixel c)
 使用指定像素填充指定的标准矩形区域。
 
template<typename _tPixel >
void FillRect (_tPixel *dst, const Size &ds, const Rect &rSrc, _tPixel c)
 使用指定像素填充指定的标准矩形区域。
 
template<typename _tPixel >
void FillRect (_tPixel *dst, SDst dw, SDst dh, SPos sx, SPos sy, SDst sw, SDst sh, _tPixel c)
 使用指定像素填充指定的标准矩形区域。
 
yconstexpr u8 BLT_ALPHA_BITS (8)
 
yconstexpr u32 BLT_MAX_ALPHA ((1<< BLT_ALPHA_BITS)-1)
 
yconstexpr u32 BLT_ROUND (1<< (BLT_ALPHA_BITS-1))
 
yconstexpr u8 BLT_THRESHOLD (8)
 
yconstexpr u8 BLT_THRESHOLD2 (128)
 
yconstexpr u32 BLT_ROUND_BR (BLT_ROUND|BLT_ROUND<< 16)
 
u8 component_blend (u8 d, u8 s, u8 a)
 
PixelType blitAlphaBlend (PixelType d, PixelType s, u8 a)
 
template<typename _tOut , typename _tIn >
void biltAlphaPoint (_tOut dst_iter, _tIn src_iter)
 
template<>
void biltAlphaPoint (PixelType *dst_iter, IteratorPair src_iter)
 
template<class _fTransformPixel >
bool TransformRect (const Graphics &g, const Point &pt, const Size &s, _fTransformPixel tp)
 以像素为单位变换标准矩形。
 
template<class _fTransformPixel >
bool TransformRect (const Graphics &g, const Rect &r, _fTransformPixel tp)
 以像素为单位变换标准矩形。
 
YF_API void CopyBuffer (const Graphics &, const Graphics &)
 以第一个参数作为目标,复制第二个参数的缓冲区内容。
 
YF_API void ClearImage (const Graphics &)
 清除图形接口上下文缓冲区。
 
YF_API void Fill (const Graphics &, Color)
 使用指定颜色填充图形接口上下文缓冲区。
 
void PutPixel (BitmapPtr dst, SDst w, SPos x, SPos y, Color c)
 绘制像素:(x, y) 。
 
void PutPixel (const Graphics &g, SPos x, SPos y, Color c)
 绘制像素:(x, y) 。
 
bool PlotPixel (BitmapPtr dst, const Size &s, SPos x, SPos y, Color c)
 绘制像素:(x, y) 。
 
bool DrawPoint (const Graphics &g, SPos x, SPos y, Color c)
 绘制点:(x, y) 。
 
bool DrawPoint (const Graphics &g, const Point &pt, Color c)
 绘制点:pt 。
 
YF_API bool DrawHLineSeg (const Graphics &g, SPos y, SPos x1, SPos x2, Color c)
 绘制水平线段:指定端点水平坐标 x1 、 x2 - 1 ,竖直坐标 y 。
 
YF_API bool DrawVLineSeg (const Graphics &g, SPos x, SPos y1, SPos y2, Color c)
 绘制竖直线段:指定竖直水平坐标 x ,竖直坐标 y1 - 1 、 y2 。
 
YF_API bool DrawLineSeg (const Graphics &g, SPos x1, SPos y1, SPos x2, SPos y2, Color c)
 绘制一般线段:端点 p1(x1, y1) 和 p2(x2, y2) 。
 
bool DrawLineSeg (const Graphics &g, const Point &p1, const Point &p2, Color c)
 绘制一般线段:端点 p1, p2 。
 
YF_API bool DrawRect (const Graphics &g, const Point &pt, const Size &s, Color c)
 绘制空心标准矩形。
 
bool DrawRect (const Graphics &g, const Rect &r, Color c)
 绘制空心标准矩形。
 
YF_API bool FillRect (const Graphics &g, const Point &pt, const Size &s, Color c)
 绘制实心标准矩形。
 
bool FillRect (const Graphics &g, const Rect &r, Color c)
 绘制实心标准矩形。
 
YF_API bool DrawCircle (const Graphics &, const Point &, SDst, Color c)
 绘制圆形。
 
yconstfn Padding operator+ (const Padding &x, const Padding &y)
 加法:对应分量调用 operator+ 。
 
YF_API Rect operator+ (const Rect &, const Padding &)
 加法:缩小屏幕标准矩形,相对位置由指定边距决定。
 
SDst GetHorizontalOf (const Padding &m)
 取水平边距和。
 
SDst GetVerticalOf (const Padding &m)
 取竖直边距和。
 
YF_API Padding FetchMargin (const Rect &, const Size &)
 取内边界相对于外边界的边距。
 
bool Clip (Rect &x, const Rect &y)
 剪切操作:取标准矩形交集并判断是否严格非空。
 
YF_API Point ClipBounds (Rect &, const Rect &)
 根据指定源的边界优化绘制上下文的剪切区域。
 
YF_API Point ClipMargin (PaintContext &, const Padding &, const Size &)
 根据指定边距和源的大小优化绘制上下文的剪切区域。
 
YF_API bool CopyTo (BitmapPtr, const Graphics &, const Size &, const Point &, const Point &, const Size &, Rotation=RDeg0)
 图形接口上下文向指针指定的缓冲区复制。
 
YF_API bool CopyTo (BitmapPtr, const BitmapBufferEx &, const Size &, const Point &, const Point &, const Size &, Rotation=RDeg0)
 刷新:位图缓冲区向指针指定的缓冲区复制。
 
bool CopyTo (const Graphics &dst, const Graphics &src, const Point &dp={}, const Point &sp={}, Rotation rot=RDeg0)
 图形接口上下文复制。
 
bool CopyTo (const Graphics &dst, const BitmapBufferEx &src, const Point &dp={}, const Point &sp={}, Rotation rot=RDeg0)
 刷新:位图缓冲区向图形接口上下文复制。
 
YF_API bool BlitTo (BitmapPtr, const BitmapBufferEx &, const Size &, const Point &, const Point &, const Size &, Rotation=RDeg0)
 贴图:位图缓冲区向指针指定的缓冲区以贴图算法复制。
 
bool BlitTo (const Graphics &dst, const BitmapBufferEx &src, const Point &dp={}, const Point &sp={}, Rotation rot=RDeg0)
 贴图:位图缓冲区向指针指定的缓冲区以贴图算法复制。
 
YF_API bool DrawRectRoundCorner (const Graphics &, const Point &, const Size &, Color)
 绘制部件边框用空心标准矩形。
 
YF_API void RectDrawArrow (const Graphics &, const Point &, SDst, Rotation=RDeg0, Color c=ColorSpace::Black)
 在指定图形接口上下文的矩形上画箭头。
 
YF_API void DrawArrow (const Graphics &, const Rect &, SDst=4, Rotation=RDeg0, Color=ColorSpace::Black)
 在指定图形接口上下文上画箭头。
 
YF_API void DrawCross (const Graphics &, const Point &, const Size &, Color)
 在指定图形接口上下文中的指定点为边框左上角使用指定颜色绘制交叉直线段(“×”)。
 
template<Color::MonoType r, Color::MonoType g, Color::MonoType b>
void transform_pixel_ex (BitmapPtr dst)
 矩形区域颜色转换。
 
YF_API hsl_t ColorToHSL (Color)
 RGB 颜色转换为 HSL 颜色。
 
YF_API Color HSLToColor (hsl_t)
 HSL 颜色转换为 RGB 颜色。
 
template<bool _bSwapLR, bool _bSwapUD>
int BlitScale (const Point &dp, const Size &ds, int delta_x, int delta_y)
 贴图偏移量计算器。
 
template<>
YF_API int BlitScale< false, false > (const Point &, const Size &, int, int)
 
template<>
YF_API int BlitScale< true, false > (const Point &, const Size &, int, int)
 
template<>
YF_API int BlitScale< false, true > (const Point &, const Size &, int, int)
 
template<>
YF_API int BlitScale< true, true > (const Point &, const Size &, int, int)
 
template<bool _bPositiveScan>
void BlitLine (BitmapPtr &dst_iter, ConstBitmapPtr &src_iter, int delta_x)
 循环:按指定扫描顺序复制一行像素。
 
template<>
void BlitLine< false > (BitmapPtr &dst_iter, ConstBitmapPtr &src_iter, int delta_x)
 

详细描述

图形处理。

类型定义说明

typedef std::string YSLib::Drawing::FamilyName

字型家族名称。

自从
build 277

在文件 Font.h69 行定义.

typedef std::string YSLib::Drawing::FontPath

字体文件路径。

自从
build 277

在文件 Font.h64 行定义.

字体大小。

自从
build 277

在文件 Font.h52 行定义.

色调。

注解
角度制,值 360 对应一个圆周。
自从
build 302

在文件 ystyle.h94 行定义.

typedef ystdex::pair_iterator<ConstBitmapPtr, const u8*> YSLib::Drawing::IteratorPair

Alpha 光栅化源迭代器对。

自从
build 189

在文件 yblit.h44 行定义.

Alpha 单色光栅化源迭代器对。

自从
build 189

在文件 yblit.h51 行定义.

屏幕二维点(直角坐标表示)。

自从
build 242

在文件 ygdibase.h221 行定义.

typedef std::string YSLib::Drawing::StyleName

字型样式名称。

自从
build 277

在文件 Font.h74 行定义.

屏幕二维向量(直角坐标表示)。

自从
build 242

在文件 ygdibase.h228 行定义.

枚举类型说明

字体样式。

自从
build 197

在文件 Font.h81 行定义.

二元方向。

自从
build 170
枚举值:
Horizontal 
Vertical 

在文件 ygdibase.h808 行定义.

逆时针旋转角度指示输出指向。

自从
build 178
枚举值:
RDeg0 
RDeg90 
RDeg180 
RDeg270 

在文件 ygdibase.h796 行定义.

函数说明

SDst YSLib::Drawing::AdjustBottomMarginOf ( TextRegion &  tr)
inline

按字体高度和行距调整文本区域的底边距。

自从
build 252

在文件 TextLayout.h81 行定义.

参考 YSLib::Drawing::Padding::Bottom,FetchResizedBottomMargin() , 以及 YSLib::Drawing::TextState::Margin.

参考自 DualScreenReader::AdjustMargins().

函数调用图:

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

void YSLib::Drawing::AdjustEndOfLine ( TextState &  ts,
const Rect &  r,
SDst  w 
)
inline

按指定显示区域和文本区域的宽重新设置右边距。

注解
右边距参与行的结尾位置计算。
单独使用时,需要设置笔的起始位置(横坐标),否则只适用于单行显示。
参见
PutChar
自从
build 372

在文件 TextBase.h218 行定义.

参考 YSLib::Drawing::TextState::Margin,YSLib::Drawing::Padding::Right,YSLib::Drawing::Size::Width , 以及 YSLib::Drawing::GBinaryGroup< _type >::X.

参考自 YSLib::UI::TextList::DrawItems().

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

template<typename _tOut , typename _tIn >
void YSLib::Drawing::biltAlphaPoint ( _tOut  dst_iter,
_tIn  src_iter 
)

参考自 YSLib::Drawing::BlitBlendLoop< _bPositiveScan >::operator()().

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

template<>
void YSLib::Drawing::biltAlphaPoint ( PixelType *  dst_iter,
IteratorPair  src_iter 
)
inline
template<template< bool > class _gBlitLoop, bool _bSwapLR, bool _bSwapUD, typename _tOut , typename _tIn >
void YSLib::Drawing::Blit ( _tOut  dst,
const Size &  ds,
_tIn  src,
const Size &  ss,
const Point &  dp,
const Point &  sp,
const Size &  sc 
)

贴图函数模板。

模板参数
_gBlitLoop循环实现类模板。
_bSwapLR水平翻转镜像(关于水平中轴对称)。
_bSwapUD竖直翻转镜像(关于竖直中轴对称)。
_tOut输出迭代器类型。
_tIn输入迭代器类型。
参数
dst目标迭代器。
ds目标迭代器所在缓冲区大小。
src源迭代器。
ss源迭代器所在缓冲区大小。
dp目标迭代器起始点所在缓冲区偏移。
sp源迭代器起始点所在缓冲区偏移。
sc源迭代器需要复制的区域大小。
自从
build 182

对一块矩形区域逐像素顺序批量操作(如复制或贴图)。

在文件 yblit.h211 行定义.

参考 BlitBounds(),YSLib::Drawing::Size::Width,YSLib::Drawing::GBinaryGroup< _type >::X,YSLib::Drawing::GBinaryGroup< _type >::Y , 以及 YB_LIKELY.

函数调用图:

PixelType YSLib::Drawing::blitAlphaBlend ( PixelType  d,
PixelType  s,
u8  a 
)
inline
YF_API bool YSLib::Drawing::BlitBounds ( const Point &  dp,
const Point &  sp,
const Size &  ds,
const Size &  ss,
const Size &  cs,
int &  min_x,
int &  min_y,
int &  delta_x,
int &  delta_y 
)

贴图边界计算器。

自从
build 189
template<template< bool > class _gBlitLoop, typename _tOut , typename _tIn >
void YSLib::Drawing::BlitChar ( _tOut  dst,
_tIn  src,
const Size &  ss,
const PaintContext &  pc 
)
inline

字符块传输。

模板参数
_gBlitLoop循环实现类模板。
_tOut输出迭代器类型。
_tIn输入迭代器类型。
参数
src源迭代器。
ss源迭代器所在缓冲区大小。
pc指定字符所在区域和渲染目标的绘制上下文,其中 Location 为相对于源的坐标。
参见
Blit
自从
build 366

在文件 CharRenderer.h52 行定义.

template<bool _bPositiveScan>
void YSLib::Drawing::BlitLine ( BitmapPtr &  dst_iter,
ConstBitmapPtr &  src_iter,
int  delta_x 
)

循环:按指定扫描顺序复制一行像素。

注解
不检查迭代器有效性。
自从
build 189

在文件 yblit.h360 行定义.

template<>
void YSLib::Drawing::BlitLine< false > ( BitmapPtr &  dst_iter,
ConstBitmapPtr &  src_iter,
int  delta_x 
)
inline

在文件 yblit.h371 行定义.

template<bool _bSwapLR, bool _bSwapUD>
int YSLib::Drawing::BlitScale ( const Point &  dp,
const Size &  ds,
int  delta_x,
int  delta_y 
)

贴图偏移量计算器。

自从
build 315
template<>
YF_API int YSLib::Drawing::BlitScale< false, false > ( const Point &  ,
const Size &  ,
int  ,
int   
)
template<>
YF_API int YSLib::Drawing::BlitScale< false, true > ( const Point &  ,
const Size &  ,
int  ,
int   
)
template<>
YF_API int YSLib::Drawing::BlitScale< true, false > ( const Point &  ,
const Size &  ,
int  ,
int   
)
template<>
YF_API int YSLib::Drawing::BlitScale< true, true > ( const Point &  ,
const Size &  ,
int  ,
int   
)
template<bool _bDec, typename _fCallable , typename _tScalar , typename _tDiff , typename _tOut , typename _tIn >
void YSLib::Drawing::BlitScan ( _fCallable &&  f,
_tScalar  d_width,
_tScalar  s_width,
_tDiff  delta_x,
_tDiff  delta_y,
_tOut  dst,
_tIn  src 
)

贴图扫描函数模板。

模板参数
_bDec指定是否翻转水平和竖直方向之一。
_fCallable调用操作类型。
_tScalar度量大小的纯量类型。
_tDiff度量偏移量的差值类型。
_tOut输出迭代器类型。
_tIn输入迭代器类型。
参数
f操作对象。
d_width目标缓冲区的宽。
s_width源缓冲区的宽。
delta_x实际操作的宽。
delta_y实际操作的高。
dst目标迭代器。
src源迭代器。
自从
build 370

对一块矩形区域调用指定的逐像素扫描操作。

在文件 yblit.h183 行定义.

参考 yforward.

YF_API bool YSLib::Drawing::BlitTo ( BitmapPtr  ,
const BitmapBufferEx &  ,
const Size &  ,
const Point &  ,
const Point &  ,
const Size &  ,
Rotation  = RDeg0 
)

贴图:位图缓冲区向指针指定的缓冲区以贴图算法复制。

注解
仅当指针和指向有效。自动裁剪适应大小。

向指定大小和点(相对左上角)的指定图形接口上下文以指定输出指向以缓冲区内容贴图。

参考自 DrawText().

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

bool YSLib::Drawing::BlitTo ( const Graphics &  dst,
const BitmapBufferEx &  src,
const Point &  dp = {},
const Point &  sp = {},
Rotation  rot = RDeg0 
)
inline

贴图:位图缓冲区向指针指定的缓冲区以贴图算法复制。

注解
仅当指针和指向有效。自动裁剪适应大小。
自从
build 337

向指定大小和点(相对左上角)的指定图形接口上下文以指定输出指向以缓冲区内容贴图。

在文件 ygdi.h424 行定义.

yconstexpr u8 YSLib::Drawing::BLT_ALPHA_BITS ( )

参考自 component_blend().

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

yconstexpr u32 YSLib::Drawing::BLT_MAX_ALPHA ( (1<< BLT_ALPHA_BITS)-  1)

参考自 blitAlphaBlend().

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

yconstexpr u32 YSLib::Drawing::BLT_ROUND ( 1<<   BLT_ALPHA_BITS-1)

参考自 component_blend().

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

yconstexpr u32 YSLib::Drawing::BLT_ROUND_BR ( BLT_ROUND|BLT_ROUND<<  16)
yconstexpr u8 YSLib::Drawing::BLT_THRESHOLD ( )

参考自 biltAlphaPoint() , 以及 blitAlphaBlend().

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

yconstexpr u8 YSLib::Drawing::BLT_THRESHOLD2 ( 128  )

参考自 blitAlphaBlend().

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

void YSLib::Drawing::CarriageReturn ( TextState &  ts)
inline

回车。

指定文本状态的笔的水平位置移至左端,竖直位置不变。

自从
build 270

在文件 TextBase.h231 行定义.

参考 YSLib::Drawing::Padding::Left,YSLib::Drawing::TextState::Margin,YSLib::Drawing::TextState::Pen , 以及 YSLib::Drawing::GBinaryGroup< _type >::X.

参考自 DualScreenReader::Execute(),YSLib::Drawing::TextState::PutNewline(),YSLib::Drawing::TextState::ResetPen() , 以及 DualScreenReader::ScrollByPixel().

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

YF_API void YSLib::Drawing::ClearImage ( const Graphics &  )

清除图形接口上下文缓冲区。

自从
早于 build 132
template<typename _tPixel >
_tPixel* YSLib::Drawing::ClearPixel ( _tPixel *  dst,
size_t  n 
)
inline

清除指定位置的 n 个连续像素。

自从
build 322

在文件 yblit.h285 行定义.

参考 YSLib::ClearSequence().

参考自 ClearImage(),YSLib::Drawing::BitmapBufferEx::ClearImage(),YSLib::Drawing::TextRenderer::ClearLine() , 以及 YSLib::Drawing::TextRegion::ClearLine().

函数调用图:

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

bool YSLib::Drawing::Clip ( Rect &  x,
const Rect &  y 
)
inline

剪切操作:取标准矩形交集并判断是否严格非空。

自从
build 372

在文件 ygdi.h128 行定义.

参考 YSLib::Drawing::Size::IsUnstrictlyEmpty().

参考自 ClipBounds() , 以及 PaintChild().

函数调用图:

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

YF_API Point YSLib::Drawing::ClipBounds ( Rect &  ,
const Rect &   
)

根据指定源的边界优化绘制上下文的剪切区域。

返回
若边距决定不足以被渲染则为 Point() ,否则为源的起始偏移位置。
注解
当不需要绘制时,不修改偏移坐标。
自从
build 372

检查边距限制下需要保留绘制的区域,结果保存至绘制上下文的除渲染目标外的其它成员。

YF_API Point YSLib::Drawing::ClipMargin ( PaintContext &  ,
const Padding &  ,
const Size &   
)

根据指定边距和源的大小优化绘制上下文的剪切区域。

返回
若边距决定不足以被渲染则为 Point() ,否则为源的起始偏移位置。
注解
当不需要绘制时,不修改偏移坐标。
自从
build 369

检查边距限制下需要保留绘制的区域,结果保存至绘制上下文的除渲染目标外的其它成员。

YF_API hsl_t YSLib::Drawing::ColorToHSL ( Color  )

RGB 颜色转换为 HSL 颜色。

自从
build 276
u8 YSLib::Drawing::component_blend ( u8  d,
u8  s,
u8  a 
)
inline

在文件 yblit.h532 行定义.

参考 BLT_ALPHA_BITS() , 以及 BLT_ROUND().

参考自 blitAlphaBlend().

函数调用图:

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

YF_API void YSLib::Drawing::CopyBuffer ( const Graphics &  ,
const Graphics &   
)

以第一个参数作为目标,复制第二个参数的缓冲区内容。

前置条件
断言:指针非空;大小相等。
注解
缓冲区指针相等时忽略。
自从
build 177
YF_API bool YSLib::Drawing::CopyTo ( BitmapPtr  ,
const Graphics &  ,
const Size &  ,
const Point &  ,
const Point &  ,
const Size &  ,
Rotation  = RDeg0 
)

图形接口上下文向指针指定的缓冲区复制。

注解
仅当指针和指向有效。自动裁剪适应大小。

以指定图形接口上下文作为源,向指定大小和点(相对左上角)的 指定图形接口上下文以指定输出指向复制缓冲区内容。

参考自 YSLib::UI::ImageBrush::operator()(),YSLib::UI::BufferedRenderer::UpdateTo() , 以及 YSLib::UI::BufferedRenderer::Validate().

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

YF_API bool YSLib::Drawing::CopyTo ( BitmapPtr  ,
const BitmapBufferEx &  ,
const Size &  ,
const Point &  ,
const Point &  ,
const Size &  ,
Rotation  = RDeg0 
)

刷新:位图缓冲区向指针指定的缓冲区复制。

注解
仅当指针和指向有效。自动裁剪适应大小。

向指定大小和点(相对左上角)的指定图形接口上下文以指定输出指向复制缓冲区内容。

bool YSLib::Drawing::CopyTo ( const Graphics &  dst,
const Graphics &  src,
const Point &  dp = {},
const Point &  sp = {},
Rotation  rot = RDeg0 
)
inline

图形接口上下文复制。

注解
仅当指针和指向有效。自动裁剪适应大小。
自从
build 337

以第一个参数作为目标,以指定输出指向复制第二个参数的缓冲区内容 至相对于目标缓冲区的点。

在文件 ygdi.h386 行定义.

bool YSLib::Drawing::CopyTo ( const Graphics &  dst,
const BitmapBufferEx &  src,
const Point &  dp = {},
const Point &  sp = {},
Rotation  rot = RDeg0 
)
inline

刷新:位图缓冲区向图形接口上下文复制。

注解
仅当指针和指向有效。自动裁剪适应大小。
自从
build 337

向指定大小和点(相对左上角)的指定图形接口上下文以指定输出指向复制缓冲区内容。

在文件 ygdi.h400 行定义.

yconstexpr Padding YSLib::Drawing::DefaultMargin ( ,
,
,
 
)

默认边距。

自从
build 286

参考自 ShlExplorer::OnPaint().

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

YF_API void YSLib::Drawing::DrawArrow ( const Graphics &  ,
const Rect &  ,
SDst  = 4,
Rotation  = RDeg0,
Color  = ColorSpace::Black 
)

在指定图形接口上下文上画箭头。

自从
build 302

参考自 DrawArrow() , 以及 YSLib::UI::Menu::DrawItem().

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

YF_API bool YSLib::Drawing::DrawCircle ( const Graphics &  ,
const Point &  ,
SDst  ,
Color  c 
)

绘制圆形。

自从
build 394
YF_API void YSLib::Drawing::DrawClippedText ( const Graphics &  g,
const Rect &  mask,
TextState &  ts,
const String &  str,
bool  line_wrap 
)

绘制剪切区域的文本。

参数
g输出图形接口上下文。
mask相对于输出图形接口上下文矩形,限定输出边界。
ts输出时使用的文本状态。
str待绘制的字符串。
line_wrap自动换行。
自从
build 309

参考自 DrawClippedText(),YSLib::UI::TextList::DrawItem(),YSLib::UI::MLabel::DrawText() , 以及 DrawText().

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

YF_API void YSLib::Drawing::DrawClippedText ( const Graphics &  g,
const Rect &  mask,
const Rect &  bounds,
const String &  str,
const Padding &  m,
Color  ,
bool  line_wrap,
const Font &  fnt = {} 
)

绘制剪切区域的文本。

参数
g输出图形接口上下文。
mask相对于输出图形接口上下文矩形,限定输出边界。
bounds绘制区域的外边界。
str待绘制的字符串。
m绘制区域边界和外边界之间的边距。
line_wrap自动换行。
fnt输出时使用的字体。
自从
build 309
YF_API void YSLib::Drawing::DrawCross ( const Graphics &  ,
const Point &  ,
const Size &  ,
Color   
)

在指定图形接口上下文中的指定点为边框左上角使用指定颜色绘制交叉直线段(“×”)。

注解
若不满足长和宽都大于 8 则忽略。
自从
build 302
YF_API bool YSLib::Drawing::DrawHLineSeg ( const Graphics &  g,
SPos  y,
SPos  x1,
SPos  x2,
Color  c 
)

绘制水平线段:指定端点水平坐标 x1 、 x2 - 1 ,竖直坐标 y 。

前置条件
断言: bool(g)
YF_API bool YSLib::Drawing::DrawLineSeg ( const Graphics &  g,
SPos  x1,
SPos  y1,
SPos  x2,
SPos  y2,
Color  c 
)

绘制一般线段:端点 p1(x1, y1) 和 p2(x2, y2) 。

bool YSLib::Drawing::DrawLineSeg ( const Graphics &  g,
const Point &  p1,
const Point &  p2,
Color  c 
)
inline

绘制一般线段:端点 p1, p2 。

在文件 ydraw.h121 行定义.

参考 DrawLineSeg(),YSLib::Drawing::GBinaryGroup< _type >::X , 以及 YSLib::Drawing::GBinaryGroup< _type >::Y.

函数调用图:

bool YSLib::Drawing::DrawPoint ( const Graphics &  g,
SPos  x,
SPos  y,
Color  c 
)
inline

绘制点:(x, y) 。

在文件 ydraw.h83 行定义.

参考 YSLib::Drawing::Graphics::GetBufferPtr(),YSLib::Drawing::Graphics::GetSize(),PlotPixel() , 以及 YB_LIKELY.

参考自 DrawPoint() , 以及 DrawRectRoundCorner().

函数调用图:

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

bool YSLib::Drawing::DrawPoint ( const Graphics &  g,
const Point &  pt,
Color  c 
)
inline

绘制点:pt 。

在文件 ydraw.h93 行定义.

参考 DrawPoint(),YSLib::Drawing::GBinaryGroup< _type >::X , 以及 YSLib::Drawing::GBinaryGroup< _type >::Y.

函数调用图:

YF_API bool YSLib::Drawing::DrawRect ( const Graphics &  g,
const Point &  pt,
const Size &  s,
Color  c 
)

绘制空心标准矩形。

注解
右下角顶点坐标 (pt.X + s.Width - 1, pt.Y + s.Height - 1) 。
bool YSLib::Drawing::DrawRect ( const Graphics &  g,
const Rect &  r,
Color  c 
)
inline

绘制空心标准矩形。

注解
右下角顶点坐标 (r.X + r.Width - 1, r.Y + r.Height - 1) 。

在文件 ydraw.h137 行定义.

参考 DrawRect(),YSLib::Drawing::Rect::GetPoint() , 以及 YSLib::Drawing::Rect::GetSize().

函数调用图:

YF_API bool YSLib::Drawing::DrawRectRoundCorner ( const Graphics &  ,
const Point &  ,
const Size &  ,
Color   
)

绘制部件边框用空心标准矩形。

注解
右下角顶点坐标 (pt.X + s.Width - 1, pt.Y + s.Height - 1) 。
自从
build 215
YF_API void YSLib::Drawing::DrawText ( const Graphics &  g,
TextState &  ts,
const String &  str,
bool  line_wrap 
)

绘制文本。

参数
g输出图形接口上下文。
ts输出时使用的文本状态。
str待绘制的字符串。
line_wrap自动换行。
自从
build 309

参考自 ShlExplorer::OnPaint(),YSLib::UI::Label::Refresh() , 以及 YSLib::UI::Button::Refresh().

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

YF_API void YSLib::Drawing::DrawText ( const Graphics &  g,
const Rect &  bounds,
const String &  str,
const Padding &  m,
Color  ,
bool  line_wrap,
const Font &  fnt = {} 
)

绘制文本。

参数
g输出图形接口上下文。
bounds绘制区域的外边界。
str待绘制的字符串。
m绘制区域边界和外边界之间的边距。
line_wrap自动换行。
fnt输出时使用的字体。
自从
build 309
YF_API void YSLib::Drawing::DrawText ( TextRegion &  r,
const Graphics &  g,
const Point &  pt,
const Size &  s,
const String &  str,
bool  line_wrap 
)

绘制文本。

参数
r文本区域。
g输出图形接口上下文。
pt绘制区域左上角相对于图形接口上下文的位置偏移。
s绘制区域大小。
str待绘制的字符串。
line_wrap自动换行。
注解
间接绘制并贴图。
自从
build 309
YF_API bool YSLib::Drawing::DrawVLineSeg ( const Graphics &  g,
SPos  x,
SPos  y1,
SPos  y2,
Color  c 
)

绘制竖直线段:指定竖直水平坐标 x ,竖直坐标 y1 - 1 、 y2 。

前置条件
断言: bool(g)
YF_API SDst YSLib::Drawing::FetchCharWidth ( const Font &  ,
ucs4_t   
)

取指定的字符使用指定字体的显示宽度。

注解
无边界限制。
自从
build 280
YF_API const Typeface& YSLib::Drawing::FetchDefaultTypeface ( )

取默认字型引用。

异常
LoggedEvent记录异常事件。
注解
仅抛出以上异常。
自从
build 194

在文件 Font.cpp182 行定义.

参考 FetchDefaultFontCache() , 以及 YB_UNLIKELY.

函数调用图:

YF_API SPos YSLib::Drawing::FetchLastLineBasePosition ( const TextState &  ,
SDst   
)

取指定文本状态在指定高的区域中表示的最底行的基线位置(纵坐标)。

注解
若不足一行则最底行视为首行。
警告
不检查边距正确性。若顶边距正确,则返回值应小于输入的高。
自从
build 190
YF_API Padding YSLib::Drawing::FetchMargin ( const Rect &  ,
const Size &   
)

取内边界相对于外边界的边距。

参考自 DrawClippedText().

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

template<typename _tIn >
SDst YSLib::Drawing::FetchMaxTextWidth ( const Font &  font,
_tIn  first,
_tIn  last 
)

取指定字体显示的迭代器范围中的文本的最大宽度。

自从
build 282

在文件 TextLayout.h185 行定义.

参考 FetchStringWidth().

参考自 YSLib::UI::MTextList::GetMaxTextWidth().

函数调用图:

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

yconstfn const char* YSLib::Drawing::FetchName ( FontStyle  style)

取样式名称。

返回
非空结果。
自从
build 277

在文件 Font.h99 行定义.

参考 style().

函数调用图:

YF_API SDst YSLib::Drawing::FetchResizedBottomMargin ( const TextState &  ,
SDst   
)

取指定文本状态和文本区域高调整的底边距。

前置条件
断言: GetTextLineHeightExOf(ts) != 0
后置条件
ts.Margin.Bottom 不小于原值。
返回
返回调整后的底边距值(由字体大小、行距和高决定)。
自从
build 252
SDst YSLib::Drawing::FetchResizedBottomMargin ( const TextRegion &  tr)
inline

取按字体高度和行距调整文本区域的底边距。

自从
build 252

在文件 TextLayout.h71 行定义.

参考 FetchResizedBottomMargin().

函数调用图:

YF_API u16 YSLib::Drawing::FetchResizedLineN ( const TextState &  ts,
SDst   
)

取指定文本状态和文本区域高所能显示的最大文本行数。

前置条件
断言: GetTextLineHeightExOf(ts) != 0
返回
最大能容纳的文本行数。
自从
build 252
template<typename _tIn >
SDst YSLib::Drawing::FetchStringWidth ( const Font &  fnt,
_tIn  s 
)

取迭代器指定的字符串在字体指定、无边界限制时的显示宽度。

注解
迭代器 s 指向字符串首字符,迭代直至字符串结束符。
自从
build 214

在文件 TextLayout.h103 行定义.

参考 FetchCharWidth() , 以及 w.

参考自 YSLib::UI::MLabel::DrawText(),FetchMaxTextWidth() , 以及 FetchStringWidth().

函数调用图:

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

template<typename _tIn >
SDst YSLib::Drawing::FetchStringWidth ( const Font &  fnt,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

取迭代器指定的单行字符串在字体指定、无边界限制时的显示宽度。

注解
迭代器 s 指向字符串首字符,迭代直至边界迭代器 g 或指定字符 c 。
自从
build 251

在文件 TextLayout.h118 行定义.

SDst YSLib::Drawing::FetchStringWidth ( const Font &  fnt,
const String &  str 
)
inline

取单行字符串在字体指定、无边界限制时的显示宽度。

自从
build 214

在文件 TextLayout.h131 行定义.

参考 FetchStringWidth().

函数调用图:

template<typename _tIn >
SDst YSLib::Drawing::FetchStringWidth ( TextState &  ts,
SDst  h,
_tIn  s 
)

取迭代器指定的单行字符串在指定文本状态和高度限制时的显示宽度。

注解
迭代器 s 指向字符串首字符,迭代直至字符串结束符。
字体由文本状态指定。
自从
build 197

在文件 TextLayout.h143 行定义.

参考 YSLib::Drawing::TextState::Pen,PrintString() , 以及 YSLib::Drawing::GBinaryGroup< _type >::X.

函数调用图:

template<typename _tIn >
SDst YSLib::Drawing::FetchStringWidth ( TextState &  ts,
SDst  h,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

取迭代器指定的单行字符串在指定文本状态和高度限制时的显示宽度。

注解
迭代器 s 指向字符串首字符,迭代直至边界迭代器 g 或指定字符 c 。
字体由文本状态指定。
自从
build 251

在文件 TextLayout.h159 行定义.

SDst YSLib::Drawing::FetchStringWidth ( TextState &  ts,
SDst  h,
const String &  str 
)
inline

取单行字符串在指定文本状态和高度限制时的显示宽度。

注解
字体由文本状态指定。
自从
build 197

在文件 TextLayout.h173 行定义.

参考 FetchStringWidth().

函数调用图:

YF_API void YSLib::Drawing::Fill ( const Graphics &  ,
Color   
)

使用指定颜色填充图形接口上下文缓冲区。

自从
build 177
template<typename _tPixel >
void YSLib::Drawing::FillPixel ( _tPixel *  dst,
size_t  n,
_tPixel  c 
)
inline

使用 n 个指定像素连续填充指定位置。

自从
早于 build 132

在文件 yblit.h297 行定义.

YF_API bool YSLib::Drawing::FillRect ( const Graphics &  g,
const Point &  pt,
const Size &  s,
Color  c 
)

绘制实心标准矩形。

注解
右下角顶点坐标 (pt.X + s.Width - 1, pt.Y + s.Height - 1) 。
bool YSLib::Drawing::FillRect ( const Graphics &  g,
const Rect &  r,
Color  c 
)
inline

绘制实心标准矩形。

注解
右下角顶点坐标 (r.X + r.Width - 1, r.Y + r.Height - 1) 。

在文件 ydraw.h153 行定义.

参考 FillRect(),YSLib::Drawing::Rect::GetPoint() , 以及 YSLib::Drawing::Rect::GetSize().

函数调用图:

template<typename _tPixel >
void YSLib::Drawing::FillRect ( _tPixel *  dst,
const Size &  ds,
const Point &  sp,
const Size &  ss,
_tPixel  c 
)
inline

使用指定像素填充指定的标准矩形区域。

自从
build 160

在文件 yblit.h319 行定义.

template<typename _tPixel >
void YSLib::Drawing::FillRect ( _tPixel *  dst,
const Size &  ds,
const Rect &  rSrc,
_tPixel  c 
)
inline

使用指定像素填充指定的标准矩形区域。

自从
build 151

在文件 yblit.h331 行定义.

template<typename _tPixel >
void YSLib::Drawing::FillRect ( _tPixel *  dst,
SDst  dw,
SDst  dh,
SPos  sx,
SPos  sy,
SDst  sw,
SDst  sh,
_tPixel  c 
)
inline

使用指定像素填充指定的标准矩形区域。

自从
build 160

在文件 yblit.h342 行定义.

template<typename _tPixel >
void YSLib::Drawing::FillVerticalLine ( _tPixel *  dst,
size_t  n,
SDst  dw,
_tPixel  c 
)
inline

使用 n 个指定像素竖直填充指定位置。

自从
build 182

在文件 yblit.h308 行定义.

yconstfn auto YSLib::Drawing::GetAreaOf ( const Size &  s) -> decltype(s.Width * s.Height)
u16 YSLib::Drawing::GetCurrentTextLineNOf ( const TextState &  ts)
inline

取笔所在的当前行数。

自从
build 231

在文件 TextBase.h178 行定义.

参考 GetTextLineHeightExOf(),YSLib::Drawing::TextState::Margin,YSLib::Drawing::TextState::Pen,YSLib::Drawing::Padding::Top , 以及 YSLib::Drawing::GBinaryGroup< _type >::Y.

函数调用图:

template<class _tRenderer >
SDst YSLib::Drawing::GetEndOfLinePositionOf ( const _tRenderer &  r)
inline

取文本渲染器的行末位置(横坐标)。

自从
build 372

在文件 CharRenderer.h89 行定义.

参考自 PutChar().

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

SDst YSLib::Drawing::GetHorizontalOf ( const Padding &  m)
inline

取水平边距和。

在文件 ygdi.h101 行定义.

参考 YSLib::Drawing::Padding::Left , 以及 YSLib::Drawing::Padding::Right.

参考自 ClipMargin(),YSLib::UI::MLabel::DrawText(),HexViewArea::Refresh(),ResizeForContent() , 以及 YSLib::UI::ListBox::ResizeForPreferred().

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

SPos YSLib::Drawing::GetTextLineBaseOf ( const TextState &  ts)
inline

取第一行的基线位置(纵坐标)。

自从
build 372

在文件 TextBase.h188 行定义.

参考 YSLib::Drawing::PenStyle::Font,YSLib::Drawing::Font::GetAscender(),YSLib::Drawing::TextState::Margin , 以及 YSLib::Drawing::Padding::Top.

参考自 YSLib::Drawing::TextState::ResetPen() , 以及 SetCurrentTextLineNOf().

函数调用图:

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

SDst YSLib::Drawing::GetTextLineHeightExOf ( const TextState &  ts)
inline
SDst YSLib::Drawing::GetTextLineHeightOf ( const TextState &  ts)
inline

取当前指定文本状态的字体设置对应的行高。

自从
build 231

在文件 TextBase.h158 行定义.

参考 YSLib::Drawing::PenStyle::Font , 以及 YSLib::Drawing::Font::GetHeight().

参考自 YSLib::UI::MLabel::DrawText().

函数调用图:

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

SDst YSLib::Drawing::GetVerticalOf ( const Padding &  m)
inline

取竖直边距和。

在文件 ygdi.h110 行定义.

参考 YSLib::Drawing::Padding::Bottom , 以及 YSLib::Drawing::Padding::Top.

参考自 ClipMargin(),YSLib::UI::MLabel::DrawText(),FetchResizedBottomMargin(),FetchResizedLineN() , 以及 YSLib::UI::MTextList::RefreshTextState().

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

YF_API Color YSLib::Drawing::HSLToColor ( hsl_t  )

HSL 颜色转换为 RGB 颜色。

自从
build 276
YF_API void YSLib::Drawing::MovePen ( TextState &  ,
ucs4_t   
)

按字符跨距移动笔。

自从
build 196
template<typename _type >
yconstfn bool YSLib::Drawing::operator!= ( const GBinaryGroup< _type > &  a,
const GBinaryGroup< _type > &  b 
)

比较:屏幕二元组不等关系。

自从
build 319

在文件 ygdibase.h178 行定义.

yconstfn bool YSLib::Drawing::operator!= ( const Size &  a,
const Size &  b 
)

比较:屏幕区域大小不等关系。

自从
build 319

在文件 ygdibase.h356 行定义.

yconstfn bool YSLib::Drawing::operator!= ( const Rect &  x,
const Rect &  y 
)

比较:屏幕标准矩形不等关系。

自从
build 319

在文件 ygdibase.h634 行定义.

yconstfn FontStyle YSLib::Drawing::operator& ( FontStyle  _x,
FontStyle  _y 
)

在文件 Font.h90 行定义.

Rect YSLib::Drawing::operator& ( const Rect &  ,
const Rect &   
)

求两个屏幕标准矩形的交。

参见
Rect::operator&=
自从
build 320
FontStyle& YSLib::Drawing::operator&= ( FontStyle &  _x,
FontStyle  _y 
)
inline

在文件 Font.h90 行定义.

template<typename _type , typename _tScalar >
yconstfn GBinaryGroup<_type> YSLib::Drawing::operator* ( const GBinaryGroup< _type > &  val,
_tScalar  l 
)

数乘:屏幕二元组。

自从
build 319

在文件 ygdibase.h211 行定义.

yconstfn Padding YSLib::Drawing::operator+ ( const Padding &  x,
const Padding &  y 
)

加法:对应分量调用 operator+ 。

在文件 ygdi.h84 行定义.

参考 YSLib::Drawing::Padding::Bottom,YSLib::Drawing::Padding::Left,YSLib::Drawing::Padding::Right , 以及 YSLib::Drawing::Padding::Top.

YF_API Rect YSLib::Drawing::operator+ ( const Rect &  ,
const Padding &   
)

加法:缩小屏幕标准矩形,相对位置由指定边距决定。

注解
若边距过大,则矩形的宽或高可能为 0 。
template<typename _type >
yconstfn GBinaryGroup<_type> YSLib::Drawing::operator+ ( const GBinaryGroup< _type > &  a,
const GBinaryGroup< _type > &  b 
)

加法:屏幕二元组。

自从
build 319

在文件 ygdibase.h189 行定义.

template<typename _type >
yconstfn GBinaryGroup<_type> YSLib::Drawing::operator+ ( GBinaryGroup< _type >  val,
const Size &  s 
)

加法:使用屏幕二元组和屏幕区域大小分量对应相加构造屏幕二元组。

自从
build 319

在文件 ygdibase.h368 行定义.

yconstfn Rect YSLib::Drawing::operator+ ( const Rect &  r,
const Vec &  v 
)

加法:使用标准矩形 r 和偏移向量 v 构造屏幕标准矩形。

自从
build 319

在文件 ygdibase.h645 行定义.

template<typename _type >
yconstfn GBinaryGroup<_type> YSLib::Drawing::operator- ( const GBinaryGroup< _type > &  a,
const GBinaryGroup< _type > &  b 
)

减法:屏幕二元组。

自从
build 319

在文件 ygdibase.h200 行定义.

yconstfn Rect YSLib::Drawing::operator- ( const Rect &  r,
const Vec &  v 
)

减法:使用标准矩形 r 和偏移向量的加法逆元 v 构造屏幕标准矩形。

自从
build 319

在文件 ygdibase.h655 行定义.

template<typename _type >
yconstfn bool YSLib::Drawing::operator== ( const GBinaryGroup< _type > &  a,
const GBinaryGroup< _type > &  b 
)

比较:屏幕二元组相等关系。

自从
build 319

在文件 ygdibase.h167 行定义.

yconstfn bool YSLib::Drawing::operator== ( const Size &  a,
const Size &  b 
)

比较:屏幕区域大小相等关系。

自从
build 319

在文件 ygdibase.h346 行定义.

yconstfn bool YSLib::Drawing::operator== ( const Rect &  x,
const Rect &  y 
)

比较:屏幕标准矩形相等关系。

自从
build 319

在文件 ygdibase.h624 行定义.

yconstfn FontStyle YSLib::Drawing::operator^ ( FontStyle  _x,
FontStyle  _y 
)

在文件 Font.h90 行定义.

FontStyle& YSLib::Drawing::operator^= ( FontStyle &  _x,
FontStyle  _y 
)
inline

在文件 Font.h90 行定义.

yconstfn FontStyle YSLib::Drawing::operator| ( FontStyle  _x,
FontStyle  _y 
)

在文件 Font.h90 行定义.

Rect YSLib::Drawing::operator| ( const Rect &  ,
const Rect &   
)

求两个屏幕标准矩形的并。

参见
Rect::operator|=
自从
build 320
FontStyle& YSLib::Drawing::operator|= ( FontStyle &  _x,
FontStyle  _y 
)
inline

在文件 Font.h90 行定义.

yconstfn FontStyle YSLib::Drawing::operator~ ( FontStyle  _x)

在文件 Font.h90 行定义.

bool YSLib::Drawing::PlotPixel ( BitmapPtr  dst,
const Size &  s,
SPos  x,
SPos  y,
Color  c 
)
inline

绘制像素:(x, y) 。

自从
build 394

在文件 ydraw.h69 行定义.

参考 Contains(),PutPixel() , 以及 YSLib::Drawing::Size::Width.

参考自 DrawPoint().

函数调用图:

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

template<class _tRenderer >
void YSLib::Drawing::PrintChar ( _tRenderer &  r,
ucs4_t  c 
)

打印单个可打印字符。

自从
build 270
待办事项:
行的结尾位置计算和边距解除耦合。

在文件 CharRenderer.h101 行定义.

参考 YB_LIKELY.

参考自 PrintLine() , 以及 PrintString().

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

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PrintLine ( _tRenderer &  r,
_tIn  s 
)

打印迭代器指定的字符串,直至行尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
返回
指向结束位置的迭代器。
注解
迭代直至字符串结束符。
自从
build 190

在文件 TextRenderer.h48 行定义.

参考 PrintChar().

参考自 PrintLine().

函数调用图:

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

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PrintLine ( _tRenderer &  r,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

打印迭代器指定的字符串,直至行尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
g指示迭代终止位置的输入迭代器。
c指向迭代终止的字符。
返回
指向结束位置的迭代器。
注解
迭代直至 g 指定的位置或指定位置的字符为 c 。
自从
build 251

在文件 TextRenderer.h69 行定义.

template<class _tRenderer >
String::size_type YSLib::Drawing::PrintLine ( _tRenderer &  r,
const String &  str 
)
inline

打印字符串,直至行尾或字符串结束。

参数
r使用的字符渲染器。
str被输出的字符串。
返回
打印字符数。
自从
build 190

在文件 TextRenderer.h87 行定义.

参考 PrintLine().

函数调用图:

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PrintString ( _tRenderer &  r,
_tIn  s 
)

打印迭代器指定的字符串,直至区域末尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
返回
指向结束位置的迭代器。
注解
迭代直至字符串结束符。
自从
build 190

在文件 TextRenderer.h161 行定义.

参考 PrintChar().

参考自 FetchStringWidth() , 以及 PrintString().

函数调用图:

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

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PrintString ( _tRenderer &  r,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

打印迭代器指定的字符串,直至区域末尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
g指示迭代终止位置的输入迭代器。
c指向迭代终止的字符。
返回
指向结束位置的迭代器。
注解
迭代直至 g 指定的位置或指定位置的字符为 c 。
自从
build 251

在文件 TextRenderer.h179 行定义.

template<class _tRenderer >
String::size_type YSLib::Drawing::PrintString ( _tRenderer &  r,
const String &  str 
)
inline

打印字符串,直至区域末尾或字符串结束。

参数
r使用的字符渲染器。
str被输出的字符串。
返回
打印字符数。
自从
build 190

在文件 TextRenderer.h194 行定义.

参考 PrintString().

函数调用图:

template<class _tRenderer >
u8 YSLib::Drawing::PutChar ( _tRenderer &  r,
ucs4_t  c 
)

打印单个字符。

返回
遇到行内无法容纳而换行时返回非零值,否则返回 0 。
注解
处理换行符。
当行内无法容纳完整字符时换行。
自从
build 190

在文件 CharRenderer.h124 行定义.

参考 GetEndOfLinePositionOf() , 以及 PutCharBase().

参考自 PutLine() , 以及 PutString().

函数调用图:

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

YF_API u8 YSLib::Drawing::PutCharBase ( TextState &  ,
SDst  ,
ucs4_t   
)

使用指定的文本状态和行末位置(横坐标)打印并判断是否需要具体渲染单个字符。

返回
遇到行内无法容纳而换行时为 1 ,需要继续渲染为 2 ,否则为 0 。
自从
build 372
template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PutLine ( _tRenderer &  r,
_tIn  s 
)

打印迭代器指定的字符串,直至行尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
返回
指向结束位置的迭代器。
注解
迭代直至字符串结束符。
当行内无法容纳完整字符时换行。
自从
build 190

在文件 TextRenderer.h103 行定义.

参考 PutChar().

参考自 DrawClippedText(),DrawText(),DualScreenReader::Execute(),DualScreenReader::PutLastLine(),PutLine() , 以及 HexViewArea::Refresh().

函数调用图:

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

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PutLine ( _tRenderer &  r,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

打印迭代器指定的字符串,直至行尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
g指示迭代终止位置的输入迭代器。
c指向迭代终止的字符。
返回
指向结束位置的迭代器。
注解
迭代直至 g 指定的位置或指定位置的字符为 c 。
当行内无法容纳完整字符时换行。
自从
build 251

在文件 TextRenderer.h126 行定义.

template<class _tRenderer >
String::size_type YSLib::Drawing::PutLine ( _tRenderer &  r,
const String &  str 
)
inline

打印字符串,直至行尾或字符串结束。

参数
r使用的字符渲染器。
str被输出的字符串。
返回
打印字符数。
注解
当行内无法容纳完整字符时换行。
自从
build 190

在文件 TextRenderer.h146 行定义.

参考 PutLine().

函数调用图:

void YSLib::Drawing::PutPixel ( BitmapPtr  dst,
SDst  w,
SPos  x,
SPos  y,
Color  c 
)
inline

绘制像素:(x, y) 。

前置条件
断言 dst
自从
build 394

在文件 ydraw.h45 行定义.

参考 YAssert.

参考自 PlotPixel() , 以及 PutPixel().

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

void YSLib::Drawing::PutPixel ( const Graphics &  g,
SPos  x,
SPos  y,
Color  c 
)
inline

绘制像素:(x, y) 。

前置条件
断言 Rect(g.GetSize()).Contains(x, y)

在文件 ydraw.h56 行定义.

参考 Contains(),YSLib::Drawing::Graphics::GetBufferPtr(),YSLib::Drawing::Graphics::GetSize(),YSLib::Drawing::Graphics::GetWidth(),PutPixel() , 以及 YAssert.

函数调用图:

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PutString ( _tRenderer &  r,
_tIn  s 
)

打印迭代器指定的字符串,直至区域末尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
返回
指向结束位置的迭代器。
注解
迭代直至字符串结束符。
当行内无法容纳完整字符时换行。
自从
build 190

在文件 TextRenderer.h210 行定义.

参考 FetchLastLineBasePosition() , 以及 PutChar().

参考自 DrawClippedText(),DrawText(),DualScreenReader::LoadText(),PutString() , 以及 DualScreenReader::UpdateView().

函数调用图:

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

template<typename _tIn , class _tRenderer >
_tIn YSLib::Drawing::PutString ( _tRenderer &  r,
_tIn  s,
_tIn  g,
ucs4_t  c = {} 
)

打印迭代器指定的字符串,直至区域末尾或字符迭代终止。

参数
r使用的字符渲染器。
s指向字符串起始字符的输入迭代器。
g指示迭代终止位置的输入迭代器。
c指向迭代终止的字符。
返回
指向结束位置的迭代器。
注解
迭代直至 g 指定的位置或指定位置的字符为 c 。
当行内无法容纳完整字符时换行。
自从
build 251

在文件 TextRenderer.h233 行定义.

template<class _tRenderer >
String::size_type YSLib::Drawing::PutString ( _tRenderer &  r,
const String &  str 
)
inline

打印字符串,直至区域末尾或字符串结束。

参数
r使用的字符渲染器。
str被输出的字符串。
返回
打印字符数。
注解
当行内无法容纳完整字符时换行。
自从
build 190

在文件 TextRenderer.h253 行定义.

参考 PutString().

函数调用图:

YF_API void YSLib::Drawing::RectDrawArrow ( const Graphics &  ,
const Point &  ,
SDst  ,
Rotation  = RDeg0,
Color  c = ColorSpace::Black 
)

在指定图形接口上下文的矩形上画箭头。

自从
build 215
YF_API void YSLib::Drawing::RenderChar ( PaintContext &&  pc,
Color  ,
CharBitmap::BufferType  ,
const Size &   
)

渲染单个字符。

参数
pc指定字符所在区域和渲染目标的绘制上下文,其中 Location 为相对于源的坐标。
前置条件
断言:缓冲区非空。
注解
忽略 Alpha 缓冲。
自从
build 368
YF_API void YSLib::Drawing::RenderCharAlpha ( PaintContext &&  pc,
Color  ,
CharBitmap::BufferType  ,
const Size &  ,
u8 *   
)

渲染带 Alpha 缓冲的单个字符。

参数
pc指定字符所在区域和渲染目标的绘制上下文,其中 Location 为相对于源的坐标。
前置条件
断言:缓冲区非空。
自从
build 368
YF_API void YSLib::Drawing::SetCurrentTextLineNOf ( TextState &  ,
u16   
)

设置笔的行位置。

自从
build 231
void YSLib::Drawing::SetPenOf ( TextState &  ts,
SPos  x,
SPos  y 
)
inline

设置笔位置。

自从
build 231

在文件 TextBase.h198 行定义.

参考 YSLib::Drawing::TextState::Pen.

template<Color::MonoType r, Color::MonoType g, Color::MonoType b>
void YSLib::Drawing::transform_pixel_ex ( BitmapPtr  dst)
inline

矩形区域颜色转换。

自从
build 196

在文件 ystyle.h79 行定义.

参考 platform::Color::GetB(),platform::Color::GetG() , 以及 platform::Color::GetR().

函数调用图:

template<class _fTransformPixel >
bool YSLib::Drawing::TransformRect ( const Graphics &  g,
const Point &  pt,
const Size &  s,
_fTransformPixel  tp 
)

以像素为单位变换标准矩形。

自从
build 166

在文件 yblit.h622 行定义.

参考 YSLib::Drawing::Graphics::GetBufferPtr(),YSLib::Drawing::Graphics::GetSize() , 以及 YB_LIKELY.

参考自 YSL_BEGIN::RectDrawButton() , 以及 YSL_BEGIN::RectDrawCheckBox().

函数调用图:

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

template<class _fTransformPixel >
bool YSLib::Drawing::TransformRect ( const Graphics &  g,
const Rect &  r,
_fTransformPixel  tp 
)
inline

以像素为单位变换标准矩形。

自从
build 166

在文件 yblit.h639 行定义.

参考 YSLib::Drawing::Rect::GetPoint() , 以及 YSLib::Drawing::Rect::GetSize().

函数调用图:

template<class _tBinary >
yconstfn _tBinary YSLib::Drawing::Transpose ( _tBinary &  obj)

二元对象转置。

自从
build 319

在文件 ygdibase.h380 行定义.