Ticket #34838: patch-contrib__tbl__vipl__txx-clang-compatibility.diff
File patch-contrib__tbl__vipl__txx-clang-compatibility.diff, 14.6 KB (added by neverpanic (Clemens Lang), 12 years ago) |
---|
-
contrib/tbl/vipl/vipl_add_random_noise.txx
old new 7 7 template <class ImgIn,class ImgOut,class DataIn,class DataOut,class PixelItr> 8 8 bool vipl_add_random_noise <ImgIn,ImgOut,DataIn,DataOut,PixelItr> :: section_applyop() 9 9 { 10 int startx = start(this->X_Axis());11 int starty = start(this->Y_Axis());12 int stopx = stop(this->X_Axis());13 int stopy = stop(this->Y_Axis());10 int startx = this->start(this->X_Axis()); 11 int starty = this->start(this->Y_Axis()); 12 int stopx = this->stop(this->X_Axis()); 13 int stopy = this->stop(this->Y_Axis()); 14 14 for (register int j = starty; j < stopy; ++j) 15 15 for (register int i = startx; i < stopx; ++i) 16 16 { -
contrib/tbl/vipl/vipl_convert.txx
old new 14 14 const ImgIn &in = this->in_data(0); 15 15 ImgOut &out = this->out_data(0); 16 16 17 int startx = start(this->X_Axis());18 int starty = start(this->Y_Axis());19 int stopx = stop(this->X_Axis());20 int stopy = stop(this->Y_Axis());17 int startx = this->start(this->X_Axis()); 18 int starty = this->start(this->Y_Axis()); 19 int stopx = this->stop(this->X_Axis()); 20 int stopy = this->stop(this->Y_Axis()); 21 21 for (int j = starty; j < stopy; ++j) 22 22 for (int i = startx; i < stopx; ++i) 23 23 fsetpixel(out, i, j, (DataOut)fgetpixel(in,i,j,DataIn(0))); -
contrib/tbl/vipl/vipl_dilate_disk.txx
old new 12 12 int size = (radius() < 0) ? 0 : int(radius()); 13 13 // mask is filled in preop function 14 14 // apply filter: 15 int startx = start(this->X_Axis());16 int starty = start(this->Y_Axis());17 int stopx = stop(this->X_Axis());18 int stopy = stop(this->Y_Axis());15 int startx = this->start(this->X_Axis()); 16 int starty = this->start(this->Y_Axis()); 17 int stopx = this->stop(this->X_Axis()); 18 int stopy = this->stop(this->Y_Axis()); 19 19 for (register int j = starty, ej = stopy; j < ej ; ++j) 20 20 for (register int i = startx, ei = stopx; i < ei ; ++i) 21 21 { -
contrib/tbl/vipl/vipl_dyadic.txx
old new 9 9 const ImgIn &in = this->in_data(); 10 10 ImgOut &out = this->out_data(); 11 11 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (int j = starty; j < stopy; ++j) 17 17 for (int i = startx; i < stopx; ++i) { 18 18 DataIn p = fgetpixel(in, i, j, DataIn(0)); -
contrib/tbl/vipl/vipl_erode_disk.txx
old new 21 21 #ifdef DEBUG 22 22 vcl_cout << " set start & stop ..."; 23 23 #endif 24 int startx = start(this->X_Axis());25 int starty = 0; // = start(this->Y_Axis());26 int stopx = stop(this->X_Axis());27 int stopy = stop(this->Y_Axis()); // = height(out);24 int startx = this->start(this->X_Axis()); 25 int starty = 0; // = this->start(this->Y_Axis()); 26 int stopx = this->stop(this->X_Axis()); 27 int stopy = this->stop(this->Y_Axis()); // = height(out); 28 28 #ifdef DEBUG 29 29 vcl_cout << " (" << startx << ':' << stopx << ',' << starty << ':' << stopy << ')'; 30 30 vcl_cout << " run over image ..."; -
contrib/tbl/vipl/vipl_gaussian_convolution.txx
old new 12 12 int size = masksize(); 13 13 14 14 // Make temporary buffer to hold result of first (horizontal) convolution 15 int width = stop(this->X_Axis()) -start(this->X_Axis());16 int height = stop(this->Y_Axis()) -start(this->Y_Axis());15 int width = this->stop(this->X_Axis()) - this->start(this->X_Axis()); 16 int height = this->stop(this->Y_Axis()) - this->start(this->Y_Axis()); 17 17 double* buf = new double[width*height]; 18 18 if (!buf) return false; // memory allocation failed 19 19 20 20 // 1-D mask was generated in preop(), we just use it here: 21 21 22 22 // horizontal convolution: 23 int starty = start(this->Y_Axis());24 int stopy = stop(this->Y_Axis());23 int starty = this->start(this->Y_Axis()); 24 int stopy = this->stop(this->Y_Axis()); 25 25 for (int j = starty; j < stopy; ++j) 26 26 { 27 27 int buf_j = j - starty; 28 int startx = start(this->X_Axis(),j);29 int stopx = stop(this->X_Axis(),j);28 int startx = this->start(this->X_Axis(),j); 29 int stopx = this->stop(this->X_Axis(),j); 30 30 for (int i = startx; i < stopx; ++i) { 31 31 int buf_i = i - startx; 32 32 double result = mask()[0] * fgetpixel(in, i, j, DataIn(0)); … … 39 39 for (int j = starty; j < stopy; ++j) 40 40 { 41 41 int buf_j = j - starty; 42 int startx = start(this->X_Axis(),j);43 int stopx = stop(this->X_Axis(),j);42 int startx = this->start(this->X_Axis(),j); 43 int stopx = this->stop(this->X_Axis(),j); 44 44 for (int i = startx; i < stopx; ++i) { 45 45 int buf_i = i - startx; 46 46 double result = mask()[0] * buf[buf_i+width*buf_j]; -
contrib/tbl/vipl/vipl_gradient_dir.txx
old new 10 10 const ImgIn &in = this->in_data(0); 11 11 ImgOut &out = *this->out_data_ptr(); 12 12 13 int startx = start(this->X_Axis());14 int starty = start(this->Y_Axis());15 int stopx = stop(this->X_Axis());16 int stopy = stop(this->Y_Axis());13 int startx = this->start(this->X_Axis()); 14 int starty = this->start(this->Y_Axis()); 15 int stopx = this->stop(this->X_Axis()); 16 int stopy = this->stop(this->Y_Axis()); 17 17 for (int j = starty; j < stopy; ++j) 18 18 for (int i = startx; i < stopx; ++i) { 19 19 register double dx = fgetpixel(in, i, j, DataIn(0)) - getpixel(in, i-1, j, DataIn(0)); -
contrib/tbl/vipl/vipl_gradient_mag.txx
old new 11 11 ImgOut &out = *this->out_data_ptr(); 12 12 13 13 register double dx, dy; 14 int startx = start(this->X_Axis());15 int starty = start(this->Y_Axis());16 int stopx = stop(this->X_Axis());17 int stopy = stop(this->Y_Axis());14 int startx = this->start(this->X_Axis()); 15 int starty = this->start(this->Y_Axis()); 16 int stopx = this->stop(this->X_Axis()); 17 int stopy = this->stop(this->Y_Axis()); 18 18 for (int j = starty; j < stopy; ++j) 19 19 for (int i = startx; i < stopx; ++i) { 20 20 dx = fgetpixel(in, i, j, DataIn(0)) - getpixel(in, i-1, j, DataIn(0)); -
contrib/tbl/vipl/vipl_histogram.txx
old new 14 14 if (index < 0) index = 0; 15 15 #endif 16 16 if (checkrange() == 1) { // check range is slow, we always keep the divide... 17 for (int j = start(this->Y_Axis()), ej =stop(this->Y_Axis()) ; j < ej ; ++j)18 for (int i = start(this->X_Axis(),j), ei =stop(this->X_Axis(),j) ; i < ei ; ++i) {17 for (int j = this->start(this->Y_Axis()), ej = this->stop(this->Y_Axis()) ; j < ej ; ++j) 18 for (int i = this->start(this->X_Axis(),j), ei = this->stop(this->X_Axis(),j) ; i < ei ; ++i) { 19 19 long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0)))/scalein()); 20 20 #if 0 21 21 if (bin < 0) bin = 0; … … 26 26 } 27 27 } // else we want speed, skip safety check, check special cases 28 28 else if (scalein() == 1 && scaleout() == 1 && shiftin() == 0) { 29 for (int j = start(this->Y_Axis()), ej =stop(this->Y_Axis()) ; j < ej ; ++j)30 for (int i = start(this->X_Axis(),j), ei =stop(this->X_Axis(),j) ; i < ei ; ++i) {29 for (int j = this->start(this->Y_Axis()), ej = this->stop(this->Y_Axis()) ; j < ej ; ++j) 30 for (int i = this->start(this->X_Axis(),j), ei = this->stop(this->X_Axis(),j) ; i < ei ; ++i) { 31 31 long bin = long(0.5 + (getpixel(in,i,j,DataIn(0)))); 32 32 DataOut bs = getpixel(out,bin,index,DataOut(0)); 33 33 setpixel(out, bin, index, bs+1); 34 34 } 35 35 } else if (scalein() == 1) { 36 for (int j = start(this->Y_Axis()), ej =stop(this->Y_Axis()) ; j < ej ; ++j)37 for (int i = start(this->X_Axis(),j), ei =stop(this->X_Axis(),j) ; i < ei ; ++i) {36 for (int j = this->start(this->Y_Axis()), ej = this->stop(this->Y_Axis()) ; j < ej ; ++j) 37 for (int i = this->start(this->X_Axis(),j), ei = this->stop(this->X_Axis(),j) ; i < ei ; ++i) { 38 38 long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0)))); 39 39 DataOut bs = getpixel(out,bin,index,DataOut(0)); 40 40 setpixel(out, bin, index, scaleout()+bs); 41 41 } 42 42 } else { // all modes 43 for (int j = start(this->Y_Axis()), ej =stop(this->Y_Axis()) ; j < ej ; ++j)44 for (int i = start(this->X_Axis(),j), ei =stop(this->X_Axis(),j) ; i < ei ; ++i) {43 for (int j = this->start(this->Y_Axis()), ej = this->stop(this->Y_Axis()) ; j < ej ; ++j) 44 for (int i = this->start(this->X_Axis(),j), ei = this->stop(this->X_Axis(),j) ; i < ei ; ++i) { 45 45 long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0)))/scalein()); 46 46 DataOut bs = getpixel(out,bin,index,DataOut(0)); 47 47 setpixel(out, bin, index, scaleout()+bs); … … 55 55 { 56 56 const int index = indexout(); 57 57 ImgOut &out = *this->out_data_ptr(); 58 for (int i = start_dst(this->X_Axis()),59 ei = stop_dst(this->X_Axis()); i < ei; ++i)58 for (int i = this->start_dst(this->X_Axis()), 59 ei = this->stop_dst(this->X_Axis()); i < ei; ++i) 60 60 setpixel(out, i, index, DataOut(0)); 61 61 return true; 62 62 } -
contrib/tbl/vipl/vipl_median.txx
old new 14 14 15 15 // apply filter: 16 16 DataIn* v = new DataIn[(2*size+1)*(2*size+1)]; 17 int startx = start(this->X_Axis());18 int starty = start(this->Y_Axis());19 int stopx = stop(this->X_Axis());20 int stopy = stop(this->Y_Axis());17 int startx = this->start(this->X_Axis()); 18 int starty = this->start(this->Y_Axis()); 19 int stopx = this->stop(this->X_Axis()); 20 int stopy = this->stop(this->Y_Axis()); 21 21 for (int j = starty; j < stopy; ++j) 22 22 for (int i = startx; i < stopx; ++i) { 23 23 register int count = 0; -
contrib/tbl/vipl/vipl_moment.txx
old new 46 46 47 47 // We create a (double) float buffer to hold the computed values. 48 48 49 int startx = start(this->X_Axis());50 int starty = start(this->Y_Axis());51 int stopx = stop(this->X_Axis());52 int stopy = stop(this->Y_Axis());49 int startx = this->start(this->X_Axis()); 50 int starty = this->start(this->Y_Axis()); 51 int stopx = this->stop(this->X_Axis()); 52 int stopy = this->stop(this->Y_Axis()); 53 53 54 54 int sizex = stopx-startx+1; 55 55 int sizey = stopy-starty+1; -
contrib/tbl/vipl/vipl_monadic.txx
old new 9 9 const ImgIn &in = this->in_data(); 10 10 ImgOut &out = this->out_data(); 11 11 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (int j = starty; j < stopy; ++j) 17 17 for (int i = startx; i < stopx; ++i) 18 18 fsetpixel(out, i, j, func()(fgetpixel(in, i, j, DataIn(0)))); -
contrib/tbl/vipl/vipl_sobel.txx
old new 9 9 const ImgIn &in = this->in_data(0); 10 10 ImgOut &out = this->out_data(); 11 11 // apply filter: 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (int j = starty, ej = stopy; j < ej ; ++j) 17 17 for (int i = startx, ei = stopx; i < ei ; ++i) 18 18 fsetpixel(out, i, j, (DataOut)( -
contrib/tbl/vipl/vipl_threshold.txx
old new 9 9 const ImgIn &in = this->in_data(); 10 10 ImgOut &out = this->out_data(); 11 11 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (int j = starty; j < stopy; ++j) 17 17 for (int i = startx; i < stopx; ++i) { 18 18 DataIn p = fgetpixel(in, i, j, DataIn(0)); -
contrib/tbl/vipl/vipl_x_gradient.txx
old new 9 9 const ImgIn &in = this->in_data(0); 10 10 ImgOut &out = *this->out_data_ptr(); 11 11 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (register int j = starty; j < stopy; ++j) 17 17 for (register int i = startx+1; i < stopx; ++i) { 18 18 DataIn w = fgetpixel(in, i, j, DataIn(0)) -
contrib/tbl/vipl/vipl_y_gradient.txx
old new 9 9 const ImgIn &in = this->in_data(0); 10 10 ImgOut &out = *this->out_data_ptr(); 11 11 12 int startx = start(this->X_Axis());13 int starty = start(this->Y_Axis());14 int stopx = stop(this->X_Axis());15 int stopy = stop(this->Y_Axis());12 int startx = this->start(this->X_Axis()); 13 int starty = this->start(this->Y_Axis()); 14 int stopx = this->stop(this->X_Axis()); 15 int stopy = this->stop(this->Y_Axis()); 16 16 for (register int j = starty+1; j < stopy; ++j) 17 17 for (register int i = startx; i < stopx; ++i) { 18 18 DataIn w = fgetpixel(in, i, j, DataIn(0))