1 /* === S Y N F I G ========================================================= */
2 /*! \file target_multi.cpp
3 ** \brief Template File
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 /* === H E A D E R S ======================================================= */
32 #include "target_multi.h"
40 /* === U S I N G =========================================================== */
44 using namespace synfig;
46 /* === M A C R O S ========================================================= */
48 /* === G L O B A L S ======================================================= */
50 /* === P R O C E D U R E S ================================================= */
52 /* === M E T H O D S ======================================================= */
54 Target_Multi::Target_Multi(Target_Scanline::Handle a,Target_Scanline::Handle b):
60 Target_Multi::~Target_Multi()
65 Target_Multi::set_canvas(etl::handle<Canvas> c)
68 RendDesc desc=canvas->rend_desc();
75 Target_Multi::set_rend_desc(RendDesc *d)
78 return a->set_rend_desc(d) && b->set_rend_desc(d);
84 return a->init() && b->init();
88 Target_Multi::add_frame(const synfig::Surface *surface)
90 return a->add_frame(surface) && b->add_frame(surface);
94 Target_Multi::start_frame(ProgressCallback *cb)
96 return a->start_frame(cb) && b->start_frame(cb);
100 Target_Multi::end_frame()
107 Target_Multi::start_scanline(int scanline)
109 buffer_a=a->start_scanline(scanline);
110 buffer_b=b->start_scanline(scanline);
115 Target_Multi::end_scanline()
117 memcpy(buffer_b,buffer_a,sizeof(Color)*desc.get_w());
118 return a->end_scanline() && b->end_scanline();