28 #ifndef YSL_INC_Service_CharRenderer_h_
29 #define YSL_INC_Service_CharRenderer_h_ 1
32 #include YFM_YSLib_Service_TextBase
33 #include YFM_YSLib_Service_YBlit
57 template<
typename _tOut,
typename _tIn,
typename _fBlitScanner>
60 const PaintContext& pc,
bool neg_pitch)
62 const auto& ds(pc.Target.GetSize());
63 const auto&
r(pc.ClipArea);
66 BlitLines<false, true>(scanner, dst, src, ds, ss, r.GetPoint(),
67 pc.Location, r.GetSize());
69 BlitLines<false, false>(scanner, dst, src, ds, ss, r.GetPoint(),
70 pc.Location, r.GetSize());
89 template<
typename _tOut,
typename _tIn,
typename _fPixelShader>
92 const PaintContext& pc,
bool neg_pitch)
94 const auto& ds(pc.Target.GetSize());
95 const auto&
r(pc.ClipArea);
98 BlitPixels<false, true>(blit, dst, src, ds, ss, r.GetPoint(),
99 pc.Location, r.GetSize());
101 BlitPixels<false, false>(blit, dst, src, ds, ss, r.GetPoint(),
102 pc.Location, r.GetSize());
134 template<
class _tRenderer>
138 return r.GetTextState().Margin.Right;
146 template<
class _tRenderer>
169 template<
class _tRenderer>
void PrintChar(_tRenderer &r, ucs4_t c)
打印单个可打印字符。
void BlitGlyphPixels(_fPixelShader blit, _tOut dst, _tIn src, const Size &ss, const PaintContext &pc, bool neg_pitch)
字符按像素块传输。
YF_API u8 PutCharBase(TextState &, SDst, ucs4_t)
使用指定的文本状态和行末位置(横坐标)按需打印换行并判断是否需要渲染单个字符。
u8 PutChar(_tRenderer &r, ucs4_t c)
打印单个字符。
std::uint16_t SDst
屏幕坐标距离。
void BlitGlyphLines(_fBlitScanner scanner, _tOut dst, _tIn src, const Size &ss, const PaintContext &pc, bool neg_pitch)
字符按扫描线块传输。
YF_API void RenderChar(PaintContext &&pc, Color, bool, CharBitmap::BufferType, CharBitmap::FormatType, const Size &)
渲染单个字符。
char32_t ucs4_t
UCS-4 字符类型。
SDst GetEndOfLinePositionOf(const _tRenderer &r)
取文本渲染器的行末位置(横坐标)。
YF_API void RenderCharAlpha(PaintContext &&pc, Color, bool, CharBitmap::BufferType, CharBitmap::FormatType, const Size &, AlphaType *)
渲染带 Alpha 缓冲的单个字符。