1 /* === S Y N F I G ========================================================= */
2 /*! \file target_scanline.h
3 ** \brief Template Header
5 ** $Id: target_scanline.h,v 1.1.1.1 2005/01/04 01:23:15 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_TARGET_SCANLINE_H
26 #define __SYNFIG_TARGET_SCANLINE_H
28 /* === H E A D E R S ======================================================= */
32 /* === M A C R O S ========================================================= */
34 /* === T Y P E D E F S ===================================================== */
36 /* === C L A S S E S & S T R U C T S ======================================= */
40 /*! \class Target_Scanline
41 ** \brief Render-target
44 class Target_Scanline : public Target
50 typedef etl::handle<Target_Scanline> Handle;
51 typedef etl::loose_handle<Target_Scanline> LooseHandle;
52 typedef etl::handle<const Target_Scanline> ConstHandle;
56 //! Renders the canvas to the target
57 virtual bool render(ProgressCallback *cb=NULL);
59 //! Marks the start of a frame
60 /*! \return \c true on success, \c false upon an error.
61 ** \see end_frame(), start_scanline()
63 virtual bool start_frame(ProgressCallback *cb=NULL)=0;
65 virtual int next_frame(Time& time);
67 //! Marks the end of a frame
68 /*! \see start_frame() */
69 virtual void end_frame()=0;
71 //! Marks the start of a scanline
72 /*! \param scanline Which scanline is going to be rendered.
73 ** \return The address where the target wants the scanline
75 ** \warning Must be called after start_frame()
76 ** \see end_scanline(), start_frame()
78 virtual Color * start_scanline(int scanline)=0;
80 //! Marks the end of a scanline
81 /*! Takes the data that was put at the address returned to by start_scanline()
82 ** and does whatever it is supose to do with it.
83 ** \return \c true on success, \c false on failure.
84 ** \see start_scanline()
86 virtual bool end_scanline()=0;
88 void set_threads(int x) { threads_=x; }
90 int get_threads()const { return threads_; }
92 bool add_frame(const synfig::Surface *surface);
94 }; // END of class Target_Scanline
96 }; // END of namespace synfig
98 /* === E N D =============================================================== */