Nur in kdeaddons-3.2.3-patch/noatun-plugins/jefferson: .deps. Nur in kdeaddons-3.2.3-patch/noatun-plugins/jefferson: Makefile. Nur in kdeaddons-3.2.3-patch/noatun-plugins/nexscope: .deps. Nur in kdeaddons-3.2.3-patch/noatun-plugins/nexscope: Makefile. diff -dur kdeaddons-3.2.3/noatun-plugins/synaescope/polygon.h kdeaddons-3.2.3-patch/noatun-plugins/synaescope/polygon.h --- kdeaddons-3.2.3/noatun-plugins/synaescope/polygon.h 2001-04-16 23:20:34.000000000 +0000 +++ kdeaddons-3.2.3-patch/noatun-plugins/synaescope/polygon.h 2004-06-20 13:56:39.000000000 +0000 @@ -9,46 +9,31 @@ Bitmap(int e=0) : extra(e), data(0) { }; ~Bitmap() { delete[] data; }; - void size(int w,int h) { - delete[] data; - width = w; - height = h; - data = new Pixel[w*h+extra]; - clear(); - } + void size(int w,int h); void clear() { memset(data,0,sizeof(Pixel)*(width*height+extra)); } }; +template void Bitmap::size(int w,int h) { + delete[] data; + width = w; + height = h; + data = new Pixel[w*h+extra]; + clear(); +} + template struct PolygonEngine : public Bitmap { - PolygonEngine() : Bitmap(1) { } + PolygonEngine() : Bitmap(1) { } #define super (1<= height) return; - if (x < 0) x = 0; - if (x > width) x = width; - data[x+y*width] += color; - } + void apply(Pixel *dest); + + void add(Pixel color,int x,int y); /* Color is char[layers] */ @@ -104,3 +89,26 @@ } #undef super }; + +template +void PolygonEngine::apply(Pixel *dest) + { + unsigned short sum=0; + int count = Bitmap::width*Bitmap::height; + unsigned short* src = Bitmap::data; + while(count--) { + sum += *(src++); + if (sum) + *dest = Combiner::combine(sum,*dest); + dest++; + } + } +template +void PolygonEngine::add(Pixel color,int x,int y) + { + if (y < 0) return; + if (y >= Bitmap::height) return; + if (x < 0) x = 0; + if (x > Bitmap::width) x = Bitmap::width; + Bitmap::data[x+y*Bitmap::width] += color; + } diff -dur kdeaddons-3.2.3/noatun-plugins/tippercanoe/polygon.h kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe/polygon.h --- kdeaddons-3.2.3/noatun-plugins/tippercanoe/polygon.h 2001-04-16 22:04:03.000000000 +0000 +++ kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe/polygon.h 2004-06-20 14:12:12.000000000 +0000 @@ -8,43 +8,29 @@ Bitmap(int e=0) : extra(e), data(0) { }; ~Bitmap() { delete[] data; }; - void size(int w,int h) { + void size(int w, int h); + + void clear() { + memset(data,0,sizeof(Pixel)*(width*height+extra)); + } +}; + + template void Bitmap::size(int w,int h) { delete[] data; width = w; height = h; data = new Pixel[w*h+extra]; clear(); } - - void clear() { - memset(data,0,sizeof(Pixel)*(width*height+extra)); - } -}; template struct PolygonEngine : public Bitmap { PolygonEngine() : Bitmap(1) { } #define super (1<= height) return; - if (x < 0) x = 0; - if (x > width) x = width; - data[x+y*width] += color; - } + void add(Pixel color,int x,int y); /* Color is char[layers] */ @@ -96,3 +82,24 @@ } #undef super }; + +template +void PolygonEngine::apply(Pixel *dest) { + Pixel sum=0; + int count = Bitmap::width*Bitmap::height; + Pixel *src = Bitmap::data; + while(count--) { + sum += *(src++); + if (sum) + *dest = Combiner::combine(sum,*dest); + dest++; + } + } +template +void PolygonEngine::add(Pixel color,int x,int y) { + if (y < 0) return; + if (y >= Bitmap::height) return; + if (x < 0) x = 0; + if (x > Bitmap::width) x = Bitmap::width; + Bitmap::data[x+y*Bitmap::width] += color; + } Nur in kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe: polygon.h~.