#include #include"hensu.h" void gradient(LPDWORD image_in,LPDWORD image_out,double amp,int ope) { int cx[9],cy[9]; switch(ope){ case 1: cx[0]= 0; cx[1]= 0; cx[2]= 0; cx[3]= 0; cx[4]= 1; cx[5]=-1; cx[6]= 0; cx[7]= 0; cx[8]= 0; cy[0]= 0; cy[1]= 0; cy[2]= 0; cy[3]= 0; cy[4]= 1; cy[5]= 0; cy[6]= 0; cy[7]=-1; cy[8]= 0; break; case 2: cx[0]= 0; cx[1]= 0; cx[2]= 0; cx[3]= 0; cx[4]= 1; cx[5]= 0; cx[6]= 0; cx[7]= 0; cx[8]=-1; cy[0]= 0; cy[1]= 0; cy[2]= 0; cy[3]= 0; cy[4]= 0; cy[5]= 1; cy[6]= 0; cy[7]=-1; cy[8]= 0; break; default: cx[0]=-1; cx[1]= 0; cx[2]= 1; cx[3]=-2; cx[4]= 0; cx[5]= 2; cx[6]=-1; cx[7]= 0; cx[8]= 1; cy[0]=-1; cy[1]=-2; cy[2]=-1; cy[3]= 0; cy[4]= 0; cy[5]= 1; cy[6]= 1; cy[7]= 2; cy[8]= 1; break; } int d[9]; int i,j,dat; double xx,yy,zz; for(j=1;j255) dat=255; image_out[i+j*iWidth]=RGB(dat,dat,dat); } } void laplacian(LPDWORD image_in,LPDWORD image_out,double amp,int ope) { int c[9]; switch(ope){ case 1: c[0]= 0; c[1]=-1; c[2]= 0; c[3]=-1; c[4]= 4; c[5]=-1; c[6]= 0; c[7]=-1; c[8]= 0; break; case 2: c[0]=-1; c[1]=-1; c[2]=-1; c[3]=-1; c[4]= 8; c[5]=-1; c[6]=-1; c[7]=-1; c[8]=-1; break; default: c[0]= 1; c[1]=-2; c[2]= 1; c[3]=-2; c[4]= 4; c[5]=-2; c[6]= 1; c[7]=-2; c[8]= 1; break; } int d[9]; int i,j,dat; double z,zz; for(j=1;j255) dat=255; image_out[i+j*iWidth]=RGB(dat,dat,dat); } } void mytemplate(LPDWORD image_in,LPDWORD image_out,double amp) { int d[9]; int i,j,k,max,dat; int m[8]; double zz; for(j=1;j255) dat=255; image_out[i+j*iWidth]=RGB(dat,dat,dat); } }