add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / aging / aging.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 AGING_H
23 #define AGING_H
24
25 class AgingMain;
26 class AgingEngine;
27
28 #include "bchash.h"
29 #include "loadbalance.h"
30 #include "mutex.h"
31 #include "pluginvclient.h"
32 #include "agingwindow.h"
33 #include <sys/types.h>
34
35 #define SCRATCH_MAX 20
36
37 class AgingConfig
38 {
39 public:
40         AgingConfig();
41         ~AgingConfig();
42
43         void reset();
44         int equivalent(AgingConfig &that);
45         void copy_from(AgingConfig &that);
46         void interpolate(AgingConfig &prev, AgingConfig &next,
47                 int64_t prev_frame, int64_t next_frame, int64_t current_frame);
48
49         int area_scale;
50         int aging_mode;
51         int dust_interval;
52         int pits_interval;
53         int scratch_lines;
54         int colorage;
55         int scratch;
56         int pits;
57         int dust;
58 };
59
60 class AgingPackage : public LoadPackage
61 {
62 public:
63         AgingPackage();
64
65         int row1, row2;
66 };
67
68 class AgingServer : public LoadServer
69 {
70 public:
71         AgingServer(AgingMain *plugin, int total_clients, int total_packages);
72
73         LoadClient* new_client();
74         LoadPackage* new_package();
75         void init_packages();
76         AgingMain *plugin;
77 };
78
79 class AgingClient : public LoadClient
80 {
81 public:
82         AgingClient(AgingServer *server);
83
84         void coloraging(unsigned char **output_ptr, unsigned char **input_ptr,
85                         int color_model, int w, int h);
86         void scratching(unsigned char **output_ptr,
87                         int color_model, int w, int h);
88         void pits(unsigned char **output_ptr,
89                         int color_model, int w, int h);
90         void dusts(unsigned char **output_ptr,
91                         int color_model, int w, int h);
92         void process_package(LoadPackage *package);
93
94         AgingMain *plugin;
95 };
96
97 typedef struct _scratch {
98         int life;
99         int x;
100         int dx;
101         int init;
102 } scratch_t;
103
104
105 class AgingMain : public PluginVClient
106 {
107 public:
108         AgingMain(PluginServer *server);
109         ~AgingMain();
110
111 // required for all realtime plugins
112         PLUGIN_CLASS_MEMBERS(AgingConfig);
113         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
114         int is_realtime();
115         void save_data(KeyFrame *keyframe);
116         void read_data(KeyFrame *keyframe);
117
118         AgingServer *aging_server;
119         AgingClient *aging_client;
120
121         AgingEngine **engine;
122         VFrame *input_ptr, *output_ptr;
123
124         int pits_count, dust_count;
125         scratch_t scratches[SCRATCH_MAX];
126         static int dx[8], dy[8];
127 };
128
129
130
131
132
133
134
135
136
137
138 #endif