Ticket #9035: patch.diff

File patch.diff, 1.7 KB (added by ligverd@…, 10 years ago)

Add new mode Horizontal Zoom

  • videoouttypes.h

    old new  
    5656    kAdjustFill_Half,
    5757    kAdjustFill_Full,
    5858    kAdjustFill_HorizontalStretch,
    59     kAdjustFill_VerticalStretch,
     59    kAdjustFill_VerticalStretch,    kAdjustFill_HorizontalZoom,
    6060    kAdjustFill_END,
    6161    kAdjustFill_AutoDetect_DefaultOff,
    6262    kAdjustFill_AutoDetect_DefaultHalf,
     
    250250        case kAdjustFill_HorizontalStretch:
    251251            ret = QObject::tr("H.Stretch"); break;
    252252        case kAdjustFill_VerticalStretch:
    253             ret = QObject::tr("V.Stretch"); break;
     253            ret = QObject::tr("V.Stretch"); break;        case kAdjustFill_HorizontalZoom: ret = QObject::tr("H.Zoom"); break;
    254254        case kAdjustFill_Toggle:
    255255        case kAdjustFill_Off:
    256256        case kAdjustFill_END: break;
  • videooutwindow.cpp

    old new  
    403403
    404404        display_video_rect.setHeight(display_video_rect.height() * 4 / 3);
    405405    }
     406    else if (adjustfill == kAdjustFill_HorizontalZoom && (video_aspect < disp_aspect)) //video_aspect < display_aspect
     407    {
     408        float k = (video_aspect * 2) / (disp_aspect - video_aspect);
     409
     410        display_video_rect = QRect(
     411            display_video_rect.left() - (display_video_rect.width() / k) ,
     412            display_video_rect.top() -  (display_video_rect.height()/ k) ,
     413            display_video_rect.width()  * disp_aspect / video_aspect,
     414            display_video_rect.height() * disp_aspect / video_aspect);
     415    }
    406416}
    407417
    408418/** \fn VideoOutWindow::ApplySnapToVideoRect(void)