1 /* === S Y N F I G ========================================================= */
3 ** \brief Target Class Implementation
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 ======================================================= */
25 #define SYNFIG_NO_ANGLE
34 #include "target_null.h"
35 #include "target_null_tile.h"
37 using namespace synfig;
41 synfig::Target::Book* synfig::Target::book_;
42 synfig::Target::ExtBook* synfig::Target::ext_book_;
44 static synfig::Gamma* default_gamma_;
46 /* === P R O C E D U R E S ================================================= */
51 book_=new synfig::Target::Book();
52 ext_book_=new synfig::Target::ExtBook();
54 default_gamma_=new synfig::Gamma(1.0/2.2);
55 //default_gamma_->set_black_level(0.05); // Default to 5% black level.
57 book()["null"]=std::pair<synfig::Target::Factory,String>(Target_Null::create,"null");
58 ext_book()["null"]="null";
59 book()["null-tile"]=std::pair<synfig::Target::Factory,String>(Target_Null_Tile::create,"null-tile");
60 ext_book()["null-tile"]="null-tile";
70 delete default_gamma_;
87 /* === M E T H O D S ======================================================= */
91 gamma_(*default_gamma_),
93 avoid_time_sync_(false)
98 synfig::Target::set_canvas(etl::handle<Canvas> c)
101 RendDesc desc=canvas->rend_desc();
102 set_rend_desc(&desc);
107 Target::create(const String &name, const String &filename)
109 if(!book().count(name))
110 return handle<Target>();
112 return Target::Handle(book()[name].first(filename.c_str()));