add low/high to smartcrop

smartcrop attention had a centre setting, but not low or high

see https://github.com/libvips/libvips/issues/1089
This commit is contained in:
John Cupitt 2018-09-22 14:47:40 +01:00
parent 3850774b39
commit 9ac5a449f2
4 changed files with 20 additions and 0 deletions

View File

@ -1,4 +1,6 @@
21/9/18 started 8.8.0
- much faster smartcrop [lovell]
- add low/high to smartcrop [jcupitt]
23/9/18 started 8.7.1
- update function list in docs [janko-m]

View File

@ -8,6 +8,10 @@
* - revised attention smartcrop
* 8/6/17
* - revised again
* 15/9/18 lovell
* - move shrink to start of processing
* 22/9/18 jcupitt
* - add low and high
*/
/*
@ -352,6 +356,16 @@ vips_smartcrop_build( VipsObject *object )
return( -1 );
break;
case VIPS_INTERESTING_LOW:
left = 0;
top = 0;
break;
case VIPS_INTERESTING_HIGH:
left = smartcrop->in->Xsize - smartcrop->width;
top = smartcrop->in->Ysize - smartcrop->height;
break;
default:
g_assert_not_reached();

View File

@ -99,6 +99,8 @@ typedef enum {
VIPS_INTERESTING_CENTRE,
VIPS_INTERESTING_ENTROPY,
VIPS_INTERESTING_ATTENTION,
VIPS_INTERESTING_LOW,
VIPS_INTERESTING_HIGH,
VIPS_INTERESTING_LAST
} VipsInteresting;

View File

@ -364,6 +364,8 @@ vips_interesting_get_type( void )
{VIPS_INTERESTING_CENTRE, "VIPS_INTERESTING_CENTRE", "centre"},
{VIPS_INTERESTING_ENTROPY, "VIPS_INTERESTING_ENTROPY", "entropy"},
{VIPS_INTERESTING_ATTENTION, "VIPS_INTERESTING_ATTENTION", "attention"},
{VIPS_INTERESTING_LOW, "VIPS_INTERESTING_LOW", "low"},
{VIPS_INTERESTING_HIGH, "VIPS_INTERESTING_HIGH", "high"},
{VIPS_INTERESTING_LAST, "VIPS_INTERESTING_LAST", "last"},
{0, NULL, NULL}
};