better gauss mat generation

This commit is contained in:
John Cupitt 2016-03-10 22:01:55 +00:00
parent 4974a1ed9c
commit 2ca7b29214
3 changed files with 6 additions and 7 deletions

5
TODO
View File

@ -1,3 +1,5 @@
- rename l3 on top of reduce
- need tests for reducel3, test every kernel plues every numeric type
- removed the cache from resize since we no longer sharpen, can we get
@ -5,9 +7,6 @@
seeeeeeems ok?
- what demand hint are we setting for the reduce / shrink funcs?
- try SEQ_UNBUFFERED on jpg source, get out of order error?

View File

@ -20,6 +20,7 @@
* - use @precision, not @integer
* 10/3/16
* - allow 1x1 masks
* - better size calc
*/
/*
@ -132,7 +133,7 @@ vips_gaussmat_build( VipsObject *object )
vips_error( class->nickname, "%s", _( "mask too large" ) );
return( -1 );
}
width = x * 2 + 1;
width = 2 * x - 1;
height = gaussmat->separable ? 1 : width;
vips_image_init_fields( create->out,

View File

@ -146,14 +146,13 @@ vips_resize_build( VipsObject *object )
/* If the final affine will be doing a large downsample, we can get
* nasty aliasing on hard edges. Blur before affine to smooth this out.
*
* Don't blur for very small shrinks, blur with radius 1 for x1.5
* shrinks, blur radius 2 for x2.5 shrinks and above, etc.
* Don't blur for very small shrinks, start to blur above about .5.
*
* Don't try to be clever for non-rectangular shrinks. We just
* consider the horizontal factor.
*/
sigma = ((1.0 / hresidual) - 0.5) / 2.5;
anti_alias = hresidual < 0.9 && sigma > 0.1;
anti_alias = hresidual < 0.9 && sigma > 0.5;
if( anti_alias ) {
vips_info( class->nickname, "anti-alias sigma %g", sigma );
if( vips_gaussblur( in, &t[1], sigma, NULL ) )