remove whitespace at eol
[goodguy/history.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
38 typedef struct _scratch
39 {
40         int life;
41         int x;
42         int dx;
43         int init;
44 } scratch_t;
45
46 class AgingConfig
47 {
48 public:
49         AgingConfig();
50
51         int area_scale;
52         int aging_mode;
53         scratch_t scratches[SCRATCH_MAX];
54
55         static int dx[8];
56         static int dy[8];
57         int dust_interval;
58
59
60         int pits_interval;
61
62         int scratch_lines;
63         int pit_count;
64         int dust_count;
65
66         int colorage;
67         int scratch;
68         int pits;
69         int dust;
70 };
71
72 class AgingPackage : public LoadPackage
73 {
74 public:
75         AgingPackage();
76
77         int row1, row2;
78 };
79
80 class AgingServer : public LoadServer
81 {
82 public:
83         AgingServer(AgingMain *plugin, int total_clients, int total_packages);
84
85         LoadClient* new_client();
86         LoadPackage* new_package();
87         void init_packages();
88         AgingMain *plugin;
89 };
90
91 class AgingClient : public LoadClient
92 {
93 public:
94         AgingClient(AgingServer *server);
95
96         void coloraging(unsigned char **output_ptr,
97                 unsigned char **input_ptr,
98                 int color_model,
99                 int w,
100                 int h);
101         void scratching(unsigned char **output_ptr,
102                 int color_model,
103                 int w,
104                 int h);
105         void pits(unsigned char **output_ptr,
106                 int color_model,
107                 int w,
108                 int h);
109         void dusts(unsigned char **output_ptr,
110                 int color_model,
111                 int w,
112                 int h);
113         void process_package(LoadPackage *package);
114
115         AgingMain *plugin;
116 };
117
118
119 class AgingMain : public PluginVClient
120 {
121 public:
122         AgingMain(PluginServer *server);
123         ~AgingMain();
124
125 // required for all realtime plugins
126         PLUGIN_CLASS_MEMBERS(AgingConfig);
127         int process_realtime(VFrame *input_ptr, VFrame *output_ptr);
128         int is_realtime();
129         void save_data(KeyFrame *keyframe);
130         void read_data(KeyFrame *keyframe);
131
132         int load_defaults();
133         int save_defaults();
134
135         AgingServer *aging_server;
136         AgingClient *aging_client;
137
138         AgingEngine **engine;
139         VFrame *input_ptr, *output_ptr;
140 };
141
142
143
144
145
146
147
148
149
150
151 #endif