Commit a0dbb73f authored by Kaarlo Räihä's avatar Kaarlo Räihä Committed by Jean-Baptiste Kempf

Limit sigma range in gaussian blur

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4d36414a
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
static int Create ( vlc_object_t * ); static int Create ( vlc_object_t * );
static void Destroy ( vlc_object_t * ); static void Destroy ( vlc_object_t * );
#define SIGMA_MIN (0.01)
#define SIGMA_MAX (4096.0)
#define SIGMA_TEXT N_("Gaussian's std deviation") #define SIGMA_TEXT N_("Gaussian's std deviation")
#define SIGMA_LONGTEXT N_( \ #define SIGMA_LONGTEXT N_( \
"Gaussian's standard deviation. The blurring will take " \ "Gaussian's standard deviation. The blurring will take " \
...@@ -61,8 +64,9 @@ vlc_module_begin () ...@@ -61,8 +64,9 @@ vlc_module_begin ()
set_category( CAT_VIDEO ) set_category( CAT_VIDEO )
set_subcategory( SUBCAT_VIDEO_VFILTER ) set_subcategory( SUBCAT_VIDEO_VFILTER )
add_float( FILTER_PREFIX "sigma", 2., SIGMA_TEXT, SIGMA_LONGTEXT, add_float_with_range( FILTER_PREFIX "sigma", 2., SIGMA_MIN, SIGMA_MAX,
false ) SIGMA_TEXT, SIGMA_LONGTEXT,
false )
set_callbacks( Create, Destroy ) set_callbacks( Create, Destroy )
vlc_module_end () vlc_module_end ()
...@@ -159,7 +163,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -159,7 +163,7 @@ static int Create( vlc_object_t *p_this )
var_CreateGetFloat( p_filter, FILTER_PREFIX "sigma" ); var_CreateGetFloat( p_filter, FILTER_PREFIX "sigma" );
if( p_filter->p_sys->f_sigma <= 0. ) if( p_filter->p_sys->f_sigma <= 0. )
{ {
msg_Err( p_filter, "sigma must be positive" ); msg_Err( p_filter, "sigma must be greater than zero" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
gaussianblur_InitDistribution( p_filter->p_sys ); gaussianblur_InitDistribution( p_filter->p_sys );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment