convsep calls convasep when it can
This commit is contained in:
parent
e30bdadfb8
commit
036bd0bb4b
2
TODO
2
TODO
@ -1,3 +1,5 @@
|
|||||||
|
- convasep does not handle offset correctly
|
||||||
|
|
||||||
- test new clip stuff?
|
- test new clip stuff?
|
||||||
|
|
||||||
- add more webp tests to py suite
|
- add more webp tests to py suite
|
||||||
|
@ -63,6 +63,8 @@ vips_convsep_build( VipsObject *object )
|
|||||||
VipsImage **t = (VipsImage **)
|
VipsImage **t = (VipsImage **)
|
||||||
vips_object_local_array( object, 3 );
|
vips_object_local_array( object, 3 );
|
||||||
|
|
||||||
|
VipsImage *in;
|
||||||
|
|
||||||
g_object_set( convsep, "out", vips_image_new(), NULL );
|
g_object_set( convsep, "out", vips_image_new(), NULL );
|
||||||
|
|
||||||
if( VIPS_OBJECT_CLASS( vips_convsep_parent_class )->build( object ) )
|
if( VIPS_OBJECT_CLASS( vips_convsep_parent_class )->build( object ) )
|
||||||
@ -71,20 +73,32 @@ vips_convsep_build( VipsObject *object )
|
|||||||
if( vips_check_separable( class->nickname, convolution->M ) )
|
if( vips_check_separable( class->nickname, convolution->M ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
if( vips_rot( convolution->M, &t[0], VIPS_ANGLE_D90, NULL ) ||
|
in = convolution->in;
|
||||||
vips_conv( convolution->in, &t[1], convolution->M,
|
|
||||||
"precision", convsep->precision,
|
|
||||||
"layers", convsep->layers,
|
|
||||||
"cluster", convsep->cluster,
|
|
||||||
NULL ) ||
|
|
||||||
vips_conv( t[1], &t[2], t[0],
|
|
||||||
"precision", convsep->precision,
|
|
||||||
"layers", convsep->layers,
|
|
||||||
"cluster", convsep->cluster,
|
|
||||||
NULL ) )
|
|
||||||
return( -1 );
|
|
||||||
|
|
||||||
if( vips_image_write( t[2], convolution->out ) )
|
if( convsep->precision == VIPS_PRECISION_APPROXIMATE ) {
|
||||||
|
if( vips_convasep( convolution->in, &t[0], convolution->M,
|
||||||
|
"layers", convsep->layers,
|
||||||
|
NULL ) )
|
||||||
|
return( -1 );
|
||||||
|
in = t[0];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if( vips_rot( convolution->M, &t[0], VIPS_ANGLE_D90, NULL ) ||
|
||||||
|
vips_conv( convolution->in, &t[1], convolution->M,
|
||||||
|
"precision", convsep->precision,
|
||||||
|
"layers", convsep->layers,
|
||||||
|
"cluster", convsep->cluster,
|
||||||
|
NULL ) ||
|
||||||
|
vips_conv( t[1], &t[2], t[0],
|
||||||
|
"precision", convsep->precision,
|
||||||
|
"layers", convsep->layers,
|
||||||
|
"cluster", convsep->cluster,
|
||||||
|
NULL ) )
|
||||||
|
return( -1 );
|
||||||
|
in = t[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
if( vips_image_write( in, convolution->out ) )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
Loading…
Reference in New Issue
Block a user