/***************************************************************************** * * * Priklad pocitani stereogramu / An example of rendering sterograms * * * *****************************************************************************/ /* TL Tomas Loun * inf96 lount@risc.upol.cz * http://www.inf.upol.cz/~lount */ #include #include #include #include #include #define PATSIZE 80 #define MAXX (640-PATSIZE) // je treba zmenit pri jinem video modu nez #define MAXY 480 // 640x480 (VGA) #define DEEP PATSIZE/3 // hloubka obrazku #define byte unsigned char #define pi 3.1415926536 const byte MYCOLORS[]={0,1,11,5,13}; int gd = VGA, gm = VGAHI; int x,y; char a; unsigned int COPYSIZE=0; void *data; byte GetLevel(int ax, int ay) { float x,y; y=(float(ay)-(MAXY/2))/(MAXX/2)*3; x=(float(ax)-(MAXX/2))/(MAXX/2)*3; x*=x; y*=y; return cos(pi*sqrt(x+y))*127+128; } byte GetLevel2(int ax,int ay) { int x,y; x=ax/2; y=ay/2+1; return(x*x+x*y+y*y)/y; } void DrawLevelPic() { for (int y=0; y