update internationalization data
[goodguy/history.git] / cinelerra-5.0 / plugins / histogram_bezier / histogram.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 HISTOGRAM_H
23 #define HISTOGRAM_H
24
25
26 #include "histogram.inc"
27 #include "histogramconfig.h"
28 #include "histogramwindow.inc"
29 #include "loadbalance.h"
30 #include "cicolors.h"
31 #include "pluginvclient.h"
32
33 enum
34 {
35   HISTOGRAM_LINEAR,
36   HISTOGRAM_POLYNOMINAL,
37   HISTOGRAM_BEZIER,
38 };
39
40
41 class HistogramMain : public PluginVClient
42 {
43 public:
44         HistogramMain(PluginServer *server);
45         ~HistogramMain();
46
47         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
48         int is_realtime();
49         int load_defaults();
50         int save_defaults();
51         void save_data(KeyFrame *keyframe);
52         void read_data(KeyFrame *keyframe);
53         void update_gui();
54         void render_gui(void *data);
55
56         PLUGIN_CLASS_MEMBERS(HistogramConfig, HistogramThread)
57
58 // Convert input to linear output
59         float calculate_linear(float input, int mode, int do_value);
60         float calculate_smooth(float input, int subscript);
61 // Convert input to smoothed output by looking up in smooth table.
62         float calculate_curve(float input);
63 // Calculate automatic settings
64         void calculate_automatic(VFrame *data);
65 // Calculate histogram
66         void calculate_histogram(VFrame *data);
67 // Calculate the linear, smoothed, lookup curves
68         void tabulate_curve(int subscript, int use_value);
69
70
71
72         YUV yuv;
73         VFrame *input, *output;
74         HistogramEngine *engine;
75         int *lookup[HISTOGRAM_MODES];
76         float *smoothed[HISTOGRAM_MODES];
77         float *linear[HISTOGRAM_MODES];
78         int *accum[HISTOGRAM_MODES];
79 // Input point being dragged or edited
80         int current_point;
81 // Current channel being viewed
82         int mode;
83         int dragging_point;
84         int point_x_offset;
85         int point_y_offset;
86 };
87
88 class HistogramPackage : public LoadPackage
89 {
90 public:
91         HistogramPackage();
92         int start, end;
93 };
94
95 class HistogramUnit : public LoadClient
96 {
97 public:
98         HistogramUnit(HistogramEngine *server, HistogramMain *plugin);
99         ~HistogramUnit();
100         void process_package(LoadPackage *package);
101         HistogramEngine *server;
102         HistogramMain *plugin;
103         int *accum[5];
104 };
105
106 class HistogramEngine : public LoadServer
107 {
108 public:
109         HistogramEngine(HistogramMain *plugin, 
110                 int total_clients, 
111                 int total_packages);
112         void process_packages(int operation, VFrame *data);
113         void init_packages();
114         LoadClient* new_client();
115         LoadPackage* new_package();
116         HistogramMain *plugin;
117         int total_size;
118
119
120         int operation;
121         enum
122         {
123                 HISTOGRAM,
124                 APPLY
125         };
126         VFrame *data;
127 };
128
129
130
131
132
133
134
135
136
137
138
139 #endif