gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Video scaling and rotation (matrix transform)


From: strk
Subject: [Gnash-dev] Video scaling and rotation (matrix transform)
Date: Mon, 4 Jun 2007 20:19:06 +0200

I went crawling in my archives to get this mail out since
I added scaling and rotation to the "video" instance in our
NetStream-SquareTest.swf testcase.

Please take a look at that test. Does it make our drawVideoFrame()
method signature bogus now ?

--strk;

Both AGG and OpenGL (the only ones I tested) fail.
The test is visual, not automated yet.

On Tue, Apr 17, 2007 at 02:15:53PM +0200, Udo Giacomozzi wrote:
> Hello strk,
> 
> Tuesday, April 17, 2007, 1:55:38 PM, you wrote:
> >> The video is streched (*apparently* regardless of aspect ratio!) to
> >> that size, so no crop is necessary.
> 
> s> If this is the case I agree with you, it is completely unecessarly to have
> s> that argument, as the scale can be concatenated with the matrix parameter, 
> right ?
> 
> No, there are *two* scales: one for the video container (I called it
> "video instance"), and one for the video itself.
> 
> Example:
> 
> You have a SWF with a 320x240 pixel (6400x4800 TWIPS) video
> *container* that loads a video (FLV) which is sized 160x120. This
> means that the renderer has to double the video frames (in size),
> however the matrix is still an "identity".
> 
> Now say the video *container* is scaled by 150% using _xscale/_yscale
> in ActionScript. Now the matrix will have it's scale fields to 1.5 but
> the video needs to be scaled by 300%.
> 
> You need
> 
> - the untransformed bounds to know the *outline* of the video
>   *container*
>   
> - the matrix to:
>   - move, scale and rotate that outline (applied to "bounds")
>   - move, scale and rotate the video (matrix is changed before being
>     applied)
>     
> - the frame size of the video itself so that it can be streched to the
>   container outline
> 
> When you concatenate the video-to-container scale to the matrix you
> will also scale the container, which is not what you want.
> 
> Think like the FLV video is a child of the container.
> 
> So the information contained in "bounds" *is* important, but it's
> overkill to use Range2d for that since minX and minY will *always* be
> zero and Range2d instance does nothing but carrying two "double"
> values.
> 
> Udo
>   
> 
> 
> 
> _______________________________________________
> Gnash-commit mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-commit

-- 

 ()   ASCII Ribbon Campaign
 /\   Keep it simple! 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]