int main() { startGraphics(); mainMenu(); endGraphics(); return 0; }
int main(int argc, char *argv[]) { Image<byte> I; Image<float> Vx, Vy; if (!load(I, argc > 1 ? argv[1] : srcPath("salon.png"))) { cout << "Echec de lecture d'image" << endl; return 1; } openWindow(I.width(), I.height()); display(I); click(); cout << "Contraste simple" << endl; affiche(I); gradient(I, Vx, Vy); click(); cout << "Dérivée selon x par la fonction gradient" <<endl; affiche(Vx); click(); cout << "Dérivée selon y par la fonction gradient" <<endl; affiche(Vy); click(); Image<float> F = dx(I); cout << "Dérivée selon x par la fonction dx" <<endl; affiche(F); click(); Image<float> U= dy(I); cout << "Dérivée selon y par la fonction dy" <<endl; affiche(U); click(); masque(I,F,U); Image<float> z = poisson(F,U); cout << "Image reconstruite par poisson" <<endl; affiche(z); endGraphics(); return 0; }
void ClientRenderModule::run() { Uint32 start,stop,interval; // printf("ClientRenderModule started\n"); if ( client_data->has_GUI ) initGraphics(); while ( client_data->state != GONE ) { if ( client_data->has_GUI ) { /* render frame */ start = SDL_GetTicks(); renderSingleFrame(); /* handle user actions */ if ( w.checkMessages() ) { client_data->state = WAITING_LEAVE; break; } /* limit frames per second */ stop = SDL_GetTicks(); interval = stop - start; if ( interval < RENDER_DELAY ) SDL_Delay( RENDER_DELAY - interval ); /* compute frames per second average */ interval = SDL_GetTicks() - start; frame_render_interval = interval * ( 1 - client_data->fps_average_param ) + frame_render_interval * client_data->fps_average_param; } else SDL_Delay(RENDER_DELAY); } /* wait for client to reach GONE state */ SDL_LockMutex(client_data->term_mutex); while ( client_data->state != GONE ) SDL_CondWait(client_data->term_cond, client_data->term_mutex); SDL_UnlockMutex(client_data->term_mutex); if ( client_data->has_GUI ) endGraphics(); }