YSTest: YBrush.cpp 源文件

YSTest PreAlpha_b700_20160611 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 文件列表
- 文件成员

YBrush.cpp
浏览该文件的文档.
1 /*
2 © 2012-2015 FrankHB.
3
4 This file is part of the YSLib project, and may only be used,
5 modified, and distributed under the terms of the YSLib project
6 license, LICENSE.TXT. By continuing to use, modify, or distribute
7 this file you indicate that you have read the license and
8 understand and accept it fully.
9 */
10
28 #include "YSLib/UI/YModules.h"
29 #include YFM_YSLib_Service_YBrush
30 #include YFM_YSLib_Service_YDraw
31
32 namespace YSLib
33 {
34
35 namespace Drawing
36 {
37
38 void
39 SolidBrush::operator()(const PaintContext& pc) const
40 {
41 FillRect(pc.Target, pc.ClipArea, Color);
42 }
43
44
45 void
46 SolidBlendBrush::operator()(const PaintContext& pc) const
47 {
48 BlendRect(pc.Target, pc.ClipArea, Color);
49 }
50
51
52 void
53 SolidCompositeBrush::operator()(const PaintContext& pc) const
54 {
55 CompositeRect(pc.Target, pc.ClipArea, Color);
56 }
57
58
59 void
60 ImageBrush::operator()(const PaintContext& pc) const
61 {
62 if(ImagePtr)
63 Update(pc, *ImagePtr, DstOffset, SrcOffset);
64 }
65
66 void
67 ImageBrush::DefaultUpdate(const PaintContext& pc, const Image& img,
68 const Point& dst_offset, const Point& src_offset)
69 {
70 const auto& g(pc.Target);
71 const Rect& bounds(pc.ClipArea);
72 const auto& src(img.GetContext());
73
74 // CopyTo(g.GetBufferPtr(), src, g.GetSize(), bounds.GetPoint(), Offset,
75 // bounds.GetSize());
76 BlitLines<false, false>(CopyLine<true>(), g.GetBufferPtr(),
77 src.GetBufferPtr(), g.GetSize(), src.GetSize(), bounds.GetPoint(),
78 bounds.GetPoint() + src_offset - dst_offset, bounds.GetSize());
79 }
80
81 } // namespace Drawing;
82
83 } // namespace YSLib;
84
YSLib::Drawing::SolidBrush::operator()
void operator()(const PaintContext &) const
Definition: YBrush.cpp:39
YSLib::Drawing::ImageBrush::DefaultUpdate
static void DefaultUpdate(const PaintContext &, const Drawing::Image &, const Point &, const Point &)
默认更新：复制图像。
Definition: YBrush.cpp:67
YSLib::Drawing::CopyLine
扫描线：按指定扫描顺序复制一行像素。
Definition: YBlit.h:443
YSLib::Drawing::ImageBrush::DstOffset
Point DstOffset
Definition: YBrush.h:142
YSLib::Drawing::ImageBrush::SrcOffset
Point SrcOffset
Definition: YBrush.h:144
YSLib
YSLib 命名空间。
Definition: AndroidHost.h:45
platform::Color
颜色。
Definition: Video.h:451
YSLib::Drawing::bounds
The boundary is out of the const Rect & bounds
Definition: YDraw.h:127
YSLib::Drawing::SolidBlendBrush::operator()
void operator()(const PaintContext &) const
Definition: YBrush.cpp:46
YSLib::Drawing::CompositeRect
YF_API void CompositeRect(const Graphics &, const Rect &, Color)
Definition: YBlend.cpp:48
YSLib::Drawing::BlendRect
YF_API void BlendRect(const Graphics &, const Rect &, Color)
Definition: YBlend.cpp:40
YSLib::Drawing::ImageBrush::Update
GBrushUpdater< const Drawing::Image &, const Point &, const Point & > Update
当前使用的图像更新器。
Definition: YBrush.h:137
YSLib::Drawing::Rect
屏幕标准矩形：表示屏幕矩形区域。
Definition: YGDIBase.h:540
YSLib::Drawing::ImageBrush::ImagePtr
shared_ptr< Drawing::Image > ImagePtr
Definition: YBrush.h:140
Drawing
YModules.h
YSLib::Drawing::FillRect
c YF_API void FillRect(const Graphics &g, const Rect &r, Color c)
填充标准矩形。
Definition: YDraw.cpp:150
YSLib::Drawing::g
The boundary is out of the const Graphics & g
Definition: YDraw.h:161
YSLib::Drawing::SolidCompositeBrush::operator()
void operator()(const PaintContext &) const
Definition: YBrush.cpp:53
YSLib::Drawing::GBinaryGroup< SPos >