home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
Improvement Suggestions
Zoom : adding 'no aspect ratio change' in general settings
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="miljbee" data-source="post: 69165" data-attributes="member: 16213"><p>Let's have an example to illustrate how smartZoom would be computed :</p><p></p><p>movie size : 400x300 (<strong>mx=400, my=300</strong>)</p><p>screen size : 1920x1080 (<strong>sx=1920, sy=1080</strong>)</p><p></p><p></p><p></p><p>would you accept some aspect ratio modifications to display a picture ? </p><p>A:Yes, B:No, C:Yes but limited </p><p>if C, enter the max aspect ratio error you would accept : C%</p><p>(if A, C=100%, if B, C=0%) <strong>C=5%</strong></p><p></p><p>would you accept to lose (crop) a part of the picture ? </p><p>at the top and bottom of the screen ? </p><p>D: Yes, E: No, F:Yes but limited </p><p>if F, enter the % of the height you accept to lose : G % </p><p>(if D, G=100%, if E, G=0%) <strong>G=10%</strong></p><p></p><p>at the left and right of the screen ? </p><p>H: Yes, I: No, J : Yes but limited </p><p>if I, enter the % of the width you accept to lose : K % </p><p>(if H, K=100%, if I, K=0%) <strong>K=0%</strong></p><p>do you prefer aspect ratio modification or picture crop ?</p><p>AR : K, Crop : L <strong>L</strong></p><p></p><p><strong>Exemple: C=5%, G=10%, K=0%, L</strong></p><p></p><p>[code]if sx/sy<mx/my then</p><p> yZoomFactor = sy/my '3.6</p><p> xZoomFactor = yZoomFactor '3.6</p><p> if mx*xZoomFactor<sx then</p><p> if L then</p><p> yZoomFactor = sy*(1+G)/my '3.96</p><p> xZoomFactor = yZoomFactor '3.96</p><p> if mx*xZoomFactor<sx then</p><p> xZoomFactor = xZoomFactor*(1+C) '4,158</p><p> else</p><p> ...</p><p> end if</p><p> else</p><p> ...</p><p> end if</p><p> else</p><p> ...</p><p> end if</p><p>else</p><p> ...</p><p>end if[/code]</p><p></p><p>The result is </p><p>movie x Resized = 400 * 4,158 = <strong>1663</strong></p><p>movie y Resized = 300 * 3.96 = <strong>1188</strong></p><p>for information, aspect ratio ~= <strong>1,4</strong> ~= (4/3) * 1.05</p><p></p><p>The next step is to display the video centered on the screen ...</p><p></p><p></p><p>going further :</p><p></p><p>I know this sample code is too easy and not complete :</p><p>The method to recalculate xZoomFactor based on AR modification is wrong (the good one would have been a bit difficult to read)</p><p>This code ignores the AR Correction parametres defined in the screen calibration parameters</p><p>All the else are empty and some of them aren't easy to write</p></blockquote><p></p>
[QUOTE="miljbee, post: 69165, member: 16213"] Let's have an example to illustrate how smartZoom would be computed : movie size : 400x300 ([b]mx=400, my=300[/b]) screen size : 1920x1080 ([b]sx=1920, sy=1080[/b]) would you accept some aspect ratio modifications to display a picture ? A:Yes, B:No, C:Yes but limited if C, enter the max aspect ratio error you would accept : C% (if A, C=100%, if B, C=0%) [b]C=5%[/b] would you accept to lose (crop) a part of the picture ? at the top and bottom of the screen ? D: Yes, E: No, F:Yes but limited if F, enter the % of the height you accept to lose : G % (if D, G=100%, if E, G=0%) [b]G=10%[/b] at the left and right of the screen ? H: Yes, I: No, J : Yes but limited if I, enter the % of the width you accept to lose : K % (if H, K=100%, if I, K=0%) [b]K=0%[/b] do you prefer aspect ratio modification or picture crop ? AR : K, Crop : L [b]L[/b] [b]Exemple: C=5%, G=10%, K=0%, L[/b] [code]if sx/sy<mx/my then yZoomFactor = sy/my '3.6 xZoomFactor = yZoomFactor '3.6 if mx*xZoomFactor<sx then if L then yZoomFactor = sy*(1+G)/my '3.96 xZoomFactor = yZoomFactor '3.96 if mx*xZoomFactor<sx then xZoomFactor = xZoomFactor*(1+C) '4,158 else ... end if else ... end if else ... end if else ... end if[/code] The result is movie x Resized = 400 * 4,158 = [b]1663[/b] movie y Resized = 300 * 3.96 = [b]1188[/b] for information, aspect ratio ~= [b]1,4[/b] ~= (4/3) * 1.05 The next step is to display the video centered on the screen ... going further : I know this sample code is too easy and not complete : The method to recalculate xZoomFactor based on AR modification is wrong (the good one would have been a bit difficult to read) This code ignores the AR Correction parametres defined in the screen calibration parameters All the else are empty and some of them aren't easy to write [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Improvement Suggestions
Zoom : adding 'no aspect ratio change' in general settings
Contact us
RSS
Top
Bottom