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  
    77template <class ImgIn,class ImgOut,class DataIn,class DataOut,class PixelItr>
    88bool vipl_add_random_noise <ImgIn,ImgOut,DataIn,DataOut,PixelItr> :: section_applyop()
    99{
    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());
    1414  for (register int j = starty; j < stopy; ++j)
    1515    for (register int i = startx; i < stopx; ++i)
    1616    {
  • contrib/tbl/vipl/vipl_convert.txx

    old new  
    1414  const ImgIn &in = this->in_data(0);
    1515  ImgOut &out = this->out_data(0);
    1616
    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());
    2121  for (int j = starty; j < stopy; ++j)
    2222    for (int i = startx; i < stopx; ++i)
    2323      fsetpixel(out, i, j, (DataOut)fgetpixel(in,i,j,DataIn(0)));
  • contrib/tbl/vipl/vipl_dilate_disk.txx

    old new  
    1212  int size = (radius() < 0) ? 0 : int(radius());
    1313  // mask is filled in preop function
    1414  // 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());
    1919  for (register int j = starty, ej =  stopy; j < ej  ; ++j)
    2020    for (register int i = startx, ei = stopx; i < ei ; ++i)
    2121    {
  • contrib/tbl/vipl/vipl_dyadic.txx

    old new  
    99  const ImgIn &in = this->in_data();
    1010  ImgOut &out = this->out_data();
    1111
    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());
    1616  for (int j = starty; j < stopy; ++j)
    1717    for (int i = startx; i < stopx; ++i) {
    1818      DataIn p = fgetpixel(in, i, j, DataIn(0));
  • contrib/tbl/vipl/vipl_erode_disk.txx

    old new  
    2121#ifdef DEBUG
    2222  vcl_cout << " set start & stop ...";
    2323#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);
    2828#ifdef DEBUG
    2929  vcl_cout << " (" << startx << ':' << stopx << ',' << starty << ':' << stopy << ')';
    3030  vcl_cout << " run over image ...";
  • contrib/tbl/vipl/vipl_gaussian_convolution.txx

    old new  
    1212  int size = masksize();
    1313
    1414  // 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());
    1717  double* buf = new double[width*height];
    1818  if (!buf) return false; // memory allocation failed
    1919
    2020  // 1-D mask was generated in preop(), we just use it here:
    2121
    2222  // 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());
    2525  for (int j = starty; j < stopy; ++j)
    2626  {
    2727    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);
    3030    for (int i = startx; i < stopx; ++i) {
    3131      int buf_i = i - startx;
    3232      double result = mask()[0] * fgetpixel(in, i, j, DataIn(0));
     
    3939  for (int j = starty; j < stopy; ++j)
    4040  {
    4141    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);
    4444    for (int i = startx; i < stopx; ++i) {
    4545      int buf_i = i - startx;
    4646      double result = mask()[0] * buf[buf_i+width*buf_j];
  • contrib/tbl/vipl/vipl_gradient_dir.txx

    old new  
    1010  const ImgIn &in = this->in_data(0);
    1111  ImgOut &out = *this->out_data_ptr();
    1212
    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());
    1717  for (int j = starty; j < stopy; ++j)
    1818    for (int i = startx; i < stopx; ++i) {
    1919      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  
    1111  ImgOut &out = *this->out_data_ptr();
    1212
    1313  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());
    1818  for (int j = starty; j < stopy; ++j)
    1919    for (int i = startx; i < stopx; ++i) {
    2020      dx = fgetpixel(in, i, j, DataIn(0)) - getpixel(in, i-1, j, DataIn(0));
  • contrib/tbl/vipl/vipl_histogram.txx

    old new  
    1414  if (index < 0) index = 0;
    1515#endif
    1616  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) {
    1919        long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0)))/scalein());
    2020#if 0
    2121        if (bin < 0) bin = 0;
     
    2626      }
    2727  }  // else we want speed, skip safety check, check special cases
    2828  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) {
    3131        long bin = long(0.5 + (getpixel(in,i,j,DataIn(0))));
    3232        DataOut bs = getpixel(out,bin,index,DataOut(0));
    3333        setpixel(out, bin, index, bs+1);
    3434      }
    3535  } 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) {
    3838        long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0))));
    3939        DataOut bs = getpixel(out,bin,index,DataOut(0));
    4040        setpixel(out, bin, index, scaleout()+bs);
    4141      }
    4242  } 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) {
    4545        long bin = long(0.5 + (shiftin()+getpixel(in,i,j,DataIn(0)))/scalein());
    4646        DataOut bs = getpixel(out,bin,index,DataOut(0));
    4747        setpixel(out, bin, index, scaleout()+bs);
     
    5555{
    5656  const int index = indexout();
    5757  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)
    6060    setpixel(out, i, index, DataOut(0));
    6161  return true;
    6262}
  • contrib/tbl/vipl/vipl_median.txx

    old new  
    1414
    1515  // apply filter:
    1616  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());
    2121  for (int j = starty; j < stopy; ++j)
    2222    for (int i = startx; i < stopx; ++i) {
    2323      register int count = 0;
  • contrib/tbl/vipl/vipl_moment.txx

    old new  
    4646
    4747  // We create a (double) float buffer to hold the computed values.
    4848
    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());
    5353
    5454  int sizex = stopx-startx+1;
    5555  int sizey = stopy-starty+1;
  • contrib/tbl/vipl/vipl_monadic.txx

    old new  
    99  const ImgIn &in = this->in_data();
    1010  ImgOut &out = this->out_data();
    1111
    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());
    1616  for (int j = starty; j < stopy; ++j)
    1717    for (int i = startx; i < stopx; ++i)
    1818      fsetpixel(out, i, j, func()(fgetpixel(in, i, j, DataIn(0))));
  • contrib/tbl/vipl/vipl_sobel.txx

    old new  
    99  const ImgIn &in = this->in_data(0);
    1010  ImgOut &out = this->out_data();
    1111  // 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());
    1616  for (int j = starty, ej =  stopy; j < ej  ; ++j)
    1717    for (int i = startx, ei = stopx; i < ei ; ++i)
    1818      fsetpixel(out, i, j, (DataOut)(
  • contrib/tbl/vipl/vipl_threshold.txx

    old new  
    99  const ImgIn &in = this->in_data();
    1010  ImgOut &out = this->out_data();
    1111
    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());
    1616  for (int j = starty; j < stopy; ++j)
    1717    for (int i = startx; i < stopx; ++i) {
    1818      DataIn p = fgetpixel(in, i, j, DataIn(0));
  • contrib/tbl/vipl/vipl_x_gradient.txx

    old new  
    99  const ImgIn &in = this->in_data(0);
    1010  ImgOut &out = *this->out_data_ptr();
    1111
    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());
    1616  for (register int j = starty; j < stopy; ++j)
    1717    for (register int i = startx+1; i < stopx; ++i) {
    1818      DataIn w = fgetpixel(in, i,  j, DataIn(0))
  • contrib/tbl/vipl/vipl_y_gradient.txx

    old new  
    99  const ImgIn &in = this->in_data(0);
    1010  ImgOut &out = *this->out_data_ptr();
    1111
    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());
    1616  for (register int j = starty+1; j < stopy; ++j)
    1717    for (register int i = startx; i < stopx; ++i) {
    1818      DataIn w = fgetpixel(in, i, j,   DataIn(0))