Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(570630)

Delta Between Two Patch Sets: examples/analyzer.cc

Issue 1050: Add image panning to the analyzer.
Left Patch Set: Use proper scrollbars for panning. Created 4 years, 3 months ago
Right Patch Set: Rebase and fix default size. Created 4 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /*Daala video codec 1 /*Daala video codec
2 Copyright (c) 2002-2015 Daala project contributors. All rights reserved. 2 Copyright (c) 2002-2015 Daala project contributors. All rights reserved.
3 3
4 Redistribution and use in source and binary forms, with or without 4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met: 5 modification, are permitted provided that the following conditions are met:
6 6
7 - Redistributions of source code must retain the above copyright notice, this 7 - Redistributions of source code must retain the above copyright notice, this
8 list of conditions and the following disclaimer. 8 list of conditions and the following disclaimer.
9 9
10 - Redistributions in binary form must reproduce the above copyright notice, 10 - Redistributions in binary form must reproduce the above copyright notice,
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 OD_CR_MASK = 1 << 2, 305 OD_CR_MASK = 1 << 2,
306 OD_ALL_MASK = OD_LUMA_MASK | OD_CB_MASK | OD_CR_MASK 306 OD_ALL_MASK = OD_LUMA_MASK | OD_CB_MASK | OD_CR_MASK
307 }; 307 };
308 308
309 class TestPanel : public wxScrolledWindow { 309 class TestPanel : public wxScrolledWindow {
310 DECLARE_EVENT_TABLE() 310 DECLARE_EVENT_TABLE()
311 private: 311 private:
312 DaalaDecoder dd; 312 DaalaDecoder dd;
313 313
314 int zoom; 314 int zoom;
315 int offset_x;
316 int offset_y;
317 unsigned char *pixels; 315 unsigned char *pixels;
318 316
319 unsigned char *bsize; 317 unsigned char *bsize;
320 unsigned int bsize_len; 318 unsigned int bsize_len;
321 int bstride; 319 int bstride;
322 bool show_blocks; 320 bool show_blocks;
323 321
324 unsigned int *flags; 322 unsigned int *flags;
325 unsigned int flags_len; 323 unsigned int flags_len;
326 int fstride; 324 int fstride;
(...skipping 25 matching lines...) Expand all
352 int getBand(int x, int y) const; 350 int getBand(int x, int y) const;
353 void computeBitsPerPixel(); 351 void computeBitsPerPixel();
354 public: 352 public:
355 TestPanel(wxWindow *parent, const wxString &path); 353 TestPanel(wxWindow *parent, const wxString &path);
356 ~TestPanel(); 354 ~TestPanel();
357 355
358 bool open(const wxString &path); 356 bool open(const wxString &path);
359 void close(); 357 void close();
360 void render(); 358 void render();
361 bool nextFrame(); 359 bool nextFrame();
360 void refresh();
361 bool gotoFrame();
362 void restart(); 362 void restart();
363 363
364 int getZoom() const; 364 int getZoom() const;
365 bool setZoom(int zoom); 365 bool setZoom(int zoom);
366 int scrollUnit() const; 366 int scrollUnit() const;
367 367
368 void setShowBlocks(bool show_blocks); 368 void setShowBlocks(bool show_blocks);
369 void setShowSkip(bool show_skip); 369 void setShowSkip(bool show_skip);
370 void setShowNoRef(bool show_noref); 370 void setShowNoRef(bool show_noref);
371 void setShowPadding(bool show_padding); 371 void setShowPadding(bool show_padding);
372 void setShowBits(bool show_bits); 372 void setShowBits(bool show_bits);
373 void setShowDering(bool show_dering); 373 void setShowDering(bool show_dering);
374 void setShowPlane(bool show_plane, int mask); 374 void setShowPlane(bool show_plane, int mask);
375 375
376 bool hasPadding(); 376 bool hasPadding();
377 377
378 void onKeyDown(wxKeyEvent &event);
379 void onPaint(wxPaintEvent &event); 378 void onPaint(wxPaintEvent &event);
380 void onIdle(wxIdleEvent &event); 379 void onIdle(wxIdleEvent &event);
381 void onMouseMotion(wxMouseEvent &event); 380 void onMouseMotion(wxMouseEvent &event);
382 void onMouseLeaveWindow(wxMouseEvent &event); 381 void onMouseLeaveWindow(wxMouseEvent &event);
383 }; 382 };
384 383
385 BEGIN_EVENT_TABLE(TestPanel, wxPanel) 384 BEGIN_EVENT_TABLE(TestPanel, wxPanel)
386 EVT_KEY_DOWN(TestPanel::onKeyDown)
387 EVT_PAINT(TestPanel::onPaint) 385 EVT_PAINT(TestPanel::onPaint)
388 EVT_MOTION(TestPanel::onMouseMotion) 386 EVT_MOTION(TestPanel::onMouseMotion)
389 EVT_LEAVE_WINDOW(TestPanel::onMouseLeaveWindow) 387 EVT_LEAVE_WINDOW(TestPanel::onMouseLeaveWindow)
390 //EVT_IDLE(TestPanel::onIdle) 388 //EVT_IDLE(TestPanel::onIdle)
391 END_EVENT_TABLE() 389 END_EVENT_TABLE()
392 390
393 class TestFrame : public wxFrame { 391 class TestFrame : public wxFrame {
394 DECLARE_EVENT_TABLE() 392 DECLARE_EVENT_TABLE()
395 private: 393 private:
396 TestPanel *panel; 394 TestPanel *panel;
397 wxMenu *fileMenu; 395 wxMenu *fileMenu;
398 wxMenu *viewMenu; 396 wxMenu *viewMenu;
399 wxMenu *playbackMenu; 397 wxMenu *playbackMenu;
400 public: 398 public:
401 TestFrame(); 399 TestFrame();
402 400
403 void onOpen(wxCommandEvent &event); 401 void onOpen(wxCommandEvent &event);
404 void onClose(wxCommandEvent &event); 402 void onClose(wxCommandEvent &event);
405 void onQuit(wxCommandEvent &event); 403 void onQuit(wxCommandEvent &event);
406 void onZoomIn(wxCommandEvent &event); 404 void onZoomIn(wxCommandEvent &event);
407 void onZoomOut(wxCommandEvent &event); 405 void onZoomOut(wxCommandEvent &event);
408 void onFilter(wxCommandEvent &event); 406 void onFilter(wxCommandEvent &event);
409 void onPaddingChange(wxCommandEvent &event); 407 void onPaddingChange(wxCommandEvent &event);
410 void onBitsChange(wxCommandEvent &event); 408 void onBitsChange(wxCommandEvent &event);
411 void onYChange(wxCommandEvent &event); 409 void onYChange(wxCommandEvent &event);
412 void onUChange(wxCommandEvent &event); 410 void onUChange(wxCommandEvent &event);
413 void onVChange(wxCommandEvent &event); 411 void onVChange(wxCommandEvent &event);
414 void onNextFrame(wxCommandEvent &event); 412 void onNextFrame(wxCommandEvent &event);
413 void onGotoFrame(wxCommandEvent &event);
415 void onRestart(wxCommandEvent &event); 414 void onRestart(wxCommandEvent &event);
416 void onAbout(wxCommandEvent &event); 415 void onAbout(wxCommandEvent &event);
417 416
418 bool open(const wxString &path); 417 bool open(const wxString &path);
419 }; 418 };
420 419
421 enum { 420 enum {
422 wxID_SHOW_BLOCKS = 6000, 421 wxID_SHOW_BLOCKS = 6000,
423 wxID_SHOW_SKIP, 422 wxID_SHOW_SKIP,
424 wxID_SHOW_NOREF, 423 wxID_SHOW_NOREF,
425 wxID_SHOW_PADDING, 424 wxID_SHOW_PADDING,
426 wxID_SHOW_BITS, 425 wxID_SHOW_BITS,
427 wxID_SHOW_DERING, 426 wxID_SHOW_DERING,
428 wxID_SHOW_Y, 427 wxID_SHOW_Y,
429 wxID_SHOW_U, 428 wxID_SHOW_U,
430 wxID_SHOW_V, 429 wxID_SHOW_V,
431 wxID_NEXT_FRAME, 430 wxID_NEXT_FRAME,
431 wxID_GOTO_FRAME,
432 wxID_RESTART 432 wxID_RESTART
433 }; 433 };
434 434
435 BEGIN_EVENT_TABLE(TestFrame, wxFrame) 435 BEGIN_EVENT_TABLE(TestFrame, wxFrame)
436 EVT_MENU(wxID_OPEN, TestFrame::onOpen) 436 EVT_MENU(wxID_OPEN, TestFrame::onOpen)
437 EVT_MENU(wxID_CLOSE, TestFrame::onClose) 437 EVT_MENU(wxID_CLOSE, TestFrame::onClose)
438 EVT_MENU(wxID_EXIT, TestFrame::onQuit) 438 EVT_MENU(wxID_EXIT, TestFrame::onQuit)
439 EVT_MENU(wxID_ZOOM_IN, TestFrame::onZoomIn) 439 EVT_MENU(wxID_ZOOM_IN, TestFrame::onZoomIn)
440 EVT_MENU(wxID_ZOOM_OUT, TestFrame::onZoomOut) 440 EVT_MENU(wxID_ZOOM_OUT, TestFrame::onZoomOut)
441 EVT_MENU(wxID_SHOW_BLOCKS, TestFrame::onFilter) 441 EVT_MENU(wxID_SHOW_BLOCKS, TestFrame::onFilter)
442 EVT_MENU(wxID_SHOW_SKIP, TestFrame::onFilter) 442 EVT_MENU(wxID_SHOW_SKIP, TestFrame::onFilter)
443 EVT_MENU(wxID_SHOW_NOREF, TestFrame::onFilter) 443 EVT_MENU(wxID_SHOW_NOREF, TestFrame::onFilter)
444 EVT_MENU(wxID_SHOW_PADDING, TestFrame::onPaddingChange) 444 EVT_MENU(wxID_SHOW_PADDING, TestFrame::onPaddingChange)
445 EVT_MENU(wxID_SHOW_BITS, TestFrame::onBitsChange) 445 EVT_MENU(wxID_SHOW_BITS, TestFrame::onBitsChange)
446 EVT_MENU(wxID_SHOW_DERING, TestFrame::onFilter) 446 EVT_MENU(wxID_SHOW_DERING, TestFrame::onFilter)
447 EVT_MENU(wxID_SHOW_Y, TestFrame::onYChange) 447 EVT_MENU(wxID_SHOW_Y, TestFrame::onYChange)
448 EVT_MENU(wxID_SHOW_U, TestFrame::onUChange) 448 EVT_MENU(wxID_SHOW_U, TestFrame::onUChange)
449 EVT_MENU(wxID_SHOW_V, TestFrame::onVChange) 449 EVT_MENU(wxID_SHOW_V, TestFrame::onVChange)
450 EVT_MENU(wxID_NEXT_FRAME, TestFrame::onNextFrame) 450 EVT_MENU(wxID_NEXT_FRAME, TestFrame::onNextFrame)
451 EVT_MENU(wxID_GOTO_FRAME, TestFrame::onGotoFrame)
451 EVT_MENU(wxID_RESTART, TestFrame::onRestart) 452 EVT_MENU(wxID_RESTART, TestFrame::onRestart)
452 EVT_MENU(wxID_ABOUT, TestFrame::onAbout) 453 EVT_MENU(wxID_ABOUT, TestFrame::onAbout)
453 END_EVENT_TABLE() 454 END_EVENT_TABLE()
454 455
455 TestPanel::TestPanel(wxWindow *parent, const wxString &path) : wxScrolledWindow( parent), 456 TestPanel::TestPanel(wxWindow *parent, const wxString &path) : wxScrolledWindow( parent),
456 pixels(NULL), zoom(0), bsize(NULL), bsize_len(0), show_blocks(false), 457 pixels(NULL), zoom(0), bsize(NULL), bsize_len(0), show_blocks(false),
457 flags(NULL), flags_len(0), show_skip(false), show_noref(false), 458 flags(NULL), flags_len(0), show_skip(false), show_noref(false),
458 show_padding(false), show_dering(false), acct(NULL), show_bits(false), 459 show_padding(false), show_dering(false), acct(NULL), show_bits(false),
459 bpp_q3(NULL), dering(NULL), dering_len(0), plane_mask(OD_ALL_MASK), 460 bpp_q3(NULL), dering(NULL), dering_len(0), plane_mask(OD_ALL_MASK),
460 path(path), 461 path(path) {
461 offset_x(0),
462 offset_y(0) {
463 } 462 }
464 463
465 TestPanel::~TestPanel() { 464 TestPanel::~TestPanel() {
466 close(); 465 close();
467 } 466 }
468 467
469 bool TestPanel::open(const wxString &path) { 468 bool TestPanel::open(const wxString &path) {
470 if (!dd.open(path)) { 469 if (!dd.open(path)) {
471 return false; 470 return false;
472 } 471 }
473 SetSize(dd.getFrameWidth(), dd.getFrameHeight()); 472 SetSize(dd.getWidth(), dd.getHeight());
474 if (!setZoom(MIN_ZOOM)) { 473 if (!setZoom(MIN_ZOOM)) {
475 return false; 474 return false;
476 } 475 }
477 int nhsb = dd.getFrameWidth() >> OD_LOG_BSIZE0 + OD_NBSIZES - 1; 476 int nhsb = dd.getFrameWidth() >> OD_LOG_BSIZE0 + OD_NBSIZES - 1;
478 int nvsb = dd.getFrameHeight() >> OD_LOG_BSIZE0 + OD_NBSIZES - 1; 477 int nvsb = dd.getFrameHeight() >> OD_LOG_BSIZE0 + OD_NBSIZES - 1;
479 bsize_len = sizeof(*bsize)*nhsb*4*nvsb*4; 478 bsize_len = sizeof(*bsize)*nhsb*4*nvsb*4;
480 bsize = (unsigned char *)malloc(bsize_len); 479 bsize = (unsigned char *)malloc(bsize_len);
481 if (bsize == NULL) { 480 if (bsize == NULL) {
482 bsize_len = 0; 481 bsize_len = 0;
483 close(); 482 close();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 cbval = 255; 680 cbval = 255;
682 crval = 255 - (int64_t)(127*bpp); 681 crval = 255 - (int64_t)(127*bpp);
683 } 682 }
684 #endif 683 #endif
685 } 684 }
686 if (show_dering) { 685 if (show_dering) {
687 int sbx; 686 int sbx;
688 int sby; 687 int sby;
689 sbx = i >> OD_LOG_BSIZE0 + OD_NBSIZES - 1; 688 sbx = i >> OD_LOG_BSIZE0 + OD_NBSIZES - 1;
690 sby = j >> OD_LOG_BSIZE0 + OD_NBSIZES - 1; 689 sby = j >> OD_LOG_BSIZE0 + OD_NBSIZES - 1;
691 if (!dering[sby*nhsb + sbx]) { 690 if (dering[sby*nhsb + sbx]) {
692 yval = 0; 691 yval = 0;
693 } 692 }
694 } 693 }
695 if (show_blocks) { 694 if (show_blocks) {
696 unsigned char d = OD_BLOCK_SIZE4x4(bsize, bstride, i >> 2, j >> 2); 695 unsigned char d = OD_BLOCK_SIZE4x4(bsize, bstride, i >> 2, j >> 2);
697 int mask = (1 << d + OD_LOG_BSIZE0) - 1; 696 int mask = (1 << d + OD_LOG_BSIZE0) - 1;
698 if (!(i & mask) || !(j & mask)) { 697 if (!(i & mask) || !(j & mask)) {
699 yval = block_edge_luma(yval); 698 yval = block_edge_luma(yval);
700 cbval = (cbval + 128) >> 1; 699 cbval = (cbval + 128) >> 1;
701 crval = (crval + 128) >> 1; 700 crval = (crval + 128) >> 1;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 void TestPanel::setShowPlane(bool show_plane, int mask) { 809 void TestPanel::setShowPlane(bool show_plane, int mask) {
811 if (show_plane) { 810 if (show_plane) {
812 plane_mask |= mask; 811 plane_mask |= mask;
813 } else { 812 } else {
814 plane_mask &= ~mask; 813 plane_mask &= ~mask;
815 } 814 }
816 } 815 }
817 816
818 bool TestPanel::hasPadding() { 817 bool TestPanel::hasPadding() {
819 return dd.getFrameWidth() > dd.getWidth() || 818 return dd.getFrameWidth() > dd.getWidth() ||
820 dd.getFrameHeight() > dd.getHeight(); 819 dd.getFrameHeight() > dd.getHeight();
821 } 820 }
822 821
823 void TestPanel::setShowNoRef(bool show_noref) { 822 void TestPanel::setShowNoRef(bool show_noref) {
824 this->show_noref = show_noref; 823 this->show_noref = show_noref;
825 } 824 }
826 825
827 void TestPanel::computeBitsPerPixel() { 826 void TestPanel::computeBitsPerPixel() {
828 int i, j; 827 int i, j;
829 double bpp_total; 828 double bpp_total;
830 for (j = 0; j < dd.getFrameHeight(); j++) { 829 for (j = 0; j < dd.getFrameHeight(); j++) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 } 912 }
914 913
915 } 914 }
916 break; 915 break;
917 } 916 }
918 } 917 }
919 } 918 }
920 fprintf(stderr, "nb_syms = %i\n", acct->nb_syms); 919 fprintf(stderr, "nb_syms = %i\n", acct->nb_syms);
921 fprintf(stderr, "bpp_total = %lf\n", bpp_total); 920 fprintf(stderr, "bpp_total = %lf\n", bpp_total);
922 } 921 }
923 922 void TestPanel::refresh() {
923 computeBitsPerPixel();
924 render();
925 ((TestFrame *)GetParent())->SetTitle(path +
926 wxString::Format(wxT(" (%d,%d) Frame %d - Daala Stream Analyzer"),
927 dd.getWidth(), dd.getHeight(), dd.getRunningFrameCount()-1));
928 }
924 bool TestPanel::nextFrame() { 929 bool TestPanel::nextFrame() {
925 if (dd.step()) { 930 if (dd.step()) {
926 /* For now just compute the unfiltered bits per pixel. */ 931 /* For now just compute the unfiltered bits per pixel. */
927 computeBitsPerPixel(); 932 refresh();
928 render();
929 ((TestFrame *)GetParent())->SetTitle(path +
930 wxString::Format(wxT(" (%d,%d) Frame %d - Daala Stream Analyzer"),
931 dd.getWidth(), dd.getHeight(), dd.getRunningFrameCount()-1));
932 return true; 933 return true;
933 } 934 }
934 return false; 935 return false;
936 }
937
938 bool TestPanel::gotoFrame() {
939 bool toReturn;
940 int nframe;
941 wxTextEntryDialog dlg(this, _T("Jump to which frame?"));
942 dlg.SetTextValidator(wxFILTER_NUMERIC);
943 if (dlg.ShowModal() == wxID_OK) {
944 nframe = wxAtoi(dlg.GetValue());
945 }
946 else {
947 return false;
948 }
949 if (nframe < dd.frame) {
950 restart();
951 }
952 if(nframe <= 0) {
953 return true;
954 }
955 if(nframe == dd.frame+1) {
956 return nextFrame();
957 }
958 while (nframe >= dd.frame) {
959 toReturn = dd.step();
960 if (!toReturn) {
961 wxMessageBox(_T("Error: Video doesn't have that many frames"));
962 restart();
963 return false;
964 }
965 }
966 refresh();
967 return toReturn;
935 } 968 }
936 969
937 void TestPanel::restart() { 970 void TestPanel::restart() {
938 dd.restart(); 971 dd.restart();
939 dd.setBlockSizeBuffer(bsize, bsize_len); 972 dd.setBlockSizeBuffer(bsize, bsize_len);
940 dd.setBandFlagsBuffer(flags, flags_len); 973 dd.setBandFlagsBuffer(flags, flags_len);
941 dd.setAccountingEnabled(true); 974 dd.setAccountingEnabled(true);
942 dd.getAccountingStruct(&acct); 975 dd.getAccountingStruct(&acct);
943 dd.setDeringFlagsBuffer(dering, dering_len); 976 dd.setDeringFlagsBuffer(dering, dering_len);
944 nextFrame(); 977 nextFrame();
945 }
946
947 void TestPanel::onKeyDown(wxKeyEvent &event) {
948 int sx, sy;
949 GetViewStart(&sx, &sy);
950 switch (event.GetKeyCode()) {
951 case '.' : {
952 nextFrame();
953 Refresh(false);
954 break;
955 }
956 /* Catches 'r' and 'R' */
957 case 'R' : {
958 restart();
959 Refresh(false);
960 break;
961 }
962 case WXK_LEFT : {
963 Scroll(sx - 1, sy);
964 Refresh(false);
965 break;
966 }
967 case WXK_RIGHT : {
968 Scroll(sx + 1, sy);
969 Refresh(false);
970 break;
971 }
972 case WXK_UP : {
973 Scroll(sx, sy - 1);
974 Refresh(false);
975 break;
976 }
977 case WXK_DOWN : {
978 Scroll(sx, sy + 1);
979 Refresh(false);
980 break;
981 }
982 }
983 } 978 }
984 979
985 void TestPanel::onMouseMotion(wxMouseEvent& event) { 980 void TestPanel::onMouseMotion(wxMouseEvent& event) {
986 const wxPoint pt = wxGetMousePosition(); 981 const wxPoint pt = wxGetMousePosition();
987 int mouse_x = pt.x - this->GetScreenPosition().x; 982 int mouse_x = pt.x - this->GetScreenPosition().x;
988 int mouse_y = pt.y - this->GetScreenPosition().y; 983 int mouse_y = pt.y - this->GetScreenPosition().y;
989 TestFrame *parent = static_cast<TestFrame*>(GetParent()); 984 TestFrame *parent = static_cast<TestFrame*>(GetParent());
990 int sx, sy; 985 int sx, sy;
991 GetViewStart(&sx, &sy); 986 GetViewStart(&sx, &sy);
992 /* Offset row / col by scroll position. */ 987 /* Offset row / col by scroll position. */
(...skipping 13 matching lines...) Expand all
1006 parent->SetStatusText(wxString::Format(wxT("Y:%lld,U:%lld,V:%lld"), 1001 parent->SetStatusText(wxString::Format(wxT("Y:%lld,U:%lld,V:%lld"),
1007 y, cb, cr), 1); 1002 y, cb, cr), 1);
1008 } else { 1003 } else {
1009 parent->SetStatusText(wxString::Format(wxT("")), 1); 1004 parent->SetStatusText(wxString::Format(wxT("")), 1);
1010 } 1005 }
1011 parent->SetStatusText(wxString::Format(wxT("X:%d,Y:%d"), 1006 parent->SetStatusText(wxString::Format(wxT("X:%d,Y:%d"),
1012 col, row), 2); 1007 col, row), 2);
1013 } 1008 }
1014 1009
1015 void TestPanel::onMouseLeaveWindow(wxMouseEvent& event) { 1010 void TestPanel::onMouseLeaveWindow(wxMouseEvent& event) {
1016 TestFrame *parent = static_cast<TestFrame*>(GetParent()); 1011 TestFrame *parent = static_cast<TestFrame*>(GetParent());
1017 parent->SetStatusText(wxString::Format(wxT("")), 1); 1012 parent->SetStatusText(wxString::Format(wxT("")), 1);
1018 } 1013 }
1019 1014
1020 void TestPanel::onPaint(wxPaintEvent &) { 1015 void TestPanel::onPaint(wxPaintEvent &) {
1021 int sx, sy; 1016 int sx, sy;
1022 GetViewStart(&sx, &sy); 1017 GetViewStart(&sx, &sy);
1023 wxBitmap bmp(wxImage(getDisplayWidth(), getDisplayHeight(), pixels, true)); 1018 wxBitmap bmp(wxImage(getDisplayWidth(), getDisplayHeight(), pixels, true));
1024 wxBufferedPaintDC dc(this); 1019 wxBufferedPaintDC dc(this);
1025 dc.SetBackgroundMode(wxSOLID); 1020 dc.SetBackgroundMode(wxSOLID);
1026 dc.SetBackground(wxColor(0,0,0)); 1021 dc.SetBackground(wxColor(0,0,0));
1027 dc.Clear(); 1022 dc.Clear();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 _("Show U plane")); 1064 _("Show U plane"));
1070 viewMenu->AppendCheckItem(wxID_SHOW_V, _T("&V plane\tCtrl-V"), 1065 viewMenu->AppendCheckItem(wxID_SHOW_V, _T("&V plane\tCtrl-V"),
1071 _("Show V plane")); 1066 _("Show V plane"));
1072 mb->Append(viewMenu, _T("&View")); 1067 mb->Append(viewMenu, _T("&View"));
1073 1068
1074 playbackMenu = new wxMenu(); 1069 playbackMenu = new wxMenu();
1075 playbackMenu->Append(wxID_NEXT_FRAME, _T("Next frame\t."), 1070 playbackMenu->Append(wxID_NEXT_FRAME, _T("Next frame\t."),
1076 _("Go to next frame")); 1071 _("Go to next frame"));
1077 playbackMenu->Append(wxID_RESTART, _T("&Restart\tr"), 1072 playbackMenu->Append(wxID_RESTART, _T("&Restart\tr"),
1078 _("Set video to frame 0")); 1073 _("Set video to frame 0"));
1074 playbackMenu->Append(wxID_GOTO_FRAME, _T("Jump to Frame\tj"),
1075 _("Go to frame number"));
1079 mb->Append(playbackMenu, _T("&Playback")); 1076 mb->Append(playbackMenu, _T("&Playback"));
1080 1077
1081 wxMenu *helpMenu=new wxMenu(); 1078 wxMenu *helpMenu=new wxMenu();
1082 helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); 1079 helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog"));
1083 mb->Append(helpMenu, _T("&Help")); 1080 mb->Append(helpMenu, _T("&Help"));
1084 1081
1085 SetMenuBar(mb); 1082 SetMenuBar(mb);
1086 mb->EnableTop(1, false); 1083 mb->EnableTop(1, false);
1087 mb->EnableTop(2, false); 1084 mb->EnableTop(2, false);
1088 1085
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 1162
1166 void TestFrame::onVChange(wxCommandEvent &WXUNUSED(event)) { 1163 void TestFrame::onVChange(wxCommandEvent &WXUNUSED(event)) {
1167 panel->setShowPlane(GetMenuBar()->IsChecked(wxID_SHOW_V), OD_CR_MASK); 1164 panel->setShowPlane(GetMenuBar()->IsChecked(wxID_SHOW_V), OD_CR_MASK);
1168 Fit(); 1165 Fit();
1169 panel->render(); 1166 panel->render();
1170 panel->Refresh(); 1167 panel->Refresh();
1171 } 1168 }
1172 1169
1173 void TestFrame::onNextFrame(wxCommandEvent &WXUNUSED(event)) { 1170 void TestFrame::onNextFrame(wxCommandEvent &WXUNUSED(event)) {
1174 panel->nextFrame(); 1171 panel->nextFrame();
1172 panel->Refresh(false);
1173 }
1174
1175 void TestFrame::onGotoFrame(wxCommandEvent &WXUNUSED(event)) {
1176 panel->gotoFrame();
1175 panel->Refresh(false); 1177 panel->Refresh(false);
1176 } 1178 }
1177 1179
1178 void TestFrame::onRestart(wxCommandEvent &WXUNUSED(event)) { 1180 void TestFrame::onRestart(wxCommandEvent &WXUNUSED(event)) {
1179 panel->restart(); 1181 panel->restart();
1180 panel->Refresh(false); 1182 panel->Refresh(false);
1181 } 1183 }
1182 1184
1183 void TestFrame::onAbout(wxCommandEvent& WXUNUSED(event)) { 1185 void TestFrame::onAbout(wxCommandEvent& WXUNUSED(event)) {
1184 wxMessageBox(_T("This program is a bitstream analyzer for Daala."), _T("About" ), wxOK | wxICON_INFORMATION, this); 1186 wxMessageBox(_T("This program is a bitstream analyzer for Daala."), _T("About" ), wxOK | wxICON_INFORMATION, this);
(...skipping 28 matching lines...) Expand all
1213 bool TestApp::OnInit() { 1215 bool TestApp::OnInit() {
1214 frame = new TestFrame(); 1216 frame = new TestFrame();
1215 frame->Show(); 1217 frame->Show();
1216 if (argc >= 2) { 1218 if (argc >= 2) {
1217 return frame->open(wxString(argv[1])); 1219 return frame->open(wxString(argv[1]));
1218 } 1220 }
1219 return true; 1221 return true;
1220 } 1222 }
1221 1223
1222 IMPLEMENT_APP(TestApp) 1224 IMPLEMENT_APP(TestApp)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

RSS Feeds Recent Issues | This issue
This is Rietveld