hard edges rework, add hard edge in gwdw, config.ac nv/cuda tweaks, message log warn...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / mandelcuda / mandelbrot.h
1 /*
2  * CINELERRA
3  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19
20 #ifndef MANDELCUDA_H
21 #define MANDELCUDA_H
22
23 #include "pluginvclient.h"
24
25 typedef struct {
26     unsigned char x, y, z, w;
27 } uchar4;
28
29 #include "mandelcuda.h"
30
31 class MandelbrotConfig;
32 class Mandelbrot;
33
34 class MandelbrotConfig
35 {
36 public:
37         MandelbrotConfig();
38
39         int equivalent(MandelbrotConfig &that);
40         void copy_from(MandelbrotConfig &that);
41         void interpolate(MandelbrotConfig &prev, MandelbrotConfig &next, 
42                 long prev_frame, long next_frame, long current_frame);
43
44         int is_julia;
45         float x_off, y_off, scale;
46         float x_julia, y_julia;
47         int color, crunch, step;
48
49         void limits();
50         void reset();
51         void startJulia();
52 };
53
54 class Mandelbrot : public PluginVClient
55 {
56 public:
57         Mandelbrot(PluginServer *server);
58         ~Mandelbrot();
59         PLUGIN_CLASS_MEMBERS2(MandelbrotConfig)
60         int is_realtime();
61         int is_synthesis();
62         void update_gui();
63         void save_data(KeyFrame *keyframe);
64         void read_data(KeyFrame *keyframe);
65         int process_buffer(VFrame *frame, int64_t start_position, double frame_rate);
66         int handle_opengl();
67
68         void GetSample(int sampleIndex, float &x, float &y);
69         void renderImage();
70         void displayFunc();
71         void initData();
72         void init();
73
74         VFrame *output, *vfrm;
75         int color_model, pass;
76         int img_w, img_h;
77         int pbo_id;
78         int animation_frame;
79         MandelCuda cuda;
80
81         void init_cuda();
82         void finish_cuda();
83 };
84
85 #endif