bg/clr color tweaks, clear borders rework, fc31 depends
[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 reset(int clear);
40         void copy_from(BrightnessConfig &that);
41         void interpolate(BrightnessConfig &prev,
42                 BrightnessConfig &next,
43                 int64_t prev_frame,
44                 int64_t next_frame,
45                 int64_t current_frame);
46
47         float brightness;
48         float contrast;
49         int luma;
50 };
51
52 class BrightnessMain : public PluginVClient
53 {
54 public:
55         BrightnessMain(PluginServer *server);
56         ~BrightnessMain();
57
58 // required for all realtime plugins
59         int process_buffer(VFrame *frame,
60                 int64_t start_position,
61                 double frame_rate);
62         int is_realtime();
63         void update_gui();
64         void save_data(KeyFrame *keyframe);
65         void read_data(KeyFrame *keyframe);
66         int handle_opengl();
67
68
69
70         PLUGIN_CLASS_MEMBERS(BrightnessConfig)
71
72
73
74
75
76         BrightnessEngine *engine;
77         int redo_buffers;
78
79         VFrame *input, *output;
80 };
81
82
83
84
85
86
87 class BrightnessPackage : public LoadPackage
88 {
89 public:
90         BrightnessPackage();
91
92         int row1, row2;
93 };
94
95 class BrightnessUnit : public LoadClient
96 {
97 public:
98         BrightnessUnit(BrightnessEngine *server, BrightnessMain *plugin);
99         ~BrightnessUnit();
100
101         void process_package(LoadPackage *package);
102
103         BrightnessMain *plugin;
104 };
105
106 class BrightnessEngine : public LoadServer
107 {
108 public:
109         BrightnessEngine(BrightnessMain *plugin, int cpus);
110         ~BrightnessEngine();
111
112         void init_packages();
113         LoadClient* new_client();
114         LoadPackage* new_package();
115
116         BrightnessMain *plugin;
117 };
118
119
120
121
122
123
124
125
126
127 #endif