1 /* === S I N F G =========================================================== */
5 ** $Id: main.cpp,v 1.9 2005/01/23 04:41:10 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === H E A D E R S ======================================================= */
32 #include <ETL/stringf>
37 #include <sinfg/loadcanvas.h>
38 #include <sinfg/savecanvas.h>
39 #include <sinfg/target_scanline.h>
40 #include <sinfg/module.h>
41 #include <sinfg/importer.h>
42 #include <sinfg/layer.h>
43 #include <sinfg/canvas.h>
44 #include <sinfg/target.h>
45 #include <sinfg/time.h>
46 #include <sinfg/string.h>
47 #include <sinfg/paramdesc.h>
48 #include <sinfg/main.h>
49 #include <sinfg/guid.h>
54 using namespace sinfg;
56 /* === M A C R O S ========================================================= */
61 SINFGTOOL_FILENOTFOUND =1,
64 SINFGTOOL_UNKNOWNARGUMENT =4,
65 SINFGTOOL_UNKNOWNERROR =5,
66 SINFGTOOL_INVALIDTARGET =6,
67 SINFGTOOL_RENDERFAILURE =7,
69 SINFGTOOL_BADVERSION =9
73 #define VERSION "unknown"
74 #define PACKAGE "sinfg-tool"
77 #ifdef DEFAULT_QUALITY
78 #undef DEFAULT_QUALITY
81 #define DEFAULT_QUALITY 2
82 #define VERBOSE_OUT(x) if(verbosity>=(x))std::cerr
84 /* === G L O B A L S ======================================================= */
89 bool print_benchmarks=false;
91 /* === M E T H O D S ======================================================= */
93 class Progress : public sinfg::ProgressCallback
99 Progress(const char *name):program(name) { }
102 task(const String &task)
104 VERBOSE_OUT(1)<<program<<": "<<task<<std::endl;
109 error(const String &task)
111 std::cerr<<program<<": "<<_("error")<<": "<<task<<std::endl;
116 warning(const String &task)
118 std::cerr<<program<<": "<<_("warning")<<": "<<task<<std::endl;
123 amount_complete(int current, int total)
129 class RenderProgress : public sinfg::ProgressCallback
134 int clk_scanline; // The scanline at which the clock was reset
140 RenderProgress():clk_scanline(0) { }
143 task(const String &thetask)
150 error(const String &task)
152 std::cout<<_("error")<<": "<<task<<std::endl;
157 warning(const String &task)
159 std::cout<<_("warning")<<": "<<task<<std::endl;
164 amount_complete(int scanline, int h)
166 if(be_quiet)return true;
169 const float time(clk()*(float)(h-scanline)/(float)(scanline-clk_scanline));
170 const float delta(time-last_time);
172 int weeks=0,days=0,hours=0,minutes=0,seconds=0;
184 //cerr<<"reset"<<endl;
186 clk_scanline=scanline;
192 clk_scanline=scanline;
196 minutes++,seconds-=60;
204 cerr<<taskname<<": "<<_("Line")<<" "<<scanline<<_(" of ")<<h<<" -- ";
205 //cerr<<time/(h-clk_scanline)<<" ";
207 if(delta>=-time/(h-clk_scanline) )
210 if(delta>=0 && clk()>4.0 && scanline>clk_scanline+200)
212 //cerr<<"reset"<<endl;
214 clk_scanline=scanline;
231 cerr<<taskname<<": "<<_("DONE")<<" "<<endl;;
244 Canvas::Handle canvas;
245 Target::Handle target;
251 typedef list<String> arg_list_t;
252 typedef list<Job> job_list_t;
256 cout<<"GUID Test"<<endl;
259 cout<<sinfg::GUID().get_string()<<' '<<sinfg::GUID().get_string()<<endl;
263 void signal_test_func()
265 cout<<"**SIGNAL CALLED**"<<endl;
270 sigc::signal<void> sig;
271 sigc::connection conn;
272 cout<<"Signal Test"<<endl;
273 conn=sig.connect(sigc::ptr_fun(signal_test_func));
274 cout<<"Next line should exclaim signal called."<<endl;
277 cout<<"Next line should NOT exclaim signal called."<<endl;
282 /* === P R O C E D U R E S ================================================= */
284 void display_help(int amount)
289 Argument(const char *flag,const char *arg, string description)
291 const char spaces[]=" ";
293 cerr<<strprintf(" %s %s %s",flag, arg, spaces+strlen(arg)+strlen(flag)+1)+description<<endl;
295 cerr<<strprintf(" %s %s",flag,spaces+strlen(flag))+description<<endl;
299 cerr<<_("syntax: ")<<progname<<" [DEFAULT OPTIONS] ([SIF FILE] [SPECIFIC OPTIONS])..."<<endl;
303 Argument("-t","<output type>",_("Specify output target (Default:unknown)"));
304 Argument("-w","<pixel width>",_("Set the image width (Use zero for file default)"));
305 Argument("-h","<pixel height>",_("Set the image height (Use zero for file default)"));
306 Argument("-s","<image dist>",_("Set the diagonal size of image window (Span)"));
307 Argument("-a","<1...30>",_("Set antialias amount for parametric renderer."));
308 Argument("-Q","<0...10>",strprintf(_("Specify image quality for accelerated renderer (default=%d)"),DEFAULT_QUALITY).c_str());
309 Argument("-g","<amount>",_("Gamma (default=2.2)"));
310 Argument("-v",NULL,_("Verbose Output (add more for more verbosity)"));
311 Argument("-q",NULL,_("Quiet mode (No progress/time-remaining display)"));
312 Argument("-c","<canvas id>",_("Render the canvas with the given id instead of the root."));
313 Argument("-o","<output file>",_("Specify output filename"));
314 Argument("-T","<# of threads>",_("Enable multithreaded renderer using specified # of threads"));
316 Argument("-b",NULL,_("Print Benchmarks"));
318 Argument("--fps","<framerate>",_("Set the frame rate"));
319 Argument("--time","<time>",_("Render a single frame at <seconds>"));
320 Argument("--begin-time","<time>",_("Set the starting time"));
321 Argument("--end-time","<time>",_("Set the ending time"));
322 Argument("--dpi","<res>",_("Set the dots-per-inch"));
323 Argument("--append","<filename>",_("Append layers in <filename> to composition"));
325 Argument("--layer-info","<layer>",_("Print out layer's description, parameter info, etc."));
326 Argument("--layers",NULL,_("Print out the list of available layers"));
327 Argument("--targets",NULL,_("Print out the list of available targets"));
328 Argument("--importers",NULL,_("Print out the list of available importers"));
329 Argument("--valuenodes",NULL,_("Print out the list of available ValueNodes"));
330 Argument("--modules",NULL,_("Print out the list of loaded modules"));
331 Argument("--version",NULL,_("Print out version information"));
332 Argument("--info",NULL,_("Print out misc build information"));
333 Argument("--license",NULL,_("Print out license information"));
336 Argument("--guid-test",NULL,_("Test GUID generation"));
337 Argument("--signal-test",NULL,_("Test signal implementation"));
342 Argument("--help",NULL,_("Print out usage and syntax info"));
346 int process_global_flags(arg_list_t &arg_list)
348 arg_list_t::iterator iter, next;
350 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
355 if(*iter == "--signal-test")
358 return SINFGTOOL_HELP;
361 if(*iter == "--guid-test")
364 return SINFGTOOL_HELP;
368 if(*iter == "--help")
372 return SINFGTOOL_HELP;
375 if(*iter == "--info")
377 cout<<PACKAGE"-"VERSION<<endl;
378 cout<<"Compiled on "__DATE__ " at "__TIME__;
380 cout<<" with GCC "<<__VERSION__;
383 cout<<" with Microsoft Visual C++ "<<(_MSC_VER>>8)<<'.'<<(_MSC_VER&255);
385 #ifdef __TCPLUSPLUS__
386 cout<<" with Borland Turbo C++ "<<(__TCPLUSPLUS__>>8)<<'.'<<((__TCPLUSPLUS__&255)>>4)<<'.'<<(__TCPLUSPLUS__&15);
389 cout<<endl<<SINFG_COPYRIGHT<<endl;
391 return SINFGTOOL_HELP;
394 if(*iter == "--layers")
397 sinfg::Main sinfg_main(dirname(progname),&p);
398 sinfg::Layer::Book::iterator iter=sinfg::Layer::book().begin();
399 for(;iter!=sinfg::Layer::book().end();iter++)
400 cout<<iter->first<<endl;
402 return SINFGTOOL_HELP;
405 if(*iter == "--layer-info")
408 sinfg::Main sinfg_main(dirname(progname),&p);
410 Layer::Handle layer=sinfg::Layer::create(*iter);
411 cout<<"Layer Name: "<<layer->get_name()<<endl;
412 cout<<"Localized Layer Name: "<<layer->get_local_name()<<endl;
413 cout<<"Version: "<<layer->get_version()<<endl;
414 Layer::Vocab vocab=layer->get_param_vocab();
415 for(;!vocab.empty();vocab.pop_front())
417 cout<<"param - "<<vocab.front().get_name();
418 if(!vocab.front().get_critical())
419 cout<<" (not critical)";
420 cout<<endl<<"\tLocalized Name: "<<vocab.front().get_local_name()<<endl;
421 if(!vocab.front().get_description().empty())
422 cout<<"\tDescription: "<<vocab.front().get_description()<<endl;
423 if(!vocab.front().get_hint().empty())
424 cout<<"\tHint: "<<vocab.front().get_hint()<<endl;
427 return SINFGTOOL_HELP;
430 if(*iter == "--modules")
433 sinfg::Main sinfg_main(dirname(progname),&p);
434 sinfg::Module::Book::iterator iter=sinfg::Module::book().begin();
435 for(;iter!=sinfg::Module::book().end();iter++)
436 cout<<iter->first<<endl;
437 return SINFGTOOL_HELP;
440 if(*iter == "--targets")
443 sinfg::Main sinfg_main(dirname(progname),&p);
444 sinfg::Target::Book::iterator iter=sinfg::Target::book().begin();
445 for(;iter!=sinfg::Target::book().end();iter++)
446 cout<<iter->first<<endl;
448 return SINFGTOOL_HELP;
451 if(*iter == "--valuenodes")
454 sinfg::Main sinfg_main(dirname(progname),&p);
455 sinfg::LinkableValueNode::Book::iterator iter=sinfg::LinkableValueNode::book().begin();
456 for(;iter!=sinfg::LinkableValueNode::book().end();iter++)
457 cout<<iter->first<<endl;
459 return SINFGTOOL_HELP;
462 if(*iter == "--importers")
465 sinfg::Main sinfg_main(dirname(progname),&p);
466 sinfg::Importer::Book::iterator iter=sinfg::Importer::book().begin();
467 for(;iter!=sinfg::Importer::book().end();iter++)
468 cout<<iter->first<<endl;
470 return SINFGTOOL_HELP;
473 if(*iter == "--version")
475 cerr<<PACKAGE<<" "<<VERSION<<endl;
477 arg_list.erase(iter);
479 return SINFGTOOL_HELP;
482 if(*iter == "--license")
484 cerr<<PACKAGE<<" "<<VERSION<<endl;
485 cout<<SINFG_COPYRIGHT<<endl<<endl;
487 ** This software and associated documentation\n\
488 ** are CONFIDENTIAL and PROPRIETARY property of\n\
489 ** the above-mentioned copyright holder.\n\
491 ** You may not use, copy, print, publish, or in\n\
492 ** any other way distribute or exploit this software\n\
493 ** without a prior written agreement with the\n\
494 ** copyright holder. " << endl << endl;
495 arg_list.erase(iter);
497 return SINFGTOOL_HELP;
504 arg_list.erase(iter);
513 arg_list.erase(iter);
519 print_benchmarks=true;
521 arg_list.erase(iter);
530 int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster)
532 arg_list_t::iterator iter, next;
534 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
536 if(*iter->begin() != '-')
538 //cerr<<*iter->begin()<<"-----------"<<endl;
553 *iter=="--start-time" ||
554 *iter=="--begin-time" ||
555 *iter=="--end-time" ||
556 *iter=="--start-frame" ||
557 *iter=="--end-frame" ||
566 cluster.push_back(*iter);
567 arg_list.erase(iter);
571 cluster.push_back(*iter);
572 arg_list.erase(iter);
578 int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc)
580 arg_list_t::iterator iter, next;
583 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
587 arg_list.erase(iter);
589 w=atoi(iter->c_str());
590 arg_list.erase(iter);
594 arg_list.erase(iter);
596 h=atoi(iter->c_str());
597 arg_list.erase(iter);
602 arg_list.erase(iter);
604 a=atoi(iter->c_str());
605 desc.set_antialias(a);
606 VERBOSE_OUT(1)<<strprintf(_("Antialiasing set to %d, (%d samples per pixel)"),a,a*a)<<endl;
607 arg_list.erase(iter);
611 arg_list.erase(iter);
613 span=atof(iter->c_str());
614 VERBOSE_OUT(1)<<strprintf(_("Span set to %d units"),span)<<endl;
615 arg_list.erase(iter);
619 arg_list.erase(iter);
621 float fps=atof(iter->c_str());
622 desc.set_frame_rate(fps);
623 arg_list.erase(iter);
624 VERBOSE_OUT(1)<<strprintf(_("Frame rate set to %d frames per second"),fps)<<endl;
628 arg_list.erase(iter);
630 float dpi=atof(iter->c_str());
631 float dots_per_meter=dpi*39.3700787402;
632 desc.set_x_res(dots_per_meter).set_y_res(dots_per_meter);
633 arg_list.erase(iter);
634 VERBOSE_OUT(1)<<strprintf(_("Physical resolution set to %f dpi"),dpi)<<endl;
638 arg_list.erase(iter);
640 float dpi=atof(iter->c_str());
641 float dots_per_meter=dpi*39.3700787402;
642 desc.set_x_res(dots_per_meter);
643 arg_list.erase(iter);
644 VERBOSE_OUT(1)<<strprintf(_("Physical X resolution set to %f dpi"),dpi)<<endl;
648 arg_list.erase(iter);
650 float dpi=atof(iter->c_str());
651 float dots_per_meter=dpi*39.3700787402;
652 desc.set_y_res(dots_per_meter);
653 arg_list.erase(iter);
654 VERBOSE_OUT(1)<<strprintf(_("Physical Y resolution set to %f dpi"),dpi)<<endl;
656 if(*iter=="--start-time" || *iter=="--begin-time")
658 arg_list.erase(iter);
660 desc.set_time_start(Time(*iter,desc.get_frame_rate()));
661 arg_list.erase(iter);
663 if(*iter=="--end-time")
665 arg_list.erase(iter);
667 desc.set_time_end(Time(*iter,desc.get_frame_rate()));
668 arg_list.erase(iter);
672 arg_list.erase(iter);
674 desc.set_time(Time(*iter,desc.get_frame_rate()));
675 VERBOSE_OUT(1)<<_("Rendering frame at ")<<desc.get_time_start().get_string(desc.get_frame_rate())<<endl;
676 arg_list.erase(iter);
680 sinfg::warning("Gamma argument is currently ignored");
681 //arg_list.erase(iter);
683 //desc.set_gamma(Gamma(atof(iter->c_str())));
684 //arg_list.erase(iter);
690 VERBOSE_OUT(1)<<strprintf(_("Resolution set to %dx%d"),w,h)<<endl;
696 VERBOSE_OUT(1)<<strprintf(_("Width set to %d pixels"),w)<<endl;
701 VERBOSE_OUT(1)<<strprintf(_("Height set to %d pixels"),h)<<endl;
710 int extract_quality(arg_list_t &arg_list,int &quality)
712 arg_list_t::iterator iter, next;
713 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
717 arg_list.erase(iter);
719 quality=atoi(iter->c_str());
720 VERBOSE_OUT(1)<<strprintf(_("Quality set to %d"),quality)<<endl;
721 arg_list.erase(iter);
728 int extract_threads(arg_list_t &arg_list,int &threads)
730 arg_list_t::iterator iter, next;
731 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
735 arg_list.erase(iter);
737 threads=atoi(iter->c_str());
738 VERBOSE_OUT(1)<<strprintf(_("Threads set to %d"),threads)<<endl;
739 arg_list.erase(iter);
746 int extract_target(arg_list_t &arg_list,string &type)
748 arg_list_t::iterator iter, next;
751 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
755 arg_list.erase(iter);
758 arg_list.erase(iter);
765 int extract_append(arg_list_t &arg_list,string &filename)
767 arg_list_t::iterator iter, next;
770 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
772 if(*iter=="--append")
774 arg_list.erase(iter);
777 arg_list.erase(iter);
784 int extract_outfile(arg_list_t &arg_list,string &outfile)
786 arg_list_t::iterator iter, next;
787 int ret=SINFGTOOL_FILENOTFOUND;
790 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
794 arg_list.erase(iter);
797 arg_list.erase(iter);
805 int extract_canvasid(arg_list_t &arg_list,string &canvasid)
807 arg_list_t::iterator iter, next;
810 for(next=arg_list.begin(),iter=next++;iter!=arg_list.end();iter=next++)
814 arg_list.erase(iter);
817 arg_list.erase(iter);
824 /* === M E T H O D S ======================================================= */
826 /* === E N T R Y P O I N T ================================================= */
828 int main(int argc, char *argv[])
837 if(!SINFG_CHECK_VERSION())
839 cerr<<_("FATAL: Sinfg Version Mismatch")<<endl;
840 return SINFGTOOL_BADVERSION;
845 return SINFGTOOL_BLANK;
849 arg_list.push_back(argv[i]);
851 if((i=process_global_flags(arg_list)))
854 VERBOSE_OUT(1)<<_("verbosity set to ")<<verbosity<<endl;
855 sinfg::Main sinfg_main(dirname(progname),&p);
858 arg_list_t defaults, imageargs;
860 // Grab the defaults before the first file
861 extract_arg_cluster(arg_list,defaults);
863 while(arg_list.size())
866 job_list.push_front(Job());
870 job_list.front().filename=arg_list.front();
871 arg_list.pop_front();
873 extract_arg_cluster(arg_list,imageargs);
875 // Open the composition
877 job_list.front().root=open_canvas(job_list.front().filename);
879 if(!job_list.front().root)
881 cerr<<_("Unable to open ")<<job_list.front().filename<<"."<<endl;
882 cerr<<_("Throwing out job...")<<endl;
883 job_list.pop_front();
887 job_list.front().root->set_time(0);
890 extract_canvasid(imageargs,canvasid);
891 if(!canvasid.empty())
895 job_list.front().canvas=job_list.front().root->find_canvas(canvasid);
897 catch(Exception::IDNotFound)
899 cerr<<_("Unable to find canvas with ID \"")<<canvasid<<_("\" in ")<<job_list.front().filename<<"."<<endl;
900 cerr<<_("Throwing out job...")<<endl;
901 job_list.pop_front();
905 catch(Exception::BadLinkName)
907 cerr<<_("Invalid canvas name \"")<<canvasid<<_("\" in ")<<job_list.front().filename<<"."<<endl;
908 cerr<<_("Throwing out job...")<<endl;
909 job_list.pop_front();
915 job_list.front().canvas=job_list.front().root;
917 extract_RendDesc(imageargs,job_list.front().canvas->rend_desc());
918 extract_target(imageargs,target_name);
919 extract_threads(imageargs,threads);
920 job_list.front().quality=DEFAULT_QUALITY;
921 extract_quality(imageargs,job_list.front().quality);
922 VERBOSE_OUT(2)<<_("Quality set to ")<<job_list.front().quality<<endl;
923 job_list.front().desc=job_list.front().canvas->rend_desc();
924 extract_outfile(imageargs,job_list.front().outfilename);
928 string composite_file;
929 extract_append(imageargs,composite_file);
930 if(!composite_file.empty())
932 Canvas::Handle composite(open_canvas(composite_file));
935 Canvas::reverse_iterator iter;
936 for(iter=composite->rbegin();iter!=composite->rend();++iter)
938 Layer::Handle layer(*iter);
940 job_list.front().canvas->push_front(layer->clone());
942 VERBOSE_OUT(2)<<_("Appended contents of ")<<composite_file<<endl;
946 VERBOSE_OUT(4)<<_("Attempting to determine target/outfile...")<<endl;
948 // If the target type is not yet defined,
949 // try to figure it out from the outfile.
950 if(target_name.empty() && !job_list.front().outfilename.empty())
953 VERBOSE_OUT(3)<<_("Target name undefined, attempting to figure it out")<<endl;
954 string ext=string(find(job_list.front().outfilename.begin(),job_list.front().outfilename.end(),'.')+1,job_list.front().outfilename.end());
955 if(Target::ext_book().count(ext))
956 target_name=Target::ext_book()[ext];
960 catch(std::length_error)
962 sinfg::warning("Length error caught when attempting to figure out target name");
965 // If the target type is STILL not yet defined, then
966 // set it to a some sort of default
967 if(target_name.empty())
969 VERBOSE_OUT(2)<<_("Defaulting to PNG target...")<<endl;
973 // If no output filename was provided, then
974 // create a output filename based on the
975 // given input filename. (ie: change the extension)
976 if(job_list.front().outfilename.empty())
978 job_list.front().outfilename=job_list.front().filename;
979 job_list.front().outfilename.erase(find(job_list.front().outfilename.begin(),job_list.front().outfilename.end(),'.'),job_list.front().outfilename.end());
980 job_list.front().outfilename+='.';
981 if(Target::book().count(target_name))
982 job_list.front().outfilename+=Target::book()[target_name].second;
984 job_list.front().outfilename+=target_name;
987 VERBOSE_OUT(4)<<"target_name="<<target_name<<endl;
988 VERBOSE_OUT(4)<<"outfile_name="<<job_list.front().outfilename<<endl;
990 VERBOSE_OUT(4)<<_("Creating the target...")<<endl;
991 job_list.front().target=sinfg::Target::create(target_name,job_list.front().outfilename);
993 if(target_name=="sif")
995 job_list.front().sifout=true;
999 if(!job_list.front().target)
1001 cerr<<_("Unknown target for ")<<job_list.front().filename<<": "<<target_name<<endl;
1002 cerr<<_("Throwing out job...")<<endl;
1003 job_list.pop_front();
1006 job_list.front().sifout=false;
1009 // Set the Canvas on the Target
1010 if(job_list.front().target)
1012 VERBOSE_OUT(4)<<_("Setting the canvas on the target...")<<endl;
1013 job_list.front().target->set_canvas(job_list.front().canvas);
1014 VERBOSE_OUT(4)<<_("Setting the quality of the target...")<<endl;
1015 job_list.front().target->set_quality(job_list.front().quality);
1018 // Set the threads for the target
1019 if(job_list.front().target && Target_Scanline::Handle::cast_dynamic(job_list.front().target))
1021 Target_Scanline::Handle::cast_dynamic(job_list.front().target)->set_threads(threads);
1024 if(imageargs.size())
1026 cerr<<_("Unidentified arguments for ")<<job_list.front().filename<<": ";
1027 for(;imageargs.size();imageargs.pop_front())
1028 cerr<<' '<<imageargs.front();
1030 cerr<<_("Throwing out job...")<<endl;
1031 job_list.pop_front();
1035 //getline(cin,bleh);
1041 cerr<<_("Unidentified arguments:");
1042 for(;arg_list.size();arg_list.pop_front())
1043 cerr<<' '<<arg_list.front();
1045 return SINFGTOOL_UNKNOWNARGUMENT;
1048 if(!job_list.size())
1050 cerr<<_("Nothing to do!")<<endl;
1051 return SINFGTOOL_BORRED;
1054 for(;job_list.size();job_list.pop_front())
1056 VERBOSE_OUT(3)<<job_list.front().filename<<" -- "<<endl<<'\t'<<
1057 strprintf("w:%d, h:%d, a:%d, pxaspect:%f, imaspect:%f, span:%f",
1058 job_list.front().desc.get_w(),
1059 job_list.front().desc.get_h(),
1060 job_list.front().desc.get_antialias(),
1061 job_list.front().desc.get_pixel_aspect(),
1062 job_list.front().desc.get_image_aspect(),
1063 job_list.front().desc.get_span()
1065 strprintf("tl:[%f,%f], br:[%f,%f], focus:[%f,%f]",
1066 job_list.front().desc.get_tl()[0],job_list.front().desc.get_tl()[1],
1067 job_list.front().desc.get_br()[0],job_list.front().desc.get_br()[1],
1068 job_list.front().desc.get_focus()[0],job_list.front().desc.get_focus()[1]
1072 p.task(job_list.front().filename+" ==> "+job_list.front().outfilename);
1073 if(!job_list.front().sifout)
1075 VERBOSE_OUT(1)<<_("Rendering...")<<endl;
1078 // Call the render member of the target
1079 if(!job_list.front().target->render(&p))
1081 cerr<<"Render Failure."<<endl;
1082 return SINFGTOOL_RENDERFAILURE;
1084 if(print_benchmarks)
1086 cout<<job_list.front().filename+": Rendered in "<<timer()<<" seconds."<<endl;
1091 if(!save_canvas(job_list.front().outfilename,job_list.front().canvas))
1093 cerr<<"Render Failure."<<endl;
1094 return SINFGTOOL_RENDERFAILURE;
1101 VERBOSE_OUT(1)<<_("Done.")<<endl;
1103 return SINFGTOOL_OK;