From cb753e16fa7b8ff01c48db33d9380fc1e87fbd3d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 7 Nov 2011 14:21:26 +0000 Subject: [PATCH] oops, dropped im__value() --- libvips/arithmetic/im_stats.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libvips/arithmetic/im_stats.c b/libvips/arithmetic/im_stats.c index 26924ef4..9a4cdc10 100644 --- a/libvips/arithmetic/im_stats.c +++ b/libvips/arithmetic/im_stats.c @@ -136,6 +136,23 @@ im__wrapscan( VipsImage *in, &wrapscan, NULL ) ); } +/* Get the value of pixel (0, 0). Use this to init the min/max value for + * * im_max()/im_stats()/etc. + * */ +int +im__value( IMAGE *im, double *value ) +{ + IMAGE *t; + + if( !(t = im_open_local( im, "im__value", "p" )) || + im_extract_areabands( im, t, 0, 0, 1, 1, 0, 1 ) || + im_avg( t, value ) ) + return( -1 ); + + return( 0 ); +} + + /* Track min/max/sum/sum-of-squares for each thread during a scan. */ static void *