27 #ifndef __ETL__GAUSSIAN_H
28 #define __ETL__GAUSSIAN_H
43 template<
typename T>
void
45 typename T::accumulator_pointer SC0,
46 typename T::accumulator_pointer SC1,
47 typename T::accumulator_pointer SC2,
48 typename T::accumulator_pointer SC3)
51 typename T::accumulator_type Tmp1,Tmp2,SR0,SR1,SR2,SR3;
56 for(x=0;x<w;x++)SC0[x+2]=(
typename T::accumulator_type)(pen.x()[x])*24;
57 memset(SC1,0,(w+2)*
sizeof(
typename T::accumulator_type));
58 memset(SC2,0,(w+2)*
sizeof(
typename T::accumulator_type));
59 memset(SC3,0,(w+2)*
sizeof(
typename T::accumulator_type));
61 for(y=0;y<h+2;y++,pen.inc_y())
65 {yadj=(h-y)-1; SR0=(
typename T::accumulator_type)(pen.y()[yadj])*1.35;}
67 {yadj=0; SR0=(
typename T::accumulator_type)(pen.get_value())*1.35; }
69 SR1=SR2=SR3=
typename T::accumulator_type();
70 for(x=0;x<w+2;x++,pen.inc_x())
73 Tmp1=(
typename T::accumulator_type)(pen[yadj][(w-x)-1]);
75 Tmp1=(
typename T::accumulator_type)(*pen[yadj]);
94 pen[-2][-2]=(
typename T::value_type)((SC3[x]+Tmp2)/256);
102 template<
typename T>
void
105 typename T::accumulator_pointer SC0=
new typename T::accumulator_type[w+2];
106 typename T::accumulator_pointer SC1=
new typename T::accumulator_type[w+2];
107 typename T::accumulator_pointer SC2=
new typename T::accumulator_type[w+2];
108 typename T::accumulator_pointer SC3=
new typename T::accumulator_type[w+2];
118 template<
typename T>
void
121 typename T::difference_type size(end-begin);
123 typename T::accumulator_pointer SC0=
new typename T::accumulator_type[size.x+2];
124 typename T::accumulator_pointer SC1=
new typename T::accumulator_type[size.x+2];
125 typename T::accumulator_pointer SC2=
new typename T::accumulator_type[size.x+2];
126 typename T::accumulator_pointer SC3=
new typename T::accumulator_type[size.x+2];
136 template<
typename T>
void
140 typename T::accumulator_type Tmp1,Tmp2,SR0,SR1;
144 typename T::accumulator_pointer SC0=
new typename T::accumulator_type[w+1];
145 typename T::accumulator_pointer SC1=
new typename T::accumulator_type[w+1];
148 for(x=0;x<w;x++)SC0[x+1]=(
typename T::accumulator_type)(pen.x()[x])*4;
149 memset(SC1,0,(w+1)*
sizeof(
typename T::accumulator_type));
151 for(y=0;y<h+1;y++,pen.inc_y())
155 {yadj=-1; SR1=SR0=(
typename T::accumulator_type)(pen.y()[yadj]);}
157 {yadj=0; SR1=SR0=(
typename T::accumulator_type)(pen.get_value()); }
159 for(x=0;x<w+1;x++,pen.inc_x())
162 Tmp1=(
typename T::accumulator_type)(pen[yadj][(w-x)-2]);
164 Tmp1=(
typename T::accumulator_type)(*pen[yadj]);
174 pen[-1][-1]=(
typename T::value_type)((SC1[x]+Tmp2)/16);
185 template<
typename _PEN>
void
188 typename _PEN::difference_type size(end-begin);
193 template<
typename I>
void
198 typename std::iterator_traits<I>::value_type Tmp1,Tmp2,SR0,SR1;
202 for(iter=begin;iter!=end;prev=iter++)
209 if(iter!=begin && ( endpts || (prev != begin) ))
225 template<
typename _PEN>
void
228 typename _PEN::difference_type size=end-begin;
229 for(;size.y>0;size.y--, begin.inc_y())
234 template<
typename _PEN>
void
237 typename _PEN::difference_type size=end-begin;
238 for(;size.x>0;size.x--,begin.inc_x())
242 template<
typename T>
void
245 typename T::accumulator_pointer SC0=
new typename T::accumulator_type[w+2];
246 typename T::accumulator_pointer SC1=
new typename T::accumulator_type[w+2];
247 typename T::accumulator_pointer SC2=
new typename T::accumulator_type[w+2];
248 typename T::accumulator_pointer SC3=
new typename T::accumulator_type[w+2];
253 while(blur_x&&blur_y)
255 if(blur_x>=4 && blur_y>=4)
260 else if(blur_x>=2 && blur_y>=2)
295 template<
typename T>
void
298 typename T::difference_type size(end-begin);
302 template<
typename T>
void
305 typename T::difference_type size(end-begin);