Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for( i = 1, rows-1) {
- for( j = 1, cols-1) {
- int p1, p2, p3, p4, p5, p6, t;
- p1 = imageIn[( i-1) *303 + j-1];
- p2 = imageIn[( i-1) *303 + j];
- p3 = imageIn[i*303 + j-1];
- p4 = imageIn[i*303 + j+1];
- p5 = imageIn[( i+1) *303 + j];
- p6 = imageIn[( i+1) *303 + j+1];
- t = 128 + p4 + p5 + p6 - p1 - p2 - p3;
- // clip
- if( t < 0) {
- t = 0;
- }
- if( t > 255) {
- t = 255;
- }
- imageOut[i*303 + j] = t;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement