diff --git a/Makefile b/Makefile index d44628a..09a49a6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SRC=t0.c image.c +SRC=main.c image.c OUT=tmp # Configs diff --git a/t0.c b/main.c similarity index 73% rename from t0.c rename to main.c index e202cec..81d2f78 100644 --- a/t0.c +++ b/main.c @@ -40,16 +40,17 @@ /*- Program context: -------------------------------------------------*/ static Image* cur_img; +static Image* orig_img; +static Image* myeffect_img; static Image* old_img; static Image* sobel_img; static Image* high_img; -static int img_idx; static Ihandle *canvas; /* canvas handle */ static Ihandle *msgbar; /* message bar handle */ static int width=640,height=480; /* width and height of the canvas */ -#define ARRAY_SZ(x) sizeof(x)/sizeof(*x) +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*x)) Image *do_highlight(Image *orig, Image *sobel, float threshold) { int x,y; @@ -73,6 +74,52 @@ Image *do_highlight(Image *orig, Image *sobel, float threshold) return high; } +Image *do_myeffect(Image *orig) +{ + int x,y,z; + Image *high; + high = imgCopy(orig); + int remap[][2] = { + {-1, -1}, { 0, -1}, { 1, -1}, + {-1, 0}, { 0, 0}, { 1, 0}, + {-1, 1}, { 0, 1}, { 1, 1}, + }; + + for(y=1; y