// Output the color table
for(i=0;i<256/(1<<(8-rootsize));i++)
{
-// if(i && (i-1)<curr_palette.size())
+ if(i<(signed)curr_palette.size())
{
Color color(curr_palette[i].color.clamped());
//fputc(i*(1<<(8-rootsize)),file.get());
fputc(gamma().g_F32_to_U8(color.get_g()),file.get());
fputc(gamma().b_F32_to_U8(color.get_b()),file.get());
}
-/* else
+ else
{
fputc(255,file.get());
fputc(0,file.get());
fputc(255,file.get());
}
-*/
}
}
//horizontal part
if(size[0])
{
- int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
- length=std::max(1,length);
+ Real length=abs((float)w/(resolution[0]))*size[0]*0.5+1;
+ length=std::max(1.0,length);
//two box blurs produces: 1 2 1
- etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
- etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+ etl::hbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin());
+ etl::hbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin());
}
//else temp_surface2=worksurface;
//vertical part
if(size[1])
{
- int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
- length=std::max(1,length);
+ Real length=abs((float)h/(resolution[1]))*size[1]*0.5+1;
+ length=std::max(1.0,length);
//two box blurs produces: 1 2 1 on the horizontal 1 2 1
- etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
- etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+ etl::vbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin());
+ etl::vbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin());
}
//else temp_surface2=temp_surface2;
//horizontal part
if(size[0])
{
- int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1);
- length=std::max(1,length);
+ Real length=abs((float)w/(resolution[0]))*size[0]*0.5+1;
+ length=std::max(1.0,length);
//two box blurs produces: 1 2 1
- etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
- etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+ etl::hbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin());
+ etl::hbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin());
}
//else temp_surface2=worksurface;
//vertical part
if(size[1])
{
- int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1);
- length=std::max(1,length);
+ Real length=abs((float)h/(resolution[1]))*size[1]*0.5+1;
+ length=std::max(1.0,length);
//two box blurs produces: 1 2 1 on the horizontal 1 2 1
- etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin());
- etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin());
+ etl::vbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin());
+ etl::vbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin());
}
//else temp_surface2=temp_surface2;
//ret=Layer_Composite::get_param_vocab();
ret.push_back(ParamDesc("aperture")
- .set_local_name(_("Aperature"))
+ .set_local_name(_("Aperture"))
.set_description(_("Shutter Time"))
);
Target::Target():
quality_(4),
gamma_(*default_gamma_),
- remove_alpha(false)
+ remove_alpha(false),
+ avoid_time_sync_(false)
{
}
SYNFIGTOOL_INVALIDTARGET =6,
SYNFIGTOOL_RENDERFAILURE =7,
SYNFIGTOOL_BLANK =8,
- SYNFIGTOOL_BADVERSION =9
+ SYNFIGTOOL_BADVERSION =9,
+ SYNFIGTOOL_MISSINGARGUMENT =10
};
#ifndef VERSION
cluster.push_back(*iter);
arg_list.erase(iter);
iter=next++;
+ if (iter==arg_list.end()) {
+ error("The `%s' flag requires a value. Use --help for a list of options.", cluster.back().c_str());
+ return SYNFIGTOOL_MISSINGARGUMENT;
+ }
}
cluster.push_back(*iter);
w=atoi(iter->c_str());
arg_list.erase(iter);
}
- if(*iter=="-h")
+ else if(*iter=="-h")
{
arg_list.erase(iter);
iter=next++;
h=atoi(iter->c_str());
arg_list.erase(iter);
}
- if(*iter=="-a")
+ else if(*iter=="-a")
{
int a;
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Antialiasing set to %d, (%d samples per pixel)"),a,a*a)<<endl;
arg_list.erase(iter);
}
- if(*iter=="-s")
+ else if(*iter=="-s")
{
arg_list.erase(iter);
iter=next++;
VERBOSE_OUT(1)<<strprintf(_("Span set to %d units"),span)<<endl;
arg_list.erase(iter);
}
- if(*iter=="--fps")
+ else if(*iter=="--fps")
{
arg_list.erase(iter);
iter=next++;
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Frame rate set to %d frames per second"),fps)<<endl;
}
- if(*iter=="--dpi")
+ else if(*iter=="--dpi")
{
arg_list.erase(iter);
iter=next++;
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--dpi-x")
+ else if(*iter=="--dpi-x")
{
arg_list.erase(iter);
iter=next++;
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical X resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--dpi-y")
+ else if(*iter=="--dpi-y")
{
arg_list.erase(iter);
iter=next++;
arg_list.erase(iter);
VERBOSE_OUT(1)<<strprintf(_("Physical Y resolution set to %f dpi"),dpi)<<endl;
}
- if(*iter=="--start-time" || *iter=="--begin-time")
+ else if(*iter=="--start-time" || *iter=="--begin-time")
{
arg_list.erase(iter);
iter=next++;
desc.set_time_start(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
- if(*iter=="--end-time")
+ else if(*iter=="--end-time")
{
arg_list.erase(iter);
iter=next++;
desc.set_time_end(Time(*iter,desc.get_frame_rate()));
arg_list.erase(iter);
}
- if(*iter=="--time")
+ else if(*iter=="--time")
{
arg_list.erase(iter);
iter=next++;
VERBOSE_OUT(1)<<_("Rendering frame at ")<<desc.get_time_start().get_string(desc.get_frame_rate())<<endl;
arg_list.erase(iter);
}
- if(*iter=="-g")
+ else if(*iter=="-g")
{
synfig::warning("Gamma argument is currently ignored");
//arg_list.erase(iter);
{
arg_list_t defaults, imageargs;
+ int ret;
// Grab the defaults before the first file
- extract_arg_cluster(arg_list,defaults);
+ if ((ret = extract_arg_cluster(arg_list,defaults)) != SYNFIGTOOL_OK)
+ return ret;
while(arg_list.size())
{
job_list.front().filename=arg_list.front();
arg_list.pop_front();
- extract_arg_cluster(arg_list,imageargs);
+ if ((ret = extract_arg_cluster(arg_list,imageargs)) != SYNFIGTOOL_OK)
+ return ret;
// Open the composition
{
studio::Widget_NavView::Widget_NavView(CanvasView::LooseHandle cv)
:canvview(cv),
adj_zoom(0,-4,4,1,2),
+scrolling(false),
surface(new synfig::Surface)
{
attach(drawto,0,4,0,1);
adj_time_scrub(0,0,1000,1,10,0),
scr_time_scrub(adj_time_scrub),
b_loop(/*_("Loop")*/),
+currentindex(0),
+audiotime(0),
adj_sound(0,0,4),
l_lasttime("0s"),
playing(false)
widget_bline_width=manage(new Widget_Distance());
widget_bline_width->show();
+ bline_width_refresh();
widget_bline_width->set_digits(2);
widget_bline_width->set_size_request(24,-1);
widget_bline_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::on_bline_width_changed));
fg_color_refresh();
bg_color_refresh();
gradient_refresh();
- bline_width_refresh();
blend_method_refresh();
opacity_refresh();
interpolation_refresh();
Widget_Distance::Widget_Distance():
Gtk::SpinButton(0.05,5),
+ distance_(1, Distance::SYSTEM_POINTS),
adjustment(0,-100000000,100000000,1,1,1)
// adjustment(0,-100000000,100000000,1,2,0)
{
adj_default(0,0,2,1/defaultfps,10/defaultfps),
adj_timescale(0),
//invalidated(false),
+last_event_time(0),
fps(defaultfps),
dragscroll(false)
{
canvas(canvas_interface->get_canvas()),
scrollx_adjustment(0,-4,4,0.01,0.1),
scrolly_adjustment(0,-4,4,0.01,0.1),
+ w(128),
+ h(128),
+ last_event_time(0),
progresscallback(0),
dragging(DRAG_NONE),
show_grid(false),
protected:
CanvasSpecific(const synfig::Canvas::Handle &canvas):is_dirty_(true),mode_(MODE_UNDEFINED),canvas_(canvas) { }
- CanvasSpecific():mode_(MODE_UNDEFINED) { }
+ CanvasSpecific():is_dirty_(true), mode_(MODE_UNDEFINED) { }
virtual ~CanvasSpecific() { };
bool
CVSInfo::is_modified()const
{
+ if(!in_sandbox() || !in_repository())
+ return false;
#ifdef _DEBUG
synfig::info("%d-%d=%d",get_current_timestamp(),get_original_timestamp(),get_current_timestamp()-get_original_timestamp());
#endif
- if(!in_sandbox() || !in_repository())
- return false;
return get_current_timestamp()!=get_original_timestamp() && abs(get_current_timestamp()-get_original_timestamp())!=3600;
}