r1008: pt_BR translation update
[cinelerra_cv/mob.git] / plugins / scale / scale.h
blobe59690dd43b0bbec2a89ba3eca2fe7dedc81111f
1 #ifndef SCALE_H
2 #define SCALE_H
4 // the simplest plugin possible
6 class ScaleMain;
7 class ScaleWidth;
8 class ScaleHeight;
9 class ScaleConstrain;
10 class ScaleThread;
11 class ScaleWin;
13 #include "bchash.h"
14 #include "guicast.h"
15 #include "mutex.h"
16 #include "scalewin.h"
17 #include "overlayframe.h"
18 #include "pluginvclient.h"
20 class ScaleConfig
22 public:
23 ScaleConfig();
25 void copy_from(ScaleConfig &src);
26 int equivalent(ScaleConfig &src);
27 void interpolate(ScaleConfig &prev,
28 ScaleConfig &next,
29 int64_t prev_frame,
30 int64_t next_frame,
31 int64_t current_frame);
33 float w, h;
34 int constrain;
38 class ScaleWidth : public BC_TumbleTextBox
40 public:
41 ScaleWidth(ScaleWin *win, ScaleMain *client, int x, int y);
42 ~ScaleWidth();
43 int handle_event();
45 ScaleMain *client;
46 ScaleWin *win;
49 class ScaleHeight : public BC_TumbleTextBox
51 public:
52 ScaleHeight(ScaleWin *win, ScaleMain *client, int x, int y);
53 ~ScaleHeight();
54 int handle_event();
56 ScaleMain *client;
57 ScaleWin *win;
60 class ScaleConstrain : public BC_CheckBox
62 public:
63 ScaleConstrain(ScaleMain *client, int x, int y);
64 ~ScaleConstrain();
65 int handle_event();
67 ScaleMain *client;
70 class ScaleWin : public BC_Window
72 public:
73 ScaleWin(ScaleMain *client, int x, int y);
74 ~ScaleWin();
76 int create_objects();
77 int close_event();
79 ScaleMain *client;
80 ScaleWidth *width;
81 ScaleHeight *height;
82 ScaleConstrain *constrain;
85 PLUGIN_THREAD_HEADER(ScaleMain, ScaleThread, ScaleWin)
87 class ScaleMain : public PluginVClient
89 public:
90 ScaleMain(PluginServer *server);
91 ~ScaleMain();
93 // required for all realtime plugins
94 int process_buffer(VFrame *frame,
95 int64_t start_position,
96 double frame_rate);
97 void calculate_transfer(VFrame *frame,
98 float &in_x1,
99 float &in_x2,
100 float &in_y1,
101 float &in_y2,
102 float &out_x1,
103 float &out_x2,
104 float &out_y1,
105 float &out_y2);
106 int handle_opengl();
107 int is_realtime();
108 char* plugin_title();
109 int show_gui();
110 void raise_window();
111 int set_string();
112 void update_gui();
113 void save_data(KeyFrame *keyframe);
114 void read_data(KeyFrame *keyframe);
115 VFrame* new_picon();
116 int load_defaults();
117 int save_defaults();
118 int load_configuration();
120 // a thread for the GUI
121 ScaleThread *thread;
123 OverlayFrame *overlayer; // To scale images
124 BC_Hash *defaults;
125 ScaleConfig config;
129 #endif