Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-core / tags / 0.61.09 / src / modules / mod_mng / trgt_mng.h
1 /*! ========================================================================
2 ** Synfig
3 **
4 **      Copyright (c) 2007 Paul Wise
5 **      Copyright (c) 2007 Chris Moore
6 **
7 **      This package is free software; you can redistribute it and/or
8 **      modify it under the terms of the GNU General Public License as
9 **      published by the Free Software Foundation; either version 2 of
10 **      the License, or (at your option) any later version.
11 **
12 **      This package is distributed in the hope that it will be useful,
13 **      but WITHOUT ANY WARRANTY; without even the implied warranty of
14 **      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 **      General Public License for more details.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === S T A R T =========================================================== */
22
23 #ifndef __SYNFIG_TRGT_MNG_H
24 #define __SYNFIG_TRGT_MNG_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #include <synfig/target_scanline.h>
29 #include <synfig/string.h>
30 #include <cstdio>
31
32 // #include <png.h>
33 // #include <jpeglib.h>
34
35 #if !defined(MNG_SUPPORT_FULL)
36 #define MNG_SUPPORT_FULL 1
37 #endif
38
39 #if !defined(MNG_SUPPORT_READ)
40 #define MNG_SUPPORT_READ 1
41 #endif
42
43 #if !defined(MNG_SUPPORT_WRITE)
44 #define MNG_SUPPORT_WRITE 1
45 #endif
46
47 #if !defined(MNG_SUPPORT_DISPLAY)
48 #define MNG_SUPPORT_DISPLAY 1
49 #endif
50
51 #if !defined(MNG_ACCESS_CHUNKS)
52 #define MNG_ACCESS_CHUNKS 1
53 #endif
54
55 #include <libmng.h>
56
57 /* === M A C R O S ========================================================= */
58
59 /* === T Y P E D E F S ===================================================== */
60
61 /* === C L A S S E S & S T R U C T S ======================================= */
62
63 class mng_trgt : public synfig::Target_Scanline
64 {
65         SYNFIG_TARGET_MODULE_EXT
66         
67 private:
68         
69         FILE *file;
70         int w,h;
71         mng_handle mng;
72
73         bool multi_image,ready;
74         int imagecount;
75         synfig::String filename;
76         unsigned char *buffer;
77         synfig::Color *color_buffer;
78
79         z_stream zstream;
80         unsigned char* zbuffer;
81         unsigned int zbuffer_len;
82
83 public:
84         
85         mng_trgt(const char *filename);
86         virtual ~mng_trgt();
87
88         virtual bool set_rend_desc(synfig::RendDesc *desc);
89         virtual bool init();
90         virtual bool start_frame(synfig::ProgressCallback *cb);
91         virtual void end_frame();
92
93         virtual synfig::Color * start_scanline(int scanline);
94         virtual bool end_scanline();
95 };
96
97 /* === E N D =============================================================== */
98
99 #endif