8 #include "bezierauto.inc"
10 #include "mwindow.inc"
13 // how to draw a bezier curve
15 // x(t)=(1-t)^3*x0+3*t*(1-t)^2*x1+3*t^2*(1-t)*x2+t^3*x3
16 // y(t)=(1-t)^3*y0+3*t*(1-t)^2*y1+3*t^2*(1-t)*y2+t^3*y3
19 // (x1, y1) (x3, y3) control points
20 // (x0, y0) (x2, y2) end points
22 class BezierAutos
: public Autos
33 float virtual_w
= 160,
34 float virtual_h
= 160);
38 int paste_derived(FileXML
*xml
, int64_t start
);
40 int draw(BC_SubWindow
*canvas
,
43 float units_per_pixel
,
47 int get_center(float &x
,
55 int draw_floating_autos(BC_SubWindow
*canvas
,
58 float units_per_pixel
,
63 int select_auto(BC_SubWindow
*canvas
,
66 float units_per_pixel
,
75 int move_auto(BC_SubWindow
*canvas
,
78 float units_per_pixel
,
85 int release_auto_derived();
86 int scale_video(float scale
, int *offsets
);
89 Auto
* add_auto(int64_t frame
, float x
, float y
, float z
);
91 int get_frame_half(float scale
, int vertical
, float units_per_pixel
);
92 // Get the pixel on the track display of the center of an auto
93 int get_auto_pixel(int64_t position
, float view_start
, float units_per_pixel
, int frame_half
);
94 // Get the frame on the track of the cursor pixel
95 int64_t get_auto_frame(int position
, float view_start
, float units_per_pixel
, int vertical
);
97 // need frame dimensions here so same auto can be camera or projector
98 float frame_w
, frame_h
;
99 float virtual_center_x
, virtual_center_y
;
101 float center_x
, center_y
, center_z
; // default values
102 BezierAuto
*old_selected
, *new_selected
;
110 // 5 - control_out_xy
111 // 6 - control_in_zoom
112 // 7 - control_out_zoom
118 int get_virtual_center(float &x
, float &y
, int cursor_x
, int cursor_y
, int vertical
, float scale
);
119 // don't draw the new auto position
120 int swap_out_selected();
121 int swap_in_selected();