#include #include #include #include const int h=1080; const int w=1920; const int f=3600; const int t=12; void update(unsigned char* _p1,unsigned char* _p2,int* rng){ int a=0; for(int i=-1;i<2;i++){ if(*(_p1-w+i)==255){ a++; } if(*(_p1+w+i)==255){ a++; } if(*(_p1+i)==255&&i!=0){ a++; } } if((*rng)/(a+1)==0){ *rng=((double)rand()/RAND_MAX)*100000; if(*_p1==255){ *_p2=0; }else{ *_p2=255; } return; } *rng-=1; if(*_p1==0&&a==3){ *_p2=255; return; } if(*_p1==255&&a<2){ *_p2=0; return; } if(*_p1==255&&a>3){ *_p2=0; return; } if(*_p1==255){ *_p2=255; return; } } struct update_struct{ int low; int high; int fra; int* rng; unsigned char* new; unsigned char* mai; unsigned char* frame; }; void* update_thread(void* _i){ struct update_struct _p = *(struct update_struct*)_i; for(int he=_p.low;he<_p.high;he++){ for(int wi=0;wi