Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / 0.61.08 / src / modules / mod_magickpp / trgt_magickpp.h
1 /*! ========================================================================
2 ** Synfig
3 **
4 **      Copyright (c) 2007 Chris Moore
5 **
6 **      This package is free software; you can redistribute it and/or
7 **      modify it under the terms of the GNU General Public License as
8 **      published by the Free Software Foundation; either version 2 of
9 **      the License, or (at your option) any later version.
10 **
11 **      This package 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 GNU
14 **      General Public License for more details.
15 **
16 ** === N O T E S ===========================================================
17 **
18 ** ========================================================================= */
19
20 /* === S T A R T =========================================================== */
21
22 #ifndef __SYNFIG_TRGT_MAGICKPP_H
23 #define __SYNFIG_TRGT_MAGICKPP_H
24
25 /* === H E A D E R S ======================================================= */
26
27 #include <synfig/target_scanline.h>
28 #include <synfig/string.h>
29 #include <cstdio>
30
31 #include <vector>
32 #include <Magick++.h>
33
34 /* === M A C R O S ========================================================= */
35
36 /* === T Y P E D E F S ===================================================== */
37
38 /* === C L A S S E S & S T R U C T S ======================================= */
39
40 class magickpp_trgt : public synfig::Target_Scanline
41 {
42         SYNFIG_TARGET_MODULE_EXT
43         
44 private:
45         
46         int width, height;
47
48         synfig::String filename;
49         unsigned char *buffer1, *start_pointer, *buffer_pointer;
50         unsigned char *buffer2, *previous_buffer_pointer;
51         bool transparent;
52         synfig::Color *color_buffer;
53         std::vector<Magick::Image> images;
54
55 public:
56         
57         magickpp_trgt(const char *filename) : filename(filename) { }
58         virtual ~magickpp_trgt();
59
60         virtual bool set_rend_desc(synfig::RendDesc *desc);
61         virtual bool init();
62
63         virtual bool start_frame(synfig::ProgressCallback *cb);
64         virtual void end_frame();
65
66         virtual synfig::Color* start_scanline(int scanline);
67         virtual bool end_scanline();
68 };
69
70 /* === E N D =============================================================== */
71
72 #endif