update ffmpeg to 4.1, add sketcher plugin, crikey tweaks, titler colorpicker, keyfram...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / dot / dot.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 DOT_H
23 #define DOT_H
24
25 class DotMain;
26 class DotEngine;
27
28 #include "bchash.h"
29 #include "effecttv.h"
30 #include "loadbalance.h"
31 #include "mutex.h"
32 #include "pluginvclient.h"
33 #include "dotwindow.h"
34
35 #include <stdint.h>
36
37
38 class DotConfig
39 {
40 public:
41         DotConfig();
42
43
44         int dot_depth;
45         int dot_size;
46         inline int dot_max()
47         {
48                 return 1 << dot_depth;
49         };
50 };
51
52 class DotPackage : public LoadPackage
53 {
54 public:
55         DotPackage();
56
57         int row1, row2;
58 };
59
60 class DotServer : public LoadServer
61 {
62 public:
63         DotServer(DotMain *plugin, int total_clients, int total_packages);
64
65         LoadClient* new_client();
66         LoadPackage* new_package();
67         void init_packages();
68         DotMain *plugin;
69 };
70
71 class DotClient : public LoadClient
72 {
73 public:
74         DotClient(DotServer *server);
75
76         void process_package(LoadPackage *package);
77         void draw_dot(int xx,
78                 int yy,
79                 unsigned char c,
80                 unsigned char **output_rows,
81                 int color_model);
82
83         unsigned char RGBtoY(unsigned char *row, int color_model);
84
85         DotMain *plugin;
86 };
87
88
89 class DotMain : public PluginVClient
90 {
91 public:
92         DotMain(PluginServer *server);
93         ~DotMain();
94
95 // required for all realtime plugins
96         PLUGIN_CLASS_MEMBERS(DotConfig);
97         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
98         int is_realtime();
99         void save_data(KeyFrame *keyframe);
100         void read_data(KeyFrame *keyframe);
101
102         void make_pattern();
103         void init_sampxy_table();
104         void reconfigure();
105
106         DotServer *dot_server;
107         DotClient *dot_client;
108
109         VFrame *input_ptr, *output_ptr;
110         int dots_width;
111         int dots_height;
112         int dot_size;
113         int dot_hsize;
114         uint32_t *pattern;
115         int *sampx, *sampy;
116         int need_reconfigure;
117         EffectTV *effecttv;
118 };
119
120
121
122
123
124
125
126
127
128
129 #endif