6 #include <lib/base/object.h>
7 #include <lib/base/smartptr.h>
8 #include <lib/base/elock.h>
9 #include <lib/gdi/erect.h>
10 #include <lib/gdi/fb.h>
14 unsigned char b, g, r, a;
15 gRGB(int r, int g, int b, int a=0): b(b), g(g), r(r), a(a)
18 gRGB(unsigned long val): b(val&0xFF), g((val>>8)&0xFF), r((val>>16)&0xFF), a((val>>24)&0xFF) // ARGB
21 gRGB(): b(0), g(0), r(0), a(0)
25 unsigned long argb() const
27 return (a<<24)|(r<<16)|(g<<8)|b;
30 void operator=(unsigned long val)
37 bool operator < (const gRGB &c) const
55 bool operator==(const gRGB &c) const
57 return (b == c.b) && (g == c.g) && (r == c.r) && (a == c.a);
65 gColor(int color): color(color)
71 operator int() const { return color; }
72 bool operator==(const gColor &o) const { return o.color==color; }
79 gColor findColor(const gRGB &rgb) const;
86 gLookup(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
88 ~gLookup() { delete [] lookup; }
89 void build(int size, const gPalette &pal, const gRGB &start, const gRGB &end);
95 int x, y, bpp, bypp, stride;
100 int offset; // only for backbuffers
103 gSurface(eSize size, int bpp, int accel);
110 SWIG_IGNORE(gPixmap);
111 class gPixmap: public iObject
113 DECLARE_REF(gPixmap);
122 gPixmap(gSurface *surface);
123 gPixmap(eSize, int bpp, int accel = 0);
132 inline bool needClut() const { return surface && surface->bpp <= 8; }
135 eSize size() const { return eSize(surface->x, surface->y); }
137 bool must_delete_surface;
139 void fill(const gRegion &clip, const gColor &color);
140 void fill(const gRegion &clip, const gRGB &color);
142 void blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flags=0);
144 void mergePalette(const gPixmap &target);
145 void line(const gRegion &clip, ePoint start, ePoint end, gColor color);
150 SWIG_TEMPLATE_TYPEDEF(ePtr<gPixmap>, gPixmapPtr);