~ubuntu-branches/ubuntu/trusty/etl/trusty-proposed

« back to all changes in this revision

Viewing changes to ETL/_boxblur.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-05-13 19:36:15 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20130513193615-8z59omgg2twsvu2i
Tags: 0.04.16-1
* New upstream release [May 2013].
* Standards to 3.9.4.
* xz compression for source and binary packages.
* Minor debian/watch update.
* Updated my email address; bumped copyright years.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                iter=pen.x();
52
52
                end=pen.end_x();
53
53
 
54
 
                typename T1::accumulator_type tot(*iter*(length+1));
 
54
                typename T1::accumulator_type tot((typename T1::accumulator_type)(*iter)*(length+1));
55
55
 
56
56
                for (x=0;x<length && iter!=end;x++,++iter) tot+=*iter;
57
57
                iter=pen.x();
58
58
 
59
59
                for (x=0;x<w && iter!=end;x++,++iter,outpen.inc_x())
60
60
                {
61
 
                        tot -= (x>length) ? iter[-length-1] : *pen.x();
62
 
                        tot += ((x+length)<w) ? iter[length] : end[-1];
63
 
 
64
 
                        outpen.put_value(tot*divisor);
 
61
                        tot -= (x>length) ?
 
62
                                (typename T1::accumulator_type)(iter[-length-1]) :
 
63
                                (typename T1::accumulator_type)(*pen.x());
 
64
                        tot += ((x+length)<w) ?
 
65
                                (typename T1::accumulator_type)(iter[length]) :
 
66
                                (typename T1::accumulator_type)(end[-1]);
 
67
                                                                          
 
68
                        outpen.put_value((typename T2::value_type)(tot*divisor));
65
69
                }
66
70
                outpen.dec_x(x);
67
71
        }
82
86
                iter=pen.y();
83
87
                end=pen.end_y();
84
88
 
85
 
                typename T1::accumulator_type tot(*iter*(length+1));
 
89
                typename T1::accumulator_type tot((typename T1::accumulator_type)(*iter)*(length+1));
86
90
 
87
91
                for (y=0;y<length && iter!=end;y++,++iter) tot+=*iter;
88
92
                iter=pen.y();
89
93
 
90
94
                for (y=0;y<h && iter!=end;y++,++iter,outpen.inc_y())
91
95
                {
92
 
                        tot -= (y>length) ? iter[-length-1] : *pen.y();
93
 
                        tot += ((y+length)<h) ? iter[length] : end[-1];
 
96
                        tot -= (y>length) ?
 
97
                        (typename T1::accumulator_type)(iter[-length-1]) :
 
98
                        (typename T1::accumulator_type)(*pen.y());
 
99
                        tot += ((y+length)<h) ?
 
100
                        (typename T1::accumulator_type)(iter[length]) :
 
101
                        (typename T1::accumulator_type)(end[-1]);
94
102
 
95
 
                        outpen.put_value(tot*divisor);
 
103
                        outpen.put_value((typename T2::value_type)(tot*divisor));
96
104
                }
97
105
                outpen.dec_y(y);
98
106
        }