marked stable
[synfig.git] / synfig-core / tags / stable / src / modules / mod_openexr / trgt_openexr.h
1 /*! ========================================================================
2 ** Sinfg
3 ** Template Header File
4 ** $Id: trgt_openexr.h,v 1.1.1.1 2005/01/04 01:23:14 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 __SINFG_TRGT_OPENEXR_H
24 #define __SINFG_TRGT_OPENEXR_H
25
26 /* === H E A D E R S ======================================================= */
27
28 #include <sinfg/target_scanline.h>
29 #include <sinfg/string.h>
30 #include <sinfg/surface.h>
31 #include <cstdio>
32 #include <OpenEXR/ImfArray.h>
33 #include <OpenEXR/ImfRgbaFile.h>
34 #include <exception>
35
36 /* === M A C R O S ========================================================= */
37
38 /* === T Y P E D E F S ===================================================== */
39
40 /* === C L A S S E S & S T R U C T S ======================================= */
41
42 class exr_trgt : public sinfg::Target_Scanline
43 {
44 public:
45 private:
46         bool multi_image;
47         int imagecount,scanline;
48         sinfg::String filename;
49         Imf::RgbaOutputFile *exr_file;
50         Imf::Rgba *buffer;
51         etl::surface<Imf::Rgba> out_surface;
52 #ifndef USE_HALF_TYPE
53         sinfg::Color *buffer_color;
54 #endif
55
56         bool ready();
57 public:
58         exr_trgt(const char *filename);
59         virtual ~exr_trgt();
60
61         virtual bool set_rend_desc(sinfg::RendDesc *desc);
62         virtual bool start_frame(sinfg::ProgressCallback *cb);
63         virtual void end_frame();
64
65         virtual sinfg::Color * start_scanline(int scanline);
66         virtual bool end_scanline(void);
67
68
69         SINFG_TARGET_MODULE_EXT
70 };
71
72 /* === E N D =============================================================== */
73
74 #endif