:: [Frei0r] How should double be inter…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Janne Liljeblad
Date:  
À: Minimalistic plugin API for video effects
Sujet: [Frei0r] How should double be interpreted as screen positions?
Hi Dan, Salsaman


I'm changing my cairo plugins geometry parameters from parsed strings
to F0R_PARAM_DOUBLE parameters.

The problem is that giving positions in doubles with forced range 0-1
is not optimal here. When compositing images the source image very
possibly needs to be animated into the frame from up/down/left/right
directions. Furthermore, image may need to be rotated before animating
it into the frame, so having range providing for having image just out
the frame is not enough.

Using the F0R_PARAM_POSITION does not help at all, as it is also
specified to be range 0 - 1 instead of pixel values.

Because all of this I'm going to interpret F0R_PARAM_DOUBLE values for
x and y positions for source image as follows:

0 = top/left 2 frame widths left/up
0.25 = top/left 1 frame width left/up
0.5 = top/left aligned with dest image
0.75 = top/left just out of dest image bottom/right corner
1.0 = top/left 1 frame width down/right

The reason for different ranges for top/left and down/right is that
rotation is done around top left corner.

I'm going to add function to frei0r_cairo.h to do this. Please contact
me immediately if you have any objections to this, as I would like to
get this done and move on.


Regards,
Janne