Commit 48214db1 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig

reduced scope of variables

parent c1100464
......@@ -36,48 +36,24 @@ pix_emboss :: ~pix_emboss()
/////////////////////////////////////////////////////////
void pix_emboss :: processYUVImage(imageStruct &image)
{
long r,c,width, height,src,h,w;
width = image.xsize-1;
height = image.ysize-1;
w = image.xsize*2;
h = image.ysize*2;
src =1;
// src=w;
for (r=0; r < height; r++) {
for (c=0; c < width; c++) {
image.data[src] = ( image.data[ src-w-2 ] -
image.data[ src-w ] -
image.data[ src-w+2 ] +
image.data[ src -2 ] -
image.data[src] -
image.data[src + 2] -
image.data[src+w-2] -
image.data[src+w] -
image.data[src+w+2] )/4;
int width = image.xsize-1;
int height = image.ysize-1;
int w = image.xsize*2;
int src = 1;
for (int r=0; r < height; r++) {
for (int c=0; c < width; c++) {
image.data[src] = ( image.data[src-w-2 ] -
image.data[src-w ] -
image.data[src-w+2 ] +
image.data[src - 2 ] -
image.data[src ] -
image.data[src + 2 ] -
image.data[src+w-2 ] -
image.data[src+w ] -
image.data[src+w+2 ] )/4;
src+=2;
}
}
/*
for (r=0; r < (width*height); r+= width) {
for (c=0; c < width; c++) {
image.data[src+1] =(image.data[ r-1 + c-2 ] -
image.data[ r-1 + c ] -
image.data[ r-1 + c+2 ]+
image.data[ r+c -2 ] +
image.data[r+c] -
image.data[r+c+2] -
image.data[r+1+c-2] -
image.data[r+1+c] -
image.data[r+1+c+2]
)/9;
src+=2;
}
}*/
//post("chars:%d",src);
//post("r:%d",r);
//post("c:%d",c);
}
/////////////////////////////////////////////////////////
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment