On LetterBox make a Pillarbox if aspect ratio is equal

If background video and Vocaluxe have the same aspect ratio, switching to aspect ratio LetterBox would do a Pillarbox, so you can add 4:3 borders, if a video file has the wrong aspect ratio (maybe SAR value at 16:9, but a DAR value at 4:3). Without this change, LetterBox would do exactly the same as Crop in this special case.
This commit is contained in:
Stefan authored and GitHub committed 2020-01-12 21:32:36 +01:00
1 parent 0d56cc4faf
commit 94aa28112d
1 file changed
+8 -2
+8 -2
View File
@@ -1,4 +1,4 @@
#region license #region license
// This file is part of Vocaluxe. // This file is part of Vocaluxe.
// //
// Vocaluxe is free software: you can redistribute it and/or modify // Vocaluxe is free software: you can redistribute it and/or modify
@@ -101,6 +101,7 @@ namespace VocaluxeLib
switch (aspect) switch (aspect)
{ {
case EAspect.Automatic:
case EAspect.Crop: case EAspect.Crop:
if (boundsAspectRatio >= aspectRatio) if (boundsAspectRatio >= aspectRatio)
{ {
@@ -138,7 +139,12 @@ namespace VocaluxeLib
} }
break; break;
case EAspect.LetterBox: case EAspect.LetterBox:
if (boundsAspectRatio <= aspectRatio) if (boundsAspectRatio == aspectRatio) // Pillarbox
{
scaledWidth = bounds.W * 0.77f;
scaledHeight = bounds.W / aspectRatio;
}
else if (boundsAspectRatio < aspectRatio)
{ {
scaledWidth = bounds.W; scaledWidth = bounds.W;
scaledHeight = bounds.W / aspectRatio; scaledHeight = bounds.W / aspectRatio;