Fixed initialisation of tf in file_open(). Without setting the memory to 0,
[cinelerra_cv/mob.git] / plugins / histogram / histogram.h
blob82173698003698066c4c1118ccd1076ee1de9d27
1 #ifndef HISTOGRAM_H
2 #define HISTOGRAM_H
5 #include "histogram.inc"
6 #include "histogramconfig.h"
7 #include "histogramwindow.inc"
8 #include "loadbalance.h"
9 #include "plugincolors.h"
10 #include "pluginvclient.h"
13 class HistogramMain : public PluginVClient
15 public:
16 HistogramMain(PluginServer *server);
17 ~HistogramMain();
19 int process_buffer(VFrame *frame,
20 int64_t start_position,
21 double frame_rate);
22 int is_realtime();
23 int load_defaults();
24 int save_defaults();
25 void save_data(KeyFrame *keyframe);
26 void read_data(KeyFrame *keyframe);
27 void update_gui();
28 void render_gui(void *data);
29 int calculate_use_opengl();
30 int handle_opengl();
32 PLUGIN_CLASS_MEMBERS(HistogramConfig, HistogramThread)
34 // Interpolate quantized transfer table to linear output
35 float calculate_linear(float input, int mode, int do_value);
36 float calculate_smooth(float input, int subscript);
37 // Convert input to smoothed output by looking up in smooth table.
38 float calculate_curve(float input);
39 // Calculate automatic settings
40 void calculate_automatic(VFrame *data);
41 // Calculate histogram.
42 // Value is only calculated for preview.
43 void calculate_histogram(VFrame *data, int do_value);
44 // Calculate the linear, smoothed, lookup curves
45 void tabulate_curve(int subscript, int use_value);
50 YUV yuv;
51 VFrame *input, *output;
52 HistogramEngine *engine;
53 int *lookup[HISTOGRAM_MODES];
54 float *smoothed[HISTOGRAM_MODES];
55 float *linear[HISTOGRAM_MODES];
56 // No value applied to this
57 int *preview_lookup[HISTOGRAM_MODES];
58 int *accum[HISTOGRAM_MODES];
59 // Input point being dragged or edited
60 int current_point;
61 // Current channel being viewed
62 int mode;
63 int dragging_point;
64 int point_x_offset;
65 int point_y_offset;
68 class HistogramPackage : public LoadPackage
70 public:
71 HistogramPackage();
72 int start, end;
75 class HistogramUnit : public LoadClient
77 public:
78 HistogramUnit(HistogramEngine *server, HistogramMain *plugin);
79 ~HistogramUnit();
80 void process_package(LoadPackage *package);
81 HistogramEngine *server;
82 HistogramMain *plugin;
83 int *accum[5];
86 class HistogramEngine : public LoadServer
88 public:
89 HistogramEngine(HistogramMain *plugin,
90 int total_clients,
91 int total_packages);
92 void process_packages(int operation, VFrame *data, int do_value);
93 void init_packages();
94 LoadClient* new_client();
95 LoadPackage* new_package();
96 HistogramMain *plugin;
97 int total_size;
100 int operation;
101 enum
103 HISTOGRAM,
104 APPLY
106 VFrame *data;
107 int do_value;
120 #endif