**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
/* === G L O B A L S ======================================================= */
SYNFIG_LAYER_INIT(Layer_MotionBlur);
/* === G L O B A L S ======================================================= */
SYNFIG_LAYER_INIT(Layer_MotionBlur);
SYNFIG_LAYER_SET_LOCAL_NAME(Layer_MotionBlur,_("Motion Blur"));
SYNFIG_LAYER_SET_CATEGORY(Layer_MotionBlur,_("Blurs"));
SYNFIG_LAYER_SET_VERSION(Layer_MotionBlur,"0.1");
SYNFIG_LAYER_SET_LOCAL_NAME(Layer_MotionBlur,_("Motion Blur"));
SYNFIG_LAYER_SET_CATEGORY(Layer_MotionBlur,_("Blurs"));
SYNFIG_LAYER_SET_VERSION(Layer_MotionBlur,"0.1");
Time time(time_cur);
time+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) *aperture -aperture*0.5;
context.set_time(time, pos);
Time time(time_cur);
time+=(Vector::value_type)( (signed)(RAND_MAX/2)-(signed)rand() )/(Vector::value_type)(RAND_MAX) *aperture -aperture*0.5;
context.set_time(time, pos);
return ret;
}
bool
Layer_MotionBlur::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
{
return ret;
}
bool
Layer_MotionBlur::accelerated_render(Context context,Surface *surface,int quality, const RendDesc &renddesc, ProgressCallback *cb)const
{
for(i=0;i<samples;i++)
{
subimagecb=SuperCallback(cb,i*(5000/samples),(i+1)*(5000/samples),5000);
for(i=0;i<samples;i++)
{
subimagecb=SuperCallback(cb,i*(5000/samples),(i+1)*(5000/samples),5000);
if(!context.accelerated_render(&tmp,quality,renddesc,&subimagecb))
return false;
if(!context.accelerated_render(&tmp,quality,renddesc,&subimagecb))
return false;
}
else
return context.accelerated_render(surface,quality,renddesc,cb);
}
else
return context.accelerated_render(surface,quality,renddesc,cb);