// sal's altered method public int [] apply_sobel(int [] src_1d, int width, int height, double sobscale, float offsetval) { int i_w = width; int i_h = height; d_w = width; d_h = height; dest_1d = new int[d_w * d_h]; for(int i=0;i<<16 | 0<<8 | 0; } //reached borders of image so goto next row //(see Convolution.java) if (((i+3)%i_w)==0) { dest_1d[i] = 0; dest_1d[i+1] = 0; dest_1d[i+2] = 0; i+=3; } } catch (ArrayIndexOutOfBoundsException e) { //if reached row boudary of image return. i = src_1d.length; } } return dest_1d; }