8 template <
typename TPIXEL,
typename TCHANNEL>
class TBitmap;
16 #include "../typedefs.hpp"
17 #include "../utils/Geometry.hpp"
18 #include "../utils/PointerArea.hpp"
65 template <
typename TPIXEL,
typename TCHANNEL>
102 unsigned long int size = width * height;
104 data = (TPIXEL *) malloc((
unsigned long int)(size *
sizeof(TPIXEL)));
109 this->height = height;
110 bpp =
sizeof(TPIXEL);
111 this->premultiplied = premultiplied;
119 this->premultiplied = 0;
133 TBitmap (
void * data,
unsigned width,
unsigned height,
ColorMode type,
int premultiplied) {
134 if (data != NULL && width > 0 && height > 0) {
137 this->height = height;
138 bpp =
sizeof(TPIXEL);
139 this->premultiplied = premultiplied;
141 this->data = (TPIXEL *) data;
148 this->premultiplied = 0;
161 if (other.
data != NULL) {
162 int size = width * height *
sizeof(TPIXEL);
163 data = (TPIXEL *) malloc(size);
165 memcpy(data, other.
data, size);
196 unsigned int getBpp()
const {
return bpp;}
225 virtual int premultiply();
233 virtual int demultiply();
268 virtual int fill(
Rect area, TPIXEL * src);
273 memset(data, 0, width * height * bpp);
294 template <
typename TPIXEL,
typename TCHANNEL>
297 template <
typename TPIXEL,
typename TCHANNEL>