mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
4.8 KiB

  1. Nur in kdeaddons-3.2.3-patch/noatun-plugins/jefferson: .deps.
  2. Nur in kdeaddons-3.2.3-patch/noatun-plugins/jefferson: Makefile.
  3. Nur in kdeaddons-3.2.3-patch/noatun-plugins/nexscope: .deps.
  4. Nur in kdeaddons-3.2.3-patch/noatun-plugins/nexscope: Makefile.
  5. diff -dur kdeaddons-3.2.3/noatun-plugins/synaescope/polygon.h kdeaddons-3.2.3-patch/noatun-plugins/synaescope/polygon.h
  6. --- kdeaddons-3.2.3/noatun-plugins/synaescope/polygon.h 2001-04-16 23:20:34.000000000 +0000
  7. +++ kdeaddons-3.2.3-patch/noatun-plugins/synaescope/polygon.h 2004-06-20 13:56:39.000000000 +0000
  8. @@ -9,46 +9,31 @@
  9. Bitmap(int e=0) : extra(e), data(0) { };
  10. ~Bitmap() { delete[] data; };
  11. - void size(int w,int h) {
  12. - delete[] data;
  13. - width = w;
  14. - height = h;
  15. - data = new Pixel[w*h+extra];
  16. - clear();
  17. - }
  18. + void size(int w,int h);
  19. void clear() {
  20. memset(data,0,sizeof(Pixel)*(width*height+extra));
  21. }
  22. };
  23. +template <class Pixel> void Bitmap<Pixel>::size(int w,int h) {
  24. + delete[] data;
  25. + width = w;
  26. + height = h;
  27. + data = new Pixel[w*h+extra];
  28. + clear();
  29. +}
  30. +
  31. template<class Pixel, class Combiner, int superSampleShift>
  32. struct PolygonEngine : public Bitmap<Pixel>
  33. {
  34. - PolygonEngine() : Bitmap<Pixel>(1) { }
  35. + PolygonEngine() : Bitmap<Pixel>(1) { }
  36. #define super (1<<superSampleShift)
  37. - void apply(Pixel *dest)
  38. - {
  39. - Pixel sum=0;
  40. - int count = width*height;
  41. - Pixel *src = data;
  42. - while(count--) {
  43. - sum += *(src++);
  44. - if (sum)
  45. - *dest = Combiner::combine(sum,*dest);
  46. - dest++;
  47. - }
  48. - }
  49. - void add(Pixel color,int x,int y)
  50. - {
  51. - if (y < 0) return;
  52. - if (y >= height) return;
  53. - if (x < 0) x = 0;
  54. - if (x > width) x = width;
  55. - data[x+y*width] += color;
  56. - }
  57. + void apply(Pixel *dest);
  58. +
  59. + void add(Pixel color,int x,int y);
  60. /* Color is char[layers] */
  61. @@ -104,3 +89,26 @@
  62. }
  63. #undef super
  64. };
  65. +
  66. +template<class Pixel, class Combiner, int superSampleShift>
  67. +void PolygonEngine<Pixel,Combiner,superSampleShift>::apply(Pixel *dest)
  68. + {
  69. + unsigned short sum=0;
  70. + int count = Bitmap<Pixel>::width*Bitmap<Pixel>::height;
  71. + unsigned short* src = Bitmap<Pixel>::data;
  72. + while(count--) {
  73. + sum += *(src++);
  74. + if (sum)
  75. + *dest = Combiner::combine(sum,*dest);
  76. + dest++;
  77. + }
  78. + }
  79. +template<class Pixel, class Combiner, int superSampleShift>
  80. +void PolygonEngine<Pixel,Combiner,superSampleShift>::add(Pixel color,int x,int y)
  81. + {
  82. + if (y < 0) return;
  83. + if (y >= Bitmap<Pixel>::height) return;
  84. + if (x < 0) x = 0;
  85. + if (x > Bitmap<Pixel>::width) x = Bitmap<Pixel>::width;
  86. + Bitmap<Pixel>::data[x+y*Bitmap<Pixel>::width] += color;
  87. + }
  88. diff -dur kdeaddons-3.2.3/noatun-plugins/tippercanoe/polygon.h kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe/polygon.h
  89. --- kdeaddons-3.2.3/noatun-plugins/tippercanoe/polygon.h 2001-04-16 22:04:03.000000000 +0000
  90. +++ kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe/polygon.h 2004-06-20 14:12:12.000000000 +0000
  91. @@ -8,43 +8,29 @@
  92. Bitmap(int e=0) : extra(e), data(0) { };
  93. ~Bitmap() { delete[] data; };
  94. - void size(int w,int h) {
  95. + void size(int w, int h);
  96. +
  97. + void clear() {
  98. + memset(data,0,sizeof(Pixel)*(width*height+extra));
  99. + }
  100. +};
  101. +
  102. + template <class Pixel> void Bitmap<Pixel>::size(int w,int h) {
  103. delete[] data;
  104. width = w;
  105. height = h;
  106. data = new Pixel[w*h+extra];
  107. clear();
  108. }
  109. -
  110. - void clear() {
  111. - memset(data,0,sizeof(Pixel)*(width*height+extra));
  112. - }
  113. -};
  114. template<class Pixel, class Combiner, int superSampleShift>
  115. struct PolygonEngine : public Bitmap<Pixel> {
  116. PolygonEngine() : Bitmap<Pixel>(1) { }
  117. #define super (1<<superSampleShift)
  118. - void apply(Pixel *dest) {
  119. - Pixel sum=0;
  120. - int count = width*height;
  121. - Pixel *src = data;
  122. - while(count--) {
  123. - sum += *(src++);
  124. - if (sum)
  125. - *dest = Combiner::combine(sum,*dest);
  126. - dest++;
  127. - }
  128. - }
  129. + void apply(Pixel *dest);
  130. - void add(Pixel color,int x,int y) {
  131. - if (y < 0) return;
  132. - if (y >= height) return;
  133. - if (x < 0) x = 0;
  134. - if (x > width) x = width;
  135. - data[x+y*width] += color;
  136. - }
  137. + void add(Pixel color,int x,int y);
  138. /* Color is char[layers] */
  139. @@ -96,3 +82,24 @@
  140. }
  141. #undef super
  142. };
  143. +
  144. +template<class Pixel, class Combiner, int superSampleShift>
  145. +void PolygonEngine<Pixel,Combiner,superSampleShift>::apply(Pixel *dest) {
  146. + Pixel sum=0;
  147. + int count = Bitmap<Pixel>::width*Bitmap<Pixel>::height;
  148. + Pixel *src = Bitmap<Pixel>::data;
  149. + while(count--) {
  150. + sum += *(src++);
  151. + if (sum)
  152. + *dest = Combiner::combine(sum,*dest);
  153. + dest++;
  154. + }
  155. + }
  156. +template<class Pixel, class Combiner, int superSampleShift>
  157. +void PolygonEngine<Pixel,Combiner,superSampleShift>::add(Pixel color,int x,int y) {
  158. + if (y < 0) return;
  159. + if (y >= Bitmap<Pixel>::height) return;
  160. + if (x < 0) x = 0;
  161. + if (x > Bitmap<Pixel>::width) x = Bitmap<Pixel>::width;
  162. + Bitmap<Pixel>::data[x+y*Bitmap<Pixel>::width] += color;
  163. + }
  164. Nur in kdeaddons-3.2.3-patch/noatun-plugins/tippercanoe: polygon.h~.