moreupdates
[synfig.git] / synfig-core / trunk / src / modules / mod_jpeg / trgt_jpeg.h
1 /*! ========================================================================
2 ** Synfig
3 ** Template Header File
4 ** $Id: trgt_jpeg.h,v 1.1.1.1 2005/01/04 01:23:11 darco Exp $
5 **
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
7 **
8 ** This software and associated documentation
9 ** are CONFIDENTIAL and PROPRIETARY property of
10 ** the above-mentioned copyright holder.
11 **
12 ** You may not copy, print, publish, or in any
13 ** other way distribute this software without
14 ** a prior written agreement with
15 ** the copyright holder.
16 **
17 ** === N O T E S ===========================================================
18 **
19 ** ========================================================================= */
20
21 /* === S T A R T =========================================================== */
22
23 #ifndef __SYNFIG_TRGT_JPEG_H
24 #define __SYNFIG_TRGT_JPEG_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #define NOMINMAX
29 #include <synfig/target_scanline.h>
30 #include <synfig/string.h>
31 #include <cstdio>
32 _ETL_BEGIN_CDECLS
33 #include <jpeglib.h>
34 _ETL_END_CDECLS
35 #include <setjmp.h>
36
37 /* === M A C R O S ========================================================= */
38
39 /* === T Y P E D E F S ===================================================== */
40
41 /* === C L A S S E S & S T R U C T S ======================================= */
42
43 class jpeg_trgt : public synfig::Target_Scanline
44 {
45         SYNFIG_TARGET_MODULE_EXT
46 private:
47         FILE *file;
48         int w,h,quality;
49         struct jpeg_compress_struct cinfo;
50         struct jpeg_error_mgr jerr;
51
52         
53         bool multi_image,ready;
54         int imagecount;
55         synfig::String filename;
56         unsigned char *buffer;
57         synfig::Color *color_buffer;
58 public:
59         jpeg_trgt(const char *filename);
60         virtual ~jpeg_trgt();
61
62         virtual bool set_rend_desc(synfig::RendDesc *desc);
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