MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / scale_size

Method scale_size

src/Clip.cpp:1429–1447  ·  view source on GitHub ↗

Scale a source size to a target size (given a specific scale-type)

Source from the content-addressed store, hash-verified

1427
1428// Scale a source size to a target size (given a specific scale-type)
1429QSize Clip::scale_size(QSize source_size, ScaleType source_scale, int target_width, int target_height) {
1430 switch (source_scale)
1431 {
1432 case (SCALE_FIT): {
1433 source_size.scale(target_width, target_height, Qt::KeepAspectRatio);
1434 break;
1435 }
1436 case (SCALE_STRETCH): {
1437 source_size.scale(target_width, target_height, Qt::IgnoreAspectRatio);
1438 break;
1439 }
1440 case (SCALE_CROP): {
1441 source_size.scale(target_width, target_height, Qt::KeepAspectRatioByExpanding);;
1442 break;
1443 }
1444 }
1445
1446 return source_size;
1447}
1448
1449// Get QTransform from keyframes
1450QTransform Clip::get_transform(std::shared_ptr<Frame> frame, int width, int height)

Callers

nothing calls this directly

Calls 1

scaleMethod · 0.80

Tested by

no test coverage detected