void GUI::rotating(Controller &controller, bool sens) { if ( ! controller.image_file_loaded ) { return ; } if (! sens) { rotate_90_left(controller.current_image_to_process, controller.current_image_to_process) ; } else { rotate_90_right(controller.current_image_to_process, controller.current_image_to_process) ; } // We register current frame in vector<cv::Mat> for undo-redo. controller.process_after_applying() ; controller.get_current_image_position() ; // It convert current_image_to_process as src to RGB(A) in dst current_image_to_display. set_img(controller.current_image_to_process, controller.current_image_to_display, controller) ; // It auto process conversion to RGB(A). set_label_size_value(controller.source_image_size.first, controller.source_image_size.second) ; // Reset some variables. after_applying_reset_settings(controller) ; }
int main(void) { char c; init_robot(); fflush(stdin); printf("Usage: %c to exit, %c to move forward, %c to move backward, %c to rotate to left, %c to rotate to right!\n\n", EXIT_S, MF_S, MB_S, RL_S, RR_S); print_world(); scanf("%c", &c); while(c != EXIT_S) { switch(c) { case MF_S: move_robot(MOVE_FWD); print_world(); break; case MB_S: move_robot(MOVE_BWD); print_world(); break; case RL_S: rotate_90_left(); print_world(); break; case RR_S: rotate_90_right(); print_world(); break; } scanf("%c", &c); } return 0; }