My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#include <CtrlCore/CtrlCore.h>

#ifdef GUI_FB

NAMESPACE_UPP

#define LTIMING(x) // RTIMING(x)

void SetSurface(SystemDraw& w, int x, int y, int cx, int cy, const RGBA *pixels)
{
GuiLock __;
}

void SetSurface(SystemDraw& w, const Rect& dest, const RGBA *pixels, Size psz, Point poff)
{
GuiLock __;
}

struct Image::Data::SystemData {
};

void Image::Data::SysInitImp()
{
SystemData& sd = Sys();
}

void Image::Data::SysReleaseImp()
{
SystemData& sd = Sys();
}

Image::Data::SystemData& Image::Data::Sys() const
{
ASSERT(sizeof(system_buffer) >= sizeof(SystemData));
return *(SystemData *)system_buffer;
}

int Image::Data::GetResCountImp() const
{
SystemData& sd = Sys();
return 0;
}

void Image::Data::PaintImp(SystemDraw& w, int x, int y, const Rect& src, Color c)
{
GuiLock __;
SystemData& sd = Sys();
}

Image ImageDraw::Get(bool pm) const
{
ImageBuffer result(image.GetSize());
const RGBA *e = image.End();
const RGBA *p = ~image;
RGBA *t = ~result;
if(has_alpha) {
const RGBA *a = ~alpha;
while(p < e) {
*t = *p++;
(t++)->a = (a++)->r;
}
if(pm)
Premultiply(result);
result.SetKind(IMAGE_ALPHA);
}
else {
while(p < e) {
*t = *p++;
(t++)->a = 255;
}
}
return result;
}

Draw& ImageDraw::Alpha()
{
has_alpha = true;
return alpha_painter;
}


ImageDraw::ImageDraw(Size sz)
: ImageDraw__(sz.cx, sz.cy),
BufferPainter(image),
alpha_painter(alpha)
{
has_alpha = false;
}

ImageDraw::ImageDraw(int cx, int cy)
: ImageDraw__(cx, cy),
BufferPainter(image),
alpha_painter(alpha)
{
has_alpha = false;
}

#define IMAGECLASS FBImg
#define IMAGEFILE <Framebuffer/FB.iml>
#include <Draw/iml_source.h>

Image Image::Arrow() { return FBImg::arrow(); }
Image Image::Wait() { return FBImg::wait(); }
Image Image::IBeam() { return FBImg::ibeam(); }
Image Image::No() { return FBImg::no(); }
Image Image::SizeAll() { return FBImg::sizeall(); }
Image Image::SizeHorz() { return FBImg::sizehorz(); }
Image Image::SizeVert() { return FBImg::sizevert(); }
Image Image::SizeTopLeft() { return FBImg::sizetopleft(); }
Image Image::SizeTop() { return FBImg::sizetop(); }
Image Image::SizeTopRight() { return FBImg::sizetopright(); }
Image Image::SizeLeft() { return FBImg::sizeleft(); }
Image Image::SizeRight() { return FBImg::sizeright(); }
Image Image::SizeBottomLeft() { return FBImg::sizebottomleft(); }
Image Image::SizeBottom() { return FBImg::sizebottom(); }
Image Image::SizeBottomRight() { return FBImg::sizebottomright(); }
Image Image::Hand() { return FBImg::hand(); }

END_UPP_NAMESPACE

#endif

Change log

r4176 by cxl on Nov 16, 2011   Diff
.reference: Rainbow example (RM #158)
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 2664 bytes, 121 lines
Powered by Google Project Hosting