Advertisement
wandrake

Untitled

Nov 14th, 2014
433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. for (int k = 1; k < 100; ++k) {
  2.     for (int i = 0; i < __rows; ++i) {
  3.         for (int j = 0; j < __cols; ++j) {
  4.             for (int c = 0; c < 3; ++c) {
  5.                 float res = 0;
  6.                 for (int ii = std::max(-__masksize/2, -i); ii <= std::min((__rows - i) - 1, __masksize/2); ++ii) {
  7.                     for (int jj = std::max(-__masksize/2, -j); jj <= std::min((__cols - j) - 1, __masksize/2); ++jj) {
  8.                         res += __img_data[0][(((i+ii) * __cols ) + j+jj) * imL.chans + c];
  9.                     }
  10.                 }
  11.                 res /= __masksize*__masksize;
  12.  
  13.                 __img_data[1][((i * __cols ) + j) * imL.chans + c] = res;
  14.             }
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement