camera_viewer::camera_viewer(QWidget *parent) : QMainWindow(parent)
{
    setupUi(this);
    cap_ = new cv::VideoCapture(0);
    QTimer *timer = new QTimer(this);
    connect(timer, SIGNAL(timeout()), this, SLOT(image_update()));
    timer->start(33);
    
    connect(action_Load, SIGNAL(hovered()), this, SLOT(image_update()));
}
Beispiel #2
0
void press_btnA()
{
  switch(work)
  {
    case MAIN_MENU:into_menu(); break;
    case BOOK_MENU:{
                     strcpy(book_name, "book/");
                     strcat(book_name, file_list[file_list_point]);
                     into_book(book_name, 0);
                     break;
                   }
    case BOOK_CONFIG:if(!in_pallet)
                     {
                       switch(book_config_point)
                       {
                         case 0: case 1:{
                                          draw_book_config_point(book_config_point, 255, 255, 255);
                                          show_pallet(book_config_point);
                                          break;
                                        }
                         case 4:{
                                  txtbr = temp_r[0];
                                  txtbg = temp_g[0];
                                  txtbb = temp_b[0];
                                  txtfr = temp_r[1];
                                  txtfg = temp_g[1];
                                  txtfb = temp_b[1];
                                  txtdot = temp_dot;
                                  if(txt_offset_changed)
                                  {
                                    txt_now_offset = txt_max_offset * temp_offset_rate / 100;
                                    if(txt_now_offset >= txt_max_offset)
                                      txt_now_offset -= 20;
                                    check_txt_offset();
                                  }
                                }
                         case 5:exit_book_config(); break;
                       }
                     }
                     else if(temp_point == 3)
                     {
                       myGLCD.setColor(temp_r[book_config_point], temp_g[book_config_point], temp_b[book_config_point]);
                       myGLCD.fillRect(146, 2 + 66 * book_config_point, 209, 2 + 66 * book_config_point + 63);
                       in_pallet = false;
                       draw_book_config_point(book_config_point, 255, 0, 0);
                     }
                     break;
    case MUSIC_MENU:{
                      strcpy(music_name, file_list[file_list_point]);
                      into_music(music_name);
                      break;
                    }
    case MUSIC_PLAY: stop_music(); break;
    case IMAGE_MENU:{
                      strcpy(image_name, "image/");
                      strcat(image_name, file_list[file_list_point]);
                      into_image(image_name);
                      break;
                    }
    case IMAGE_SHOW:switch(image_point)
                    {
                      case 3: image_update(); break;
                      case 4: image_left_spin(); break;
                      case 5: image_right_spin(); break;
                      case 6: image_next(-1); break;
                      case 7: image_next(1); break;
                    }
                    break;
    case GAME_MENU: {
                      strcpy(game_name, "game/");
                      strcat(game_name, file_list[file_list_point]);
                      into_game(game_name);
                      break;
                    }
    case GAME_START:switch(game_menu_point)
                    {
                      case 0: game_start(); break;
                      case 1: show_game_save(); break;
                      case 2: show_game_help(); break;
                      case 3: exit_game(); break;
                    }
                    break;
    case GAME_CLEAR:if(game_clear_point == 0)
                      clear_cancel();
                    else
                      clear_save();
                    break;
    case FILE_MENU: file_into(); break;
    case FILE_DELETE: if(file_delete_point == 0)
                        file_no_delete();
                      else
                        file_yes_delete();
                      break;
    case ABOUT_MENU:if(about_menu_point == 0)
                      into_help();
                    else
                      into_ap();
                    break;
    case ABOUT_HELP:show_help(about_help_point); break;
  }
}