add VIPS_COMBINE_MIN combining mode

for vips_compass()
This commit is contained in:
John Cupitt 2017-11-02 12:34:01 +00:00
parent 55e577a2fb
commit 487c112807
5 changed files with 15 additions and 1 deletions

View File

@ -33,6 +33,7 @@
- "--size Nx" to vipsthumbnail was broken, thanks jrochkind
- fix build with gcc 7
- add vips_fill_nearest() ... fill pixels with nearest colour
- add VIPS_COMBINE_MIN, a new combining mode for vips_compass()
29/8/17 started 8.5.9
- make --fail stop jpeg read on any libjpeg warning, thanks @mceachen

View File

@ -5,6 +5,8 @@
* 8/5/17
* - default to float ... int will often lose precision and should not be
* the default
* 2/11/17
* - add MIN mode
*/
/*
@ -116,6 +118,14 @@ vips_compass_build( VipsObject *object )
x = combine[0];
break;
case VIPS_COMBINE_MIN:
if( vips_bandrank( abs, &combine[0], compass->times,
"index", 0,
NULL ) )
return( -1 );
x = combine[0];
break;
case VIPS_COMBINE_SUM:
if( vips_sum( abs, &combine[0], compass->times, NULL ) )
return( -1 );

View File

@ -75,8 +75,9 @@
* VipsCombine:
* @VIPS_COMBINE_MAX: take the maximum of the possible values
* @VIPS_COMBINE_SUM: sum all the values
* @VIPS_COMBINE_MIN: take the minimum value
*
* How to combine values.
* How to combine values. See vips_compass(), for example.
*/
G_DEFINE_ABSTRACT_TYPE( VipsConvolution, vips_convolution,

View File

@ -41,6 +41,7 @@ extern "C" {
typedef enum {
VIPS_COMBINE_MAX,
VIPS_COMBINE_SUM,
VIPS_COMBINE_MIN,
VIPS_COMBINE_LAST
} VipsCombine;

View File

@ -836,6 +836,7 @@ vips_combine_get_type( void )
static const GEnumValue values[] = {
{VIPS_COMBINE_MAX, "VIPS_COMBINE_MAX", "max"},
{VIPS_COMBINE_SUM, "VIPS_COMBINE_SUM", "sum"},
{VIPS_COMBINE_MIN, "VIPS_COMBINE_MIN", "min"},
{VIPS_COMBINE_LAST, "VIPS_COMBINE_LAST", "last"},
{0, NULL, NULL}
};