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?
|
||||
|
||||
- add more webp tests to py suite
|
||||
|
@ -63,6 +63,8 @@ vips_convsep_build( VipsObject *object )
|
||||
VipsImage **t = (VipsImage **)
|
||||
vips_object_local_array( object, 3 );
|
||||
|
||||
VipsImage *in;
|
||||
|
||||
g_object_set( convsep, "out", vips_image_new(), NULL );
|
||||
|
||||
if( VIPS_OBJECT_CLASS( vips_convsep_parent_class )->build( object ) )
|
||||
@ -71,6 +73,16 @@ vips_convsep_build( VipsObject *object )
|
||||
if( vips_check_separable( class->nickname, convolution->M ) )
|
||||
return( -1 );
|
||||
|
||||
in = convolution->in;
|
||||
|
||||
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,
|
||||
@ -83,8 +95,10 @@ vips_convsep_build( VipsObject *object )
|
||||
"cluster", convsep->cluster,
|
||||
NULL ) )
|
||||
return( -1 );
|
||||
in = t[2];
|
||||
}
|
||||
|
||||
if( vips_image_write( t[2], convolution->out ) )
|
||||
if( vips_image_write( in, convolution->out ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
|
Loading…
Reference in New Issue
Block a user