Пример #1
0
// Set the query and result image pointers.
void FeaturesUI::set_images ( IplImage * queryImage, IplImage * resultImage )
{
  int w1 = queryImage ? queryImage->width : 0;
  int w2 = resultImage ? resultImage->width : 0;
  int h1 = queryImage ? queryImage->height : 0;
  int h2 = resultImage ? resultImage->height : 0;
  int h = MAX ( h1, h2 );

  resize_windows ( w1, w2, h );
  queryView->setImage ( queryImage );
  resultView->setImage ( resultImage );
}
Пример #2
0
void
curses_loop()
{
	int key, w_height, w_width;

	notimeout(main_win, true);

	for (;;) {
		getmaxyx(status_win, w_height, w_width);
		mvwprintw(status_win, w_height - 2 , 1, "p - play, s - stop, q - quit");
		wrefresh(status_win);

		key = wgetch(main_win);
		switch (key) {
		case KEY_UP:
			break;
		case 10:	// 10 == ENTER
		case 'p':
			key_enter();
			break;
		case ' ':
			mvwprintw(status_win, 1, 5, "CMD: PAUSE");
			send_pause_command(sock_fd);
			break;
		case 'q':
			mvwprintw(status_win, 1, 5, "CMD: QUIT ");
			send_quit_command(sock_fd);
			wrefresh(status_win);
			return;
		case 's':
			mvwprintw(status_win, 1, 5, "CMD: STOP ");
			send_stop_command(sock_fd);
			break;
		case 68:
			mvwprintw(status_win, 1, 5, "CMD: REV  ");
			send_rev_command(sock_fd);
			break;
		case 67:
			mvwprintw(status_win, 1, 5, "CMD: FF   ");
			send_ff_command(sock_fd);
			break;
		case 66:
			// DOWN - scroll files
			key_down();
			break;
		case 65:
			// UP - scroll files
			key_up();
			break;
		//case 410:
		case KEY_RESIZE:
			resize_windows();
			break;
		default:
			mvwprintw(status_win, 10, 1, "pressed:");
			mvwprintw(status_win, 11, 1, "%3d as '%c'", key, key);
			break;
		}
		wrefresh(status_win);
	}
}