initial commit
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / brightness / brightness.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef BRIGHTNESS_H
23 #define BRIGHTNESS_H
24
25 class BrightnessEngine;
26 class BrightnessMain;
27
28 #include "brightnesswindow.h"
29 #include "loadbalance.h"
30 #include "bccolors.h"
31 #include "pluginvclient.h"
32
33 class BrightnessConfig
34 {
35 public:
36         BrightnessConfig();
37
38         int equivalent(BrightnessConfig &that);
39         void copy_from(BrightnessConfig &that);
40         void interpolate(BrightnessConfig &prev,
41                 BrightnessConfig &next,
42                 int64_t prev_frame,
43                 int64_t next_frame,
44                 int64_t current_frame);
45
46         float brightness;
47         float contrast;
48         int luma;
49 };
50
51 class BrightnessMain : public PluginVClient
52 {
53 public:
54         BrightnessMain(PluginServer *server);
55         ~BrightnessMain();
56
57 // required for all realtime plugins
58         int process_buffer(VFrame *frame,
59                 int64_t start_position,
60                 double frame_rate);
61         int is_realtime();
62         void update_gui();
63         void save_data(KeyFrame *keyframe);
64         void read_data(KeyFrame *keyframe);
65         int handle_opengl();
66
67
68
69         PLUGIN_CLASS_MEMBERS(BrightnessConfig)
70
71
72
73
74
75         BrightnessEngine *engine;
76         int redo_buffers;
77
78         VFrame *input, *output;
79 };
80
81
82
83
84
85
86 class BrightnessPackage : public LoadPackage
87 {
88 public:
89         BrightnessPackage();
90
91         int row1, row2;
92 };
93
94 class BrightnessUnit : public LoadClient
95 {
96 public:
97         BrightnessUnit(BrightnessEngine *server, BrightnessMain *plugin);
98         ~BrightnessUnit();
99
100         void process_package(LoadPackage *package);
101
102         BrightnessMain *plugin;
103 };
104
105 class BrightnessEngine : public LoadServer
106 {
107 public:
108         BrightnessEngine(BrightnessMain *plugin, int cpus);
109         ~BrightnessEngine();
110
111         void init_packages();
112         LoadClient* new_client();
113         LoadPackage* new_package();
114
115         BrightnessMain *plugin;
116 };
117
118
119
120
121
122
123
124
125
126 #endif