Merge branch 'master' of github.com:jcupitt/libvips
Conflicts: TODO
This commit is contained in:
commit
20eb893350
@ -1,3 +1,10 @@
|
||||
25/7/14 started 7.41.0
|
||||
- start working on --disable-deprecated
|
||||
|
||||
25/7/14 started 7.40.5
|
||||
- fix a race in im_maxpos_avg()
|
||||
- limit n_thr on tiny images
|
||||
|
||||
4/7/14 started 7.40.4
|
||||
- fix vips_rawsave_fd(), thanks aferrero2707
|
||||
- fix im_point()
|
||||
|
29
TODO
29
TODO
@ -1,34 +1,9 @@
|
||||
- vips_object_unref_outputs() needs docs ... bindings will need it
|
||||
|
||||
- rewrite im_conv() etc. as vips_conv()
|
||||
|
||||
finally finish --disable-deprecated option
|
||||
|
||||
- maxpos_avg seems to give variable results
|
||||
|
||||
irb(main):022:0> im.maxpos_avg
|
||||
=> [141.0, 138.0, 248.0]
|
||||
irb(main):023:0> im.maxpos_avg
|
||||
=> [73.0, 95.0, 248.0]
|
||||
|
||||
[107.0, 116.5, 248.0] is correct, checked by hand
|
||||
|
||||
$ vips max --size 10 spec/samples/wagon.v --x-array --y-array --out-array
|
||||
72 107 78 73 74 75 99 100 141 73
|
||||
95 141 94 94 94 95 131 131 138 95
|
||||
245 246 246 247 247 247 247 247 248 248
|
||||
248.000000
|
||||
|
||||
so there are two maxes of 248, result should be average of the two
|
||||
|
||||
seems to be a race in maxpos_avg, it's still some Tom code, replace with a
|
||||
wrapper over vips_max()
|
||||
|
||||
hard to do, since vips_max() needs to be told in advance the number of maxes
|
||||
it should search for
|
||||
|
||||
|
||||
|
||||
|
||||
- threadpool recyling might be useful for dzsave?
|
||||
|
||||
|
||||
- check and fix up docs
|
||||
|
30
configure.ac
30
configure.ac
@ -2,7 +2,7 @@
|
||||
|
||||
# also update the version number in the m4 macros below
|
||||
|
||||
AC_INIT([vips], [7.40.4], [vipsip@jiscmail.ac.uk])
|
||||
AC_INIT([vips], [7.41.0], [vipsip@jiscmail.ac.uk])
|
||||
# required for gobject-introspection
|
||||
AC_PREREQ(2.62)
|
||||
|
||||
@ -17,8 +17,8 @@ AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
# user-visible library versioning
|
||||
m4_define([vips_major_version], [7])
|
||||
m4_define([vips_minor_version], [40])
|
||||
m4_define([vips_micro_version], [4])
|
||||
m4_define([vips_minor_version], [41])
|
||||
m4_define([vips_micro_version], [0])
|
||||
m4_define([vips_version],
|
||||
[vips_major_version.vips_minor_version.vips_micro_version])
|
||||
|
||||
@ -38,7 +38,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date`
|
||||
# binary interface changes not backwards compatible?: reset age to 0
|
||||
|
||||
LIBRARY_CURRENT=38
|
||||
LIBRARY_REVISION=2
|
||||
LIBRARY_REVISION=3
|
||||
LIBRARY_AGE=0
|
||||
|
||||
# patched into include/vips/version.h
|
||||
@ -124,9 +124,26 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# option to disable deprecated code, shaves a bit off the library size
|
||||
AC_ARG_ENABLE(deprecated,
|
||||
AS_HELP_STRING([--enable-deprecated], [build deprecated components (default: yes)]))
|
||||
|
||||
VIPS_ENABLE_DEPRECATED=0
|
||||
if test x"$enable_deprecated" != x"no"; then
|
||||
VIPS_ENABLE_DEPRECATED=1
|
||||
enable_deprecated=yes
|
||||
AM_CONDITIONAL(ENABLE_DEPRECATED, true)
|
||||
else
|
||||
AM_CONDITIONAL(ENABLE_DEPRECATED, false)
|
||||
fi
|
||||
|
||||
# this gets pasted into version.h as a #define
|
||||
AC_SUBST(VIPS_ENABLE_DEPRECATED)
|
||||
|
||||
# we are a C library with some optional C++ components inside it
|
||||
# on most platforms, we just include -lstdc++ in the link line for programs
|
||||
# using vips, but not all
|
||||
|
||||
# on most platforms, but not all, we just include -lstdc++ in the link line
|
||||
# for programs
|
||||
|
||||
# we ought to write a proper configure test for this :(
|
||||
|
||||
@ -806,6 +823,7 @@ native win32: $vips_os_win32
|
||||
native OS X: $vips_os_darwin
|
||||
open files in binary mode: $vips_binary_open
|
||||
enable debug: $enable_debug
|
||||
build deprecated components: $enable_deprecated
|
||||
build C++ components: $enable_cxx
|
||||
build docs with gtkdoc: $enable_gtk_doc
|
||||
install docs: $enable_docs
|
||||
|
@ -1,12 +1,21 @@
|
||||
OPTIONAL_COMPILE_DIR =
|
||||
OPTIONAL_DIST_DIR =
|
||||
OPTIONAL_LIB =
|
||||
|
||||
# only build in the cimg dir if C++ is enabled
|
||||
if ENABLE_CXX
|
||||
C_COMPILE_DIR = cimg
|
||||
C_DIST_DIR =
|
||||
C_LIB = cimg/libcimg.la
|
||||
OPTIONAL_COMPILE_DIR += cimg
|
||||
OPTIONAL_LIB += cimg/libcimg.la
|
||||
else
|
||||
C_COMPILE_DIR =
|
||||
C_DIST_DIR = cimg
|
||||
C_LIB =
|
||||
OPTIONAL_DIST_DIR += cimg
|
||||
endif
|
||||
|
||||
# same for deprecated
|
||||
if ENABLE_DEPRECATED
|
||||
OPTIONAL_COMPILE_DIR += deprecated
|
||||
OPTIONAL_LIB += deprecated/libdeprecated.la
|
||||
else
|
||||
OPTIONAL_DIST_DIR += deprecated
|
||||
endif
|
||||
|
||||
SUBDIRS = \
|
||||
@ -16,9 +25,8 @@ SUBDIRS = \
|
||||
resample \
|
||||
colour \
|
||||
conversion \
|
||||
deprecated \
|
||||
convolution \
|
||||
$(C_COMPILE_DIR) \
|
||||
$(OPTIONAL_COMPILE_DIR) \
|
||||
freqfilt \
|
||||
histogram \
|
||||
draw \
|
||||
@ -49,8 +57,7 @@ libvips_la_LIBADD = \
|
||||
colour/libcolour.la \
|
||||
conversion/libconversion.la \
|
||||
convolution/libconvolution.la \
|
||||
deprecated/libdeprecated.la \
|
||||
$(C_LIB) \
|
||||
$(OPTIONAL_LIB) \
|
||||
foreign/libforeign.la \
|
||||
freqfilt/libfreqfilt.la \
|
||||
histogram/libhistogram.la \
|
||||
@ -71,7 +78,7 @@ libvips_la_LDFLAGS = \
|
||||
-version-info @LIBRARY_CURRENT@:@LIBRARY_REVISION@:@LIBRARY_AGE@
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(C_DIST_DIR)
|
||||
$(OPTIONAL_DIST_DIR)
|
||||
|
||||
CLEANFILES =
|
||||
|
||||
|
@ -464,7 +464,7 @@ vips_arithmetic_gen( VipsRegion *or,
|
||||
VipsRegion **ir = (VipsRegion **) seq;
|
||||
VipsArithmetic *arithmetic = VIPS_ARITHMETIC( b );
|
||||
VipsArithmeticClass *class = VIPS_ARITHMETIC_GET_CLASS( arithmetic );
|
||||
Rect *r = &or->valid;
|
||||
VipsRect *r = &or->valid;
|
||||
|
||||
VipsPel *p[MAX_INPUT_IMAGES], *q;
|
||||
int i, y;
|
||||
|
@ -106,7 +106,8 @@ vips_avg_build( VipsObject *object )
|
||||
vips_image_get_height( statistic->in ) *
|
||||
vips_image_get_bands( statistic->in );
|
||||
average = avg->sum / vals;
|
||||
if( vips_bandfmt_iscomplex( vips_image_get_format( statistic->in ) ) )
|
||||
if( vips_band_format_iscomplex(
|
||||
vips_image_get_format( statistic->in ) ) )
|
||||
average = sqrt( average );
|
||||
g_object_set( object, "out", average, NULL );
|
||||
|
||||
|
@ -135,7 +135,7 @@ G_DEFINE_TYPE( VipsComplex, vips_complex, VIPS_TYPE_UNARY );
|
||||
double am, ph; \
|
||||
\
|
||||
am = sqrt( re * re + im * im ); \
|
||||
ph = im_col_ab2h( re, im ); \
|
||||
ph = vips_col_ab2h( re, im ); \
|
||||
\
|
||||
Q[0] = am; \
|
||||
Q[1] = ph; \
|
||||
|
@ -129,12 +129,12 @@ vips_math_build( VipsObject *object )
|
||||
|
||||
/* sin/cos/tan in degrees.
|
||||
*/
|
||||
#define DSIN( X ) (sin( IM_RAD( X ) ))
|
||||
#define DCOS( X ) (cos( IM_RAD( X ) ))
|
||||
#define DTAN( X ) (tan( IM_RAD( X ) ))
|
||||
#define ADSIN( X ) (IM_DEG( asin( X ) ))
|
||||
#define ADCOS( X ) (IM_DEG( acos( X ) ))
|
||||
#define ADTAN( X ) (IM_DEG( atan( X ) ))
|
||||
#define DSIN( X ) (sin( VIPS_RAD( X ) ))
|
||||
#define DCOS( X ) (cos( VIPS_RAD( X ) ))
|
||||
#define DTAN( X ) (tan( VIPS_RAD( X ) ))
|
||||
#define ADSIN( X ) (VIPS_DEG( asin( X ) ))
|
||||
#define ADCOS( X ) (VIPS_DEG( acos( X ) ))
|
||||
#define ADTAN( X ) (VIPS_DEG( atan( X ) ))
|
||||
|
||||
/* exp10() is a gnu extension, use pow().
|
||||
*/
|
||||
|
@ -197,7 +197,8 @@ vips_max_build( VipsObject *object )
|
||||
|
||||
/* For speed we accumulate max ** 2 for complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( vips_image_get_format( statistic->in ) ) ) {
|
||||
if( vips_band_format_iscomplex(
|
||||
vips_image_get_format( statistic->in ) ) ) {
|
||||
int i;
|
||||
|
||||
for( i = 0; i < values->n; i++ )
|
||||
|
@ -199,7 +199,8 @@ vips_min_build( VipsObject *object )
|
||||
|
||||
/* For speed we accumulate min ** 2 for complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( vips_image_get_format( statistic->in ) ) ) {
|
||||
if( vips_band_format_iscomplex(
|
||||
vips_image_get_format( statistic->in ) ) ) {
|
||||
int i;
|
||||
|
||||
for( i = 0; i < values->n; i++ )
|
||||
|
@ -75,7 +75,7 @@ vips_round_build( VipsObject *object )
|
||||
* is.
|
||||
*/
|
||||
if( unary->in &&
|
||||
vips_bandfmt_isint( unary->in->BandFmt ) )
|
||||
vips_band_format_isint( unary->in->BandFmt ) )
|
||||
return( vips_unary_copy( unary ) );
|
||||
|
||||
if( VIPS_OBJECT_CLASS( vips_round_parent_class )->build( object ) )
|
||||
@ -115,7 +115,7 @@ vips_round_buffer( VipsArithmetic *arithmetic,
|
||||
/* Complex just doubles the size.
|
||||
*/
|
||||
const int sz = width * im->Bands *
|
||||
(vips_bandfmt_iscomplex( im->BandFmt ) ? 2 : 1);
|
||||
(vips_band_format_iscomplex( im->BandFmt ) ? 2 : 1);
|
||||
|
||||
int x;
|
||||
|
||||
|
@ -87,7 +87,7 @@ G_DEFINE_ABSTRACT_TYPE( VipsUnaryConst, vips_unary_const, VIPS_TYPE_UNARY );
|
||||
*/
|
||||
static VipsPel *
|
||||
make_pixel( VipsObject *obj,
|
||||
int m, VipsBandFmt fmt, int n, double * restrict p )
|
||||
int m, VipsBandFormat fmt, int n, double * restrict p )
|
||||
{
|
||||
VipsPel *q;
|
||||
int i;
|
||||
|
@ -62,7 +62,7 @@ typedef struct _VipsUnaryConst {
|
||||
/* The format the constant should be cast to. Subclasses set this
|
||||
* ready for unaryconst's build method.
|
||||
*/
|
||||
VipsBandFmt const_format;
|
||||
VipsBandFormat const_format;
|
||||
|
||||
/* Our constant expanded to match arith->ready in size and
|
||||
* const_format in type.
|
||||
|
@ -145,12 +145,12 @@ vips_col_dE00( float L1, float a1, float b1,
|
||||
|
||||
/* RT, T.
|
||||
*/
|
||||
double RT = -sin( IM_RAD( 2 * dtheta ) ) * RC;
|
||||
double RT = -sin( VIPS_RAD( 2 * dtheta ) ) * RC;
|
||||
double T = 1 -
|
||||
0.17 * cos( IM_RAD( hdb - 30 ) ) +
|
||||
0.24 * cos( IM_RAD( 2 * hdb ) ) +
|
||||
0.32 * cos( IM_RAD( 3 * hdb + 6 ) ) -
|
||||
0.20 * cos( IM_RAD( 4 * hdb - 63 ) );
|
||||
0.17 * cos( VIPS_RAD( hdb - 30 ) ) +
|
||||
0.24 * cos( VIPS_RAD( 2 * hdb ) ) +
|
||||
0.32 * cos( VIPS_RAD( 3 * hdb + 6 ) ) -
|
||||
0.20 * cos( VIPS_RAD( 4 * hdb - 63 ) );
|
||||
|
||||
/* SL, SC, SH
|
||||
*/
|
||||
@ -169,7 +169,7 @@ vips_col_dE00( float L1, float a1, float b1,
|
||||
*/
|
||||
double dLd = L1d - L2d;
|
||||
double dCd = C1d - C2d;
|
||||
double dHd = 2 * sqrt( C1d * C2d ) * sin( IM_RAD( dhd / 2 ) );
|
||||
double dHd = 2 * sqrt( C1d * C2d ) * sin( VIPS_RAD( dhd / 2 ) );
|
||||
|
||||
/* Parametric factors for viewing parameters.
|
||||
*/
|
||||
|
@ -87,7 +87,7 @@ vips_bandary_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
||||
VipsRegion **ir = (VipsRegion **) seq;
|
||||
VipsBandary *bandary = (VipsBandary *) b;
|
||||
VipsBandaryClass *class = VIPS_BANDARY_GET_CLASS( bandary );
|
||||
Rect *r = &or->valid;
|
||||
VipsRect *r = &or->valid;
|
||||
|
||||
VipsPel *p[MAX_INPUT_IMAGES], *q;
|
||||
int y, i;
|
||||
|
@ -125,7 +125,8 @@ vips_bandmean_buffer( VipsBandary *bandary,
|
||||
{
|
||||
VipsImage *im = bandary->ready[0];
|
||||
const int bands = im->Bands;
|
||||
const int sz = width * (vips_bandfmt_iscomplex( im->BandFmt ) ? 2 : 1);
|
||||
const int sz = width *
|
||||
(vips_band_format_iscomplex( im->BandFmt ) ? 2 : 1);
|
||||
|
||||
int i, j;
|
||||
|
||||
|
@ -272,100 +272,3 @@ vips_conversion_operation_init( void )
|
||||
vips_falsecolour_get_type();
|
||||
vips_gamma_get_type();
|
||||
}
|
||||
|
||||
/* The common part of most binary conversion
|
||||
* operators. We:
|
||||
*
|
||||
* - check in and out
|
||||
* - cast in1 and in2 up to a common format
|
||||
* - equalise bands
|
||||
* - make an input array
|
||||
* - return the matched images in vec[0] and vec[1]
|
||||
*
|
||||
* A left-over, remove soon.
|
||||
*/
|
||||
IMAGE **
|
||||
im__insert_base( const char *domain,
|
||||
IMAGE *in1, IMAGE *in2, IMAGE *out )
|
||||
{
|
||||
IMAGE *t[4];
|
||||
IMAGE **vec;
|
||||
|
||||
if( im_piocheck( in1, out ) ||
|
||||
im_pincheck( in2 ) ||
|
||||
im_check_bands_1orn( domain, in1, in2 ) ||
|
||||
im_check_coding_known( domain, in1 ) ||
|
||||
im_check_coding_same( domain, in1, in2 ) )
|
||||
return( NULL );
|
||||
|
||||
/* Cast our input images up to a common format and bands.
|
||||
*/
|
||||
if( im_open_local_array( out, t, 4, domain, "p" ) ||
|
||||
im__formatalike( in1, in2, t[0], t[1] ) ||
|
||||
im__bandalike( domain, t[0], t[1], t[2], t[3] ) ||
|
||||
!(vec = im_allocate_input_array( out, t[2], t[3], NULL )) )
|
||||
return( NULL );
|
||||
|
||||
/* Generate the output.
|
||||
*/
|
||||
if( im_cp_descv( out, vec[0], vec[1], NULL ) ||
|
||||
im_demand_hint_array( out, IM_SMALLTILE, vec ) )
|
||||
return( NULL );
|
||||
|
||||
return( vec );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_insertset:
|
||||
* @main: big image
|
||||
* @sub: small image
|
||||
* @out: output image
|
||||
* @n: number of positions
|
||||
* @x: left positions of @sub
|
||||
* @y: top positions of @sub
|
||||
*
|
||||
* Insert @sub repeatedly into @main at the positions listed in the arrays @x,
|
||||
* @y of length @n. @out is the same
|
||||
* size as @main. @sub is clipped against the edges of @main.
|
||||
*
|
||||
* This operation is fast for large @n, but will use a memory buffer the size
|
||||
* of @out. It's useful for things like making scatter plots.
|
||||
*
|
||||
* If the number of bands differs, one of the images
|
||||
* must have one band. In this case, an n-band image is formed from the
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: im_insert(), im_lrjoin().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y )
|
||||
{
|
||||
IMAGE **vec;
|
||||
IMAGE *t;
|
||||
int i;
|
||||
|
||||
if( !(vec = im__insert_base( "im_insert", main, sub, out )) )
|
||||
return( -1 );
|
||||
|
||||
/* Copy to a memory image, zap that, then copy to out.
|
||||
*/
|
||||
if( !(t = im_open_local( out, "im_insertset", "t" )) ||
|
||||
im_copy( vec[0], t ) )
|
||||
return( -1 );
|
||||
|
||||
for( i = 0; i < n; i++ )
|
||||
if( im_insertplace( t, vec[1], x[i], y[i] ) )
|
||||
return( -1 );
|
||||
|
||||
if( im_copy( t, out ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ vips_embed_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
||||
VipsEmbed *embed = (VipsEmbed *) b;
|
||||
VipsRect *r = &or->valid;
|
||||
|
||||
Rect ovl;
|
||||
VipsRect ovl;
|
||||
int i;
|
||||
VipsPel *p;
|
||||
int plsk;
|
||||
|
@ -93,7 +93,7 @@ vips_grid_gen( VipsRegion *or, void *vseq, void *a, void *b,
|
||||
/* If the request fits inside a single tile, we can just pointer-copy.
|
||||
*/
|
||||
if( vips_rect_includesrect( &tile, r ) ) {
|
||||
Rect irect;
|
||||
VipsRect irect;
|
||||
|
||||
/* Translate request to input space.
|
||||
*/
|
||||
|
@ -169,7 +169,7 @@ vips_insert_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
|
||||
VipsRect *r = &or->valid;
|
||||
VipsInsert *insert = (VipsInsert *) b;
|
||||
|
||||
Rect ovl;
|
||||
VipsRect ovl;
|
||||
|
||||
/* Does the rect we have been asked for fall entirely inside the
|
||||
* sub-image?
|
||||
|
@ -190,7 +190,7 @@ vips_msb_build( VipsObject *object )
|
||||
msb->band > 0 )
|
||||
msb->sign = TRUE;
|
||||
if( msb->in->Coding == VIPS_CODING_NONE &&
|
||||
!vips_bandfmt_isuint( msb->in->BandFmt ) )
|
||||
!vips_band_format_isuint( msb->in->BandFmt ) )
|
||||
msb->sign = TRUE;
|
||||
|
||||
if( msb->band == -1 &&
|
||||
|
@ -176,7 +176,7 @@ vips_recomb_build( VipsObject *object )
|
||||
return( -1 );
|
||||
|
||||
conversion->out->Bands = recomb->m->Ysize;
|
||||
if( vips_bandfmt_isint( in->BandFmt ) )
|
||||
if( vips_band_format_isint( in->BandFmt ) )
|
||||
conversion->out->BandFmt = VIPS_FORMAT_FLOAT;
|
||||
|
||||
if( vips_image_generate( conversion->out,
|
||||
|
@ -102,9 +102,9 @@ vips_rot90_gen( VipsRegion *or, void *seq, void *a, void *b,
|
||||
*/
|
||||
VipsRect *r = &or->valid;
|
||||
int le = r->left;
|
||||
int ri = IM_RECT_RIGHT(r);
|
||||
int ri = VIPS_RECT_RIGHT(r);
|
||||
int to = r->top;
|
||||
int bo = IM_RECT_BOTTOM(r);
|
||||
int bo = VIPS_RECT_BOTTOM(r);
|
||||
|
||||
int x, y, i;
|
||||
|
||||
@ -164,9 +164,9 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b,
|
||||
*/
|
||||
VipsRect *r = &or->valid;
|
||||
int le = r->left;
|
||||
int ri = IM_RECT_RIGHT(r);
|
||||
int ri = VIPS_RECT_RIGHT(r);
|
||||
int to = r->top;
|
||||
int bo = IM_RECT_BOTTOM(r);
|
||||
int bo = VIPS_RECT_BOTTOM(r);
|
||||
|
||||
int x, y;
|
||||
|
||||
@ -176,7 +176,7 @@ vips_rot180_gen( VipsRegion *or, void *seq, void *a, void *b,
|
||||
|
||||
/* Find the area of the input image we need.
|
||||
*/
|
||||
Rect need;
|
||||
VipsRect need;
|
||||
|
||||
need.left = in->Xsize - ri;
|
||||
need.top = in->Ysize - bo;
|
||||
@ -225,9 +225,9 @@ vips_rot270_gen( VipsRegion *or, void *seq, void *a, void *b,
|
||||
*/
|
||||
VipsRect *r = &or->valid;
|
||||
int le = r->left;
|
||||
int ri = IM_RECT_RIGHT(r);
|
||||
int ri = VIPS_RECT_RIGHT(r);
|
||||
int to = r->top;
|
||||
int bo = IM_RECT_BOTTOM(r);
|
||||
int bo = VIPS_RECT_BOTTOM(r);
|
||||
|
||||
int x, y, i;
|
||||
|
||||
|
@ -245,7 +245,7 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
|
||||
int to = r->top;
|
||||
int bo = IM_RECT_BOTTOM(r);
|
||||
int sz = IM_REGION_N_ELEMENTS( or ) *
|
||||
(vips_bandfmt_iscomplex( in->BandFmt ) ? 2 : 1);
|
||||
(vips_band_format_iscomplex( in->BandFmt ) ? 2 : 1);
|
||||
|
||||
int x, y, z, i;
|
||||
|
||||
|
@ -183,7 +183,7 @@ int im_linreg( IMAGE **ins, IMAGE *out, double *xs ){
|
||||
}
|
||||
}
|
||||
else {
|
||||
if( vips_bandfmt_iscomplex( ins[ 0 ]->BandFmt ) ){
|
||||
if( vips_band_format_iscomplex( ins[ 0 ]->BandFmt ) ){
|
||||
im_error( FUNCTION_NAME, "image has non-scalar band format" );
|
||||
return( -1 );
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
* 8/9/08
|
||||
* - rewrite from im_maxpos()
|
||||
* - now handles many bands, complex, faster
|
||||
* 27/7/14
|
||||
* - fix a race ... did not merge states if max was equal
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -116,6 +118,11 @@ maxposavg_stop( void *seq, void *a, void *b )
|
||||
*/
|
||||
if( maxposavg->max > global_maxposavg->max )
|
||||
*global_maxposavg = *maxposavg;
|
||||
else if( maxposavg->max == global_maxposavg->max ) {
|
||||
global_maxposavg->xpos += maxposavg->xpos;
|
||||
global_maxposavg->ypos += maxposavg->ypos;
|
||||
global_maxposavg->occurences += maxposavg->occurences;
|
||||
}
|
||||
|
||||
im_free( seq );
|
||||
|
||||
@ -252,7 +259,7 @@ im_maxpos_avg( IMAGE *in, double *xpos, double *ypos, double *out )
|
||||
|
||||
/* We use square mod for scanning, for speed.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( in->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( in->BandFmt ) )
|
||||
global_maxposavg->max *= global_maxposavg->max;
|
||||
|
||||
if( vips_sink( in, maxposavg_start, maxposavg_scan, maxposavg_stop,
|
||||
@ -261,7 +268,7 @@ im_maxpos_avg( IMAGE *in, double *xpos, double *ypos, double *out )
|
||||
|
||||
/* Back to modulus.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( in->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( in->BandFmt ) )
|
||||
global_maxposavg->max = sqrt( global_maxposavg->max );
|
||||
|
||||
if( xpos )
|
||||
|
@ -118,7 +118,7 @@ im_resize_linear( IMAGE *in, IMAGE *out, int X, int Y )
|
||||
|
||||
if( im_iocheck( in, out ) )
|
||||
return( -1 );
|
||||
if( vips_bandfmt_iscomplex( in->BandFmt ) ) {
|
||||
if( vips_band_format_iscomplex( in->BandFmt ) ) {
|
||||
im_error( "im_lowpass", "%s", _( "non-complex input only" ) );
|
||||
return( -1 );
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ im_isfloat( IMAGE *im )
|
||||
gboolean
|
||||
im_iscomplex( IMAGE *im )
|
||||
{
|
||||
return( vips_bandfmt_iscomplex( im->BandFmt ) );
|
||||
return( vips_band_format_iscomplex( im->BandFmt ) );
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -769,8 +769,8 @@ static int bandfmt_largest[6][6] = {
|
||||
static VipsBandFmt
|
||||
im__format_common( VipsBandFmt in1, VipsBandFmt in2 )
|
||||
{
|
||||
if( vips_bandfmt_iscomplex( in1 ) ||
|
||||
vips_bandfmt_iscomplex( in2 ) ) {
|
||||
if( vips_band_format_iscomplex( in1 ) ||
|
||||
vips_band_format_iscomplex( in2 ) ) {
|
||||
/* What kind of complex?
|
||||
*/
|
||||
if( in1 == IM_BANDFMT_DPCOMPLEX || in2 == IM_BANDFMT_DPCOMPLEX )
|
||||
@ -5255,3 +5255,100 @@ im_tbmerge1( IMAGE *ref, IMAGE *sec, IMAGE *out,
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/* The common part of most binary conversion
|
||||
* operators. We:
|
||||
*
|
||||
* - check in and out
|
||||
* - cast in1 and in2 up to a common format
|
||||
* - equalise bands
|
||||
* - make an input array
|
||||
* - return the matched images in vec[0] and vec[1]
|
||||
*
|
||||
* A left-over, remove soon.
|
||||
*/
|
||||
IMAGE **
|
||||
im__insert_base( const char *domain,
|
||||
IMAGE *in1, IMAGE *in2, IMAGE *out )
|
||||
{
|
||||
IMAGE *t[4];
|
||||
IMAGE **vec;
|
||||
|
||||
if( im_piocheck( in1, out ) ||
|
||||
im_pincheck( in2 ) ||
|
||||
im_check_bands_1orn( domain, in1, in2 ) ||
|
||||
im_check_coding_known( domain, in1 ) ||
|
||||
im_check_coding_same( domain, in1, in2 ) )
|
||||
return( NULL );
|
||||
|
||||
/* Cast our input images up to a common format and bands.
|
||||
*/
|
||||
if( im_open_local_array( out, t, 4, domain, "p" ) ||
|
||||
im__formatalike( in1, in2, t[0], t[1] ) ||
|
||||
im__bandalike( domain, t[0], t[1], t[2], t[3] ) ||
|
||||
!(vec = im_allocate_input_array( out, t[2], t[3], NULL )) )
|
||||
return( NULL );
|
||||
|
||||
/* Generate the output.
|
||||
*/
|
||||
if( im_cp_descv( out, vec[0], vec[1], NULL ) ||
|
||||
im_demand_hint_array( out, IM_SMALLTILE, vec ) )
|
||||
return( NULL );
|
||||
|
||||
return( vec );
|
||||
}
|
||||
|
||||
/**
|
||||
* im_insertset:
|
||||
* @main: big image
|
||||
* @sub: small image
|
||||
* @out: output image
|
||||
* @n: number of positions
|
||||
* @x: left positions of @sub
|
||||
* @y: top positions of @sub
|
||||
*
|
||||
* Insert @sub repeatedly into @main at the positions listed in the arrays @x,
|
||||
* @y of length @n. @out is the same
|
||||
* size as @main. @sub is clipped against the edges of @main.
|
||||
*
|
||||
* This operation is fast for large @n, but will use a memory buffer the size
|
||||
* of @out. It's useful for things like making scatter plots.
|
||||
*
|
||||
* If the number of bands differs, one of the images
|
||||
* must have one band. In this case, an n-band image is formed from the
|
||||
* one-band image by joining n copies of the one-band image together, and then
|
||||
* the two n-band images are operated upon.
|
||||
*
|
||||
* The two input images are cast up to the smallest common type (see table
|
||||
* Smallest common format in
|
||||
* <link linkend="VIPS-arithmetic">arithmetic</link>).
|
||||
*
|
||||
* See also: im_insert(), im_lrjoin().
|
||||
*
|
||||
* Returns: 0 on success, -1 on error
|
||||
*/
|
||||
int
|
||||
im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y )
|
||||
{
|
||||
IMAGE **vec;
|
||||
IMAGE *t;
|
||||
int i;
|
||||
|
||||
if( !(vec = im__insert_base( "im_insert", main, sub, out )) )
|
||||
return( -1 );
|
||||
|
||||
/* Copy to a memory image, zap that, then copy to out.
|
||||
*/
|
||||
if( !(t = im_open_local( out, "im_insertset", "t" )) ||
|
||||
im_copy( vec[0], t ) )
|
||||
return( -1 );
|
||||
|
||||
for( i = 0; i < n; i++ )
|
||||
if( im_insertplace( t, vec[1], x[i], y[i] ) )
|
||||
return( -1 );
|
||||
|
||||
if( im_copy( t, out ) )
|
||||
return( -1 );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
@ -437,7 +437,7 @@ get_vips_properties( struct dsr *d,
|
||||
}
|
||||
|
||||
static void
|
||||
attach_meta( IMAGE *out, struct dsr *d )
|
||||
attach_meta( VipsImage *out, struct dsr *d )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -351,7 +351,7 @@ fits2vips_generate( VipsRegion *out,
|
||||
void *seq, void *a, void *b, gboolean *stop )
|
||||
{
|
||||
VipsFits *fits = (VipsFits *) a;
|
||||
Rect *r = &out->valid;
|
||||
VipsRect *r = &out->valid;
|
||||
|
||||
VipsPel *q;
|
||||
int z;
|
||||
|
@ -622,7 +622,7 @@ write_ppm_line_binary( VipsImage *in, FILE *fp, VipsPel *p )
|
||||
}
|
||||
|
||||
static int
|
||||
write_ppm_block( REGION *region, Rect *area, void *a )
|
||||
write_ppm_block( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
Write *write = (Write *) a;
|
||||
int i;
|
||||
|
@ -1227,7 +1227,7 @@ vips2rad_put_header( Write *write )
|
||||
}
|
||||
|
||||
static int
|
||||
vips2rad_put_data_block( VipsRegion *region, Rect *area, void *a )
|
||||
vips2rad_put_data_block( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
Write *write = (Write *) a;
|
||||
int i;
|
||||
|
@ -88,7 +88,7 @@ vips_foreign_save_raw_dispose( GObject *gobject )
|
||||
}
|
||||
|
||||
static int
|
||||
vips_foreign_save_raw_write( VipsRegion *region, Rect *area, void *a )
|
||||
vips_foreign_save_raw_write( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
VipsForeignSave *save = (VipsForeignSave *) a;
|
||||
VipsForeignSaveRaw *raw = (VipsForeignSaveRaw *) a;
|
||||
@ -195,7 +195,7 @@ G_DEFINE_TYPE( VipsForeignSaveRawFd, vips_foreign_save_raw_fd,
|
||||
VIPS_TYPE_FOREIGN_SAVE );
|
||||
|
||||
static int
|
||||
vips_foreign_save_raw_fd_write( VipsRegion *region, Rect *area, void *a )
|
||||
vips_foreign_save_raw_fd_write( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
VipsForeignSave *save = (VipsForeignSave *) a;
|
||||
VipsForeignSaveRawFd *fd = (VipsForeignSaveRawFd *) a;
|
||||
|
@ -825,7 +825,7 @@ write_profile_meta( Write *write )
|
||||
}
|
||||
|
||||
static int
|
||||
write_jpeg_block( REGION *region, Rect *area, void *a )
|
||||
write_jpeg_block( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
Write *write = (Write *) a;
|
||||
int i;
|
||||
|
@ -1343,7 +1343,7 @@ make_tiff_write( VipsImage *im, const char *filename,
|
||||
*/
|
||||
if( tw->pyramid ) {
|
||||
if( im->Coding == VIPS_CODING_NONE &&
|
||||
vips_bandfmt_iscomplex( im->BandFmt ) ) {
|
||||
vips_band_format_iscomplex( im->BandFmt ) ) {
|
||||
vips_error( "vips2tiff",
|
||||
"%s", _( "can only pyramid LABQ and "
|
||||
"non-complex images" ) );
|
||||
|
@ -729,7 +729,7 @@ write_new( VipsImage *in )
|
||||
}
|
||||
|
||||
static int
|
||||
write_png_block( VipsRegion *region, Rect *area, void *a )
|
||||
write_png_block( VipsRegion *region, VipsRect *area, void *a )
|
||||
{
|
||||
Write *write = (Write *) a;
|
||||
|
||||
|
@ -80,7 +80,7 @@ vips_freqmult_build( VipsObject *object )
|
||||
|
||||
in = freqfilt->in;
|
||||
|
||||
if( vips_bandfmt_iscomplex( in->BandFmt ) ) {
|
||||
if( vips_band_format_iscomplex( in->BandFmt ) ) {
|
||||
if( vips_multiply( in, freqmult->mask, &t[0], NULL ) ||
|
||||
vips_invfft( t[0], &t[1], "real", TRUE, NULL ) )
|
||||
return( -1 );
|
||||
|
@ -309,7 +309,7 @@ vips_fwfft_build( VipsObject *object )
|
||||
return( -1 );
|
||||
in = t[0];
|
||||
|
||||
if( vips_bandfmt_iscomplex( in->BandFmt ) ) {
|
||||
if( vips_band_format_iscomplex( in->BandFmt ) ) {
|
||||
if( vips__fftproc( VIPS_OBJECT( fwfft ), in, &t[1],
|
||||
cfwfft1 ) )
|
||||
return( -1 );
|
||||
|
@ -87,7 +87,8 @@ vips_hist_cum_process( VipsHistogram *histogram,
|
||||
VipsPel *out, VipsPel **in, int width )
|
||||
{
|
||||
const int bands = vips_image_get_bands( histogram->ready[0] );
|
||||
const int nb = vips_bandfmt_iscomplex( histogram->ready[0]->BandFmt ) ?
|
||||
const int nb =
|
||||
vips_band_format_iscomplex( histogram->ready[0]->BandFmt ) ?
|
||||
bands * 2 : bands;
|
||||
int mx = width * nb;
|
||||
|
||||
|
@ -292,6 +292,8 @@ int im_allocate_vargv( im_function *fn, im_object *vargv );
|
||||
*/
|
||||
int im_run_command( char *name, int argc, char **argv );
|
||||
|
||||
int vips__input_interpolate_init( im_object *obj, char *str );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /*__cplusplus*/
|
||||
|
@ -105,7 +105,8 @@ void vips__cache_init( void );
|
||||
void vips__type_leak( void );
|
||||
|
||||
typedef int (*im__fftproc_fn)( VipsImage *, VipsImage *, VipsImage * );
|
||||
int im__fftproc( IMAGE *dummy, IMAGE *in, IMAGE *out, im__fftproc_fn fn );
|
||||
int im__fftproc( VipsImage *dummy,
|
||||
VipsImage *in, VipsImage *out, im__fftproc_fn fn );
|
||||
|
||||
/* iofuncs
|
||||
*/
|
||||
@ -164,109 +165,6 @@ int vips__sizealike( VipsImage *in1, VipsImage *in2,
|
||||
int vips__bandalike( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage **out1, VipsImage **out2 );
|
||||
|
||||
|
||||
void im__format_init( void );
|
||||
|
||||
void im__tiff_register( void );
|
||||
void im__jpeg_register( void );
|
||||
void im__png_register( void );
|
||||
void im__csv_register( void );
|
||||
void im__ppm_register( void );
|
||||
void im__analyze_register( void );
|
||||
void im__exr_register( void );
|
||||
void im__magick_register( void );
|
||||
|
||||
int im__bandup( const char *domain, VipsImage *in, VipsImage *out, int n );
|
||||
int im__bandalike_vec( const char *domain, VipsImage **in, VipsImage **out, int n );
|
||||
int im__bandalike( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 );
|
||||
int im__formatalike_vec( VipsImage **in, VipsImage **out, int n );
|
||||
int im__formatalike( VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 );
|
||||
int im__sizealike_vec( VipsImage **in, VipsImage **out, int n );
|
||||
int im__sizealike( VipsImage *in1, VipsImage *in2,
|
||||
VipsImage *out1, VipsImage *out2 );
|
||||
|
||||
int im__arith_binary( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out,
|
||||
int format_table[10],
|
||||
im_wrapmany_fn fn, void *b );
|
||||
int im__arith_binary_const( const char *domain,
|
||||
VipsImage *in, VipsImage *out,
|
||||
int n, double *c, VipsBandFormat vfmt,
|
||||
int format_table[10],
|
||||
im_wrapone_fn fn1, im_wrapone_fn fnn );
|
||||
int im__value( VipsImage *im, double *value );
|
||||
typedef int (*im__wrapscan_fn)( void *p, int n, void *seq, void *a, void *b );
|
||||
int im__wrapscan( VipsImage *in,
|
||||
VipsStartFn start, im__wrapscan_fn scan, VipsStopFn stop,
|
||||
void *a, void *b );
|
||||
int im__colour_difference( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out,
|
||||
im_wrapmany_fn buffer_fn, void *a, void *b );
|
||||
int im__colour_unary( const char *domain,
|
||||
VipsImage *in, VipsImage *out, VipsInterpretation interpretation,
|
||||
im_wrapone_fn buffer_fn, void *a, void *b );
|
||||
VipsImage **im__insert_base( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out );
|
||||
|
||||
int im__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out,
|
||||
int bandno_in,
|
||||
int xref, int yref, int xsec, int ysec,
|
||||
int halfcorrelation, int halfarea,
|
||||
int *dx0, int *dy0,
|
||||
double *scale1, double *angle1, double *dx1, double *dy1 );
|
||||
int im__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out,
|
||||
int bandno_in,
|
||||
int xref, int yref, int xsec, int ysec,
|
||||
int halfcorrelation, int halfarea,
|
||||
int *dx0, int *dy0,
|
||||
double *scale1, double *angle1, double *dx1, double *dy1 );
|
||||
int im__find_best_contrast( VipsImage *image,
|
||||
int xpos, int ypos, int xsize, int ysize,
|
||||
int xarray[], int yarray[], int cont[],
|
||||
int nbest, int hcorsize );
|
||||
int im__balance( VipsImage *ref, VipsImage *sec, VipsImage *out,
|
||||
VipsImage **ref_out, VipsImage **sec_out, int dx, int dy, int balancetype );
|
||||
|
||||
void imb_LCh2Lab( float *, float *, int );
|
||||
|
||||
/* A colour temperature.
|
||||
*/
|
||||
typedef struct {
|
||||
double X0, Y0, Z0;
|
||||
} im_colour_temperature;
|
||||
|
||||
void imb_XYZ2Lab( float *, float *, int, im_colour_temperature * );
|
||||
void imb_LabS2Lab( signed short *, float *, int );
|
||||
void imb_Lab2LabS( float *, signed short *, int n );
|
||||
|
||||
void vips__Lab2LabQ_vec( VipsPel *out, float *in, int width );
|
||||
void vips__LabQ2Lab_vec( float *out, VipsPel *in, int width );
|
||||
|
||||
void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix );
|
||||
void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask );
|
||||
|
||||
int *im_ivector();
|
||||
float *im_fvector();
|
||||
double *im_dvector();
|
||||
void im_free_ivector();
|
||||
void im_free_fvector();
|
||||
void im_free_dvector();
|
||||
|
||||
int **im_imat_alloc();
|
||||
float **im_fmat_alloc();
|
||||
double **im_dmat_alloc();
|
||||
void im_free_imat();
|
||||
void im_free_fmat();
|
||||
void im_free_dmat();
|
||||
|
||||
int im_invmat( double **, int );
|
||||
|
||||
int *im_offsets45( int size );
|
||||
|
||||
int im_conv_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask );
|
||||
int im_convsep_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask );
|
||||
|
||||
/* draw
|
||||
*/
|
||||
VipsPel *vips__vector_to_ink( const char *domain,
|
||||
@ -318,10 +216,9 @@ void vips_mosaicing_operation_init( void );
|
||||
guint64 vips__parse_size( const char *size_string );
|
||||
int vips__substitute( const char *domain, char *buf, size_t len, char *sub );
|
||||
|
||||
IMAGE *vips__deprecated_open_read( const char *filename, gboolean sequential );
|
||||
IMAGE *vips__deprecated_open_write( const char *filename );
|
||||
|
||||
int vips__input_interpolate_init( im_object *obj, char *str );
|
||||
int vips_check_coding_labq( const char *domain, VipsImage *im );
|
||||
int vips_check_coding_rad( const char *domain, VipsImage *im );
|
||||
int vips_check_bands_3ormore( const char *domain, VipsImage *im );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -14,5 +14,6 @@
|
||||
* it.
|
||||
*/
|
||||
#define VIPS_EXEEXT "@VIPS_EXEEXT@"
|
||||
#define VIPS_ENABLE_DEPRECATED @VIPS_ENABLE_DEPRECATED@
|
||||
|
||||
#endif /*VIPS_VERSION_H*/
|
||||
|
@ -147,16 +147,19 @@ extern "C" {
|
||||
#include <vips/video.h>
|
||||
#include <vips/cimg_funcs.h>
|
||||
|
||||
#ifndef VIPS_DISABLE_VIPS7COMPAT
|
||||
#include <vips/vips7compat.h>
|
||||
#endif /*VIPS_DISABLE_VIPS7COMPAT*/
|
||||
|
||||
#ifdef VIPS_ENABLE_DEPRECATED
|
||||
/* This stuff is very, very old and should not be used by anyone now.
|
||||
*/
|
||||
#ifdef VIPS_ENABLE_ANCIENT
|
||||
#include <vips/deprecated.h>
|
||||
#endif /*VIPS_ENABLE_DEPRECATED*/
|
||||
#endif /*VIPS_ENABLE_ANCIENT*/
|
||||
|
||||
#include <vips/almostdeprecated.h>
|
||||
/* Still in use, but can be turned off.
|
||||
*/
|
||||
#if VIPS_ENABLE_DEPRECATED
|
||||
#include <vips/vips7compat.h>
|
||||
#include <vips/dispatch.h>
|
||||
#include <vips/almostdeprecated.h>
|
||||
#endif /*VIPS_ENABLE_DEPRECATED*/
|
||||
|
||||
/* We can't use _ here since this will be compiled by our clients and they may
|
||||
* not have _().
|
||||
|
@ -442,10 +442,6 @@ G_STMT_START { \
|
||||
|
||||
#define im__change_suffix vips__change_suffix
|
||||
|
||||
int vips_check_coding_labq( const char *domain, VipsImage *im );
|
||||
int vips_check_coding_rad( const char *domain, VipsImage *im );
|
||||
int vips_check_bands_3ormore( const char *domain, VipsImage *im );
|
||||
|
||||
/* Buffer processing.
|
||||
*/
|
||||
typedef void (*im_wrapone_fn)( void *in, void *out, int width,
|
||||
@ -1106,6 +1102,111 @@ int vips_foreign_load( const char *filename, VipsImage **out, ... )
|
||||
int vips_foreign_save( VipsImage *in, const char *filename, ... )
|
||||
__attribute__((sentinel));
|
||||
|
||||
VipsImage *vips__deprecated_open_read( const char *filename, gboolean sequential );
|
||||
VipsImage *vips__deprecated_open_write( const char *filename );
|
||||
|
||||
void im__format_init( void );
|
||||
|
||||
void im__tiff_register( void );
|
||||
void im__jpeg_register( void );
|
||||
void im__png_register( void );
|
||||
void im__csv_register( void );
|
||||
void im__ppm_register( void );
|
||||
void im__analyze_register( void );
|
||||
void im__exr_register( void );
|
||||
void im__magick_register( void );
|
||||
|
||||
int im__bandup( const char *domain, VipsImage *in, VipsImage *out, int n );
|
||||
int im__bandalike_vec( const char *domain, VipsImage **in, VipsImage **out, int n );
|
||||
int im__bandalike( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 );
|
||||
int im__formatalike_vec( VipsImage **in, VipsImage **out, int n );
|
||||
int im__formatalike( VipsImage *in1, VipsImage *in2, VipsImage *out1, VipsImage *out2 );
|
||||
int im__sizealike_vec( VipsImage **in, VipsImage **out, int n );
|
||||
int im__sizealike( VipsImage *in1, VipsImage *in2,
|
||||
VipsImage *out1, VipsImage *out2 );
|
||||
|
||||
int im__arith_binary( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out,
|
||||
int format_table[10],
|
||||
im_wrapmany_fn fn, void *b );
|
||||
int im__arith_binary_const( const char *domain,
|
||||
VipsImage *in, VipsImage *out,
|
||||
int n, double *c, VipsBandFormat vfmt,
|
||||
int format_table[10],
|
||||
im_wrapone_fn fn1, im_wrapone_fn fnn );
|
||||
int im__value( VipsImage *im, double *value );
|
||||
typedef int (*im__wrapscan_fn)( void *p, int n, void *seq, void *a, void *b );
|
||||
int im__wrapscan( VipsImage *in,
|
||||
VipsStartFn start, im__wrapscan_fn scan, VipsStopFn stop,
|
||||
void *a, void *b );
|
||||
int im__colour_difference( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out,
|
||||
im_wrapmany_fn buffer_fn, void *a, void *b );
|
||||
int im__colour_unary( const char *domain,
|
||||
VipsImage *in, VipsImage *out, VipsInterpretation interpretation,
|
||||
im_wrapone_fn buffer_fn, void *a, void *b );
|
||||
VipsImage **im__insert_base( const char *domain,
|
||||
VipsImage *in1, VipsImage *in2, VipsImage *out );
|
||||
|
||||
int im__find_lroverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out,
|
||||
int bandno_in,
|
||||
int xref, int yref, int xsec, int ysec,
|
||||
int halfcorrelation, int halfarea,
|
||||
int *dx0, int *dy0,
|
||||
double *scale1, double *angle1, double *dx1, double *dy1 );
|
||||
int im__find_tboverlap( VipsImage *ref_in, VipsImage *sec_in, VipsImage *out,
|
||||
int bandno_in,
|
||||
int xref, int yref, int xsec, int ysec,
|
||||
int halfcorrelation, int halfarea,
|
||||
int *dx0, int *dy0,
|
||||
double *scale1, double *angle1, double *dx1, double *dy1 );
|
||||
int im__find_best_contrast( VipsImage *image,
|
||||
int xpos, int ypos, int xsize, int ysize,
|
||||
int xarray[], int yarray[], int cont[],
|
||||
int nbest, int hcorsize );
|
||||
int im__balance( VipsImage *ref, VipsImage *sec, VipsImage *out,
|
||||
VipsImage **ref_out, VipsImage **sec_out, int dx, int dy, int balancetype );
|
||||
|
||||
void imb_LCh2Lab( float *, float *, int );
|
||||
|
||||
/* A colour temperature.
|
||||
*/
|
||||
typedef struct {
|
||||
double X0, Y0, Z0;
|
||||
} im_colour_temperature;
|
||||
|
||||
void imb_XYZ2Lab( float *, float *, int, im_colour_temperature * );
|
||||
void imb_LabS2Lab( signed short *, float *, int );
|
||||
void imb_Lab2LabS( float *, signed short *, int n );
|
||||
|
||||
void vips__Lab2LabQ_vec( VipsPel *out, float *in, int width );
|
||||
void vips__LabQ2Lab_vec( float *out, VipsPel *in, int width );
|
||||
|
||||
void im_copy_dmask_matrix( DOUBLEMASK *mask, double **matrix );
|
||||
void im_copy_matrix_dmask( double **matrix, DOUBLEMASK *mask );
|
||||
|
||||
int *im_ivector();
|
||||
float *im_fvector();
|
||||
double *im_dvector();
|
||||
void im_free_ivector();
|
||||
void im_free_fvector();
|
||||
void im_free_dvector();
|
||||
|
||||
int **im_imat_alloc();
|
||||
float **im_fmat_alloc();
|
||||
double **im_dmat_alloc();
|
||||
void im_free_imat();
|
||||
void im_free_fmat();
|
||||
void im_free_dmat();
|
||||
|
||||
int im_invmat( double **, int );
|
||||
|
||||
int *im_offsets45( int size );
|
||||
|
||||
int im_conv_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask );
|
||||
int im_convsep_f_raw( VipsImage *in, VipsImage *out, DOUBLEMASK *mask );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /*__cplusplus*/
|
||||
|
@ -13,6 +13,8 @@
|
||||
* 17/7/10
|
||||
* - set pool->error whenever we set thr->error, lets us catch allocate
|
||||
* errors (thanks Tim)
|
||||
* 25/7/14
|
||||
* - limit nthr on tiny images
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -344,24 +346,6 @@ vips_concurrency_get( void )
|
||||
return( nthr );
|
||||
}
|
||||
|
||||
/**
|
||||
* VipsThreadState:
|
||||
* @im: the #VipsImage being operated upon
|
||||
* @reg: a #REGION
|
||||
* @pos: a #Rect
|
||||
* @x: an int
|
||||
* @y: an int
|
||||
* @a: client data
|
||||
*
|
||||
* These per-thread values are carried around for your use by
|
||||
* vips_threadpool_run(). They are private to each thread, so they are a
|
||||
* useful place
|
||||
* for #VipsThreadpoolAllocate and #VipsThreadpoolWork to communicate.
|
||||
*
|
||||
* @reg is created for you at the start of processing and freed at the end,
|
||||
* but you can do what you like with it.
|
||||
*/
|
||||
|
||||
G_DEFINE_TYPE( VipsThreadState, vips_thread_state, VIPS_TYPE_OBJECT );
|
||||
|
||||
static void
|
||||
@ -706,6 +690,10 @@ static VipsThreadpool *
|
||||
vips_threadpool_new( VipsImage *im )
|
||||
{
|
||||
VipsThreadpool *pool;
|
||||
int tile_width;
|
||||
int tile_height;
|
||||
int n_tiles;
|
||||
int n_lines;
|
||||
|
||||
/* Allocate and init new thread block.
|
||||
*/
|
||||
@ -723,6 +711,14 @@ vips_threadpool_new( VipsImage *im )
|
||||
pool->stop = FALSE;
|
||||
pool->done_first = FALSE;
|
||||
|
||||
/* If this is a tiny image, we won't need all nthr threads. Guess how
|
||||
* many tiles we might need to cover the image and use that to limit
|
||||
* the number of threads we create.
|
||||
*/
|
||||
vips_get_tile_size( im, &tile_width, &tile_height, &n_lines );
|
||||
n_tiles = (1 + im->Xsize / tile_width) * (1 + im->Ysize / tile_height);
|
||||
pool->nthr = VIPS_MIN( pool->nthr, n_tiles );
|
||||
|
||||
/* Attach tidy-up callback.
|
||||
*/
|
||||
g_signal_connect( im, "close",
|
||||
@ -937,7 +933,7 @@ vips_threadpool_run( VipsImage *im,
|
||||
* @im: image to guess for
|
||||
* @tile_width: return selected tile width
|
||||
* @tile_height: return selected tile height
|
||||
* @nlines: return buffer height in scanlines
|
||||
* @n_lines: return buffer height in scanlines
|
||||
*
|
||||
* Pick a tile size and a buffer height for this image and the current
|
||||
* value of vips_concurrency_get(). The buffer height
|
||||
@ -945,7 +941,7 @@ vips_threadpool_run( VipsImage *im,
|
||||
*/
|
||||
void
|
||||
vips_get_tile_size( VipsImage *im,
|
||||
int *tile_width, int *tile_height, int *nlines )
|
||||
int *tile_width, int *tile_height, int *n_lines )
|
||||
{
|
||||
const int nthr = vips_concurrency_get();
|
||||
|
||||
@ -972,25 +968,25 @@ vips_get_tile_size( VipsImage *im,
|
||||
g_assert( 0 );
|
||||
}
|
||||
|
||||
/* We can't set nlines for the current demand style: a later bit of
|
||||
/* We can't set n_lines for the current demand style: a later bit of
|
||||
* the pipeline might see a different hint and we need to synchronise
|
||||
* buffer sizes everywhere.
|
||||
*
|
||||
* Pick the maximum buffer size we might possibly need, then round up
|
||||
* to a multiple of tileheight.
|
||||
*/
|
||||
*nlines = vips__tile_height *
|
||||
*n_lines = vips__tile_height *
|
||||
(1 + nthr / VIPS_MAX( 1, im->Xsize / vips__tile_width )) * 2;
|
||||
*nlines = VIPS_MAX( *nlines, vips__fatstrip_height * nthr * 2 );
|
||||
*nlines = VIPS_MAX( *nlines, vips__thinstrip_height * nthr * 2 );
|
||||
*nlines = ROUND_UP( *nlines, *tile_height );
|
||||
*n_lines = VIPS_MAX( *n_lines, vips__fatstrip_height * nthr * 2 );
|
||||
*n_lines = VIPS_MAX( *n_lines, vips__thinstrip_height * nthr * 2 );
|
||||
*n_lines = ROUND_UP( *n_lines, *tile_height );
|
||||
|
||||
/* We make this assumption in several places.
|
||||
*/
|
||||
g_assert( *nlines % *tile_height == 0 );
|
||||
g_assert( *n_lines % *tile_height == 0 );
|
||||
|
||||
VIPS_DEBUG_MSG( "vips_get_tile_size: %d by %d patches, "
|
||||
"groups of %d scanlines\n",
|
||||
*tile_width, *tile_height, *nlines );
|
||||
*tile_width, *tile_height, *n_lines );
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ find_first( REGION *ir, int *pos, int x, int y, int w )
|
||||
|
||||
/* Double the number of bands in a complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( im->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( im->BandFmt ) )
|
||||
ne *= 2;
|
||||
|
||||
/* Search for the first non-zero band element from the left edge of the image.
|
||||
@ -236,7 +236,7 @@ find_last( REGION *ir, int *pos, int x, int y, int w )
|
||||
|
||||
/* Double the number of bands in a complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( im->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( im->BandFmt ) )
|
||||
ne *= 2;
|
||||
|
||||
/* Search for the first non-zero band element from the right.
|
||||
|
@ -129,7 +129,7 @@ find_top( REGION *ir, int *pos, int x, int y, int h )
|
||||
|
||||
/* Double the number of bands in a complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( im->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( im->BandFmt ) )
|
||||
b *= 2;
|
||||
|
||||
/* Search for the first non-zero band element from the top edge of the image.
|
||||
@ -183,7 +183,7 @@ find_bot( REGION *ir, int *pos, int x, int y, int h )
|
||||
|
||||
/* Double the number of bands in a complex.
|
||||
*/
|
||||
if( vips_bandfmt_iscomplex( im->BandFmt ) )
|
||||
if( vips_band_format_iscomplex( im->BandFmt ) )
|
||||
b *= 2;
|
||||
|
||||
/* Search for the first non-zero band element from the top edge of the image.
|
||||
|
@ -797,7 +797,8 @@ vips_interpolate_lbb_interpolate( VipsInterpolate* restrict interpolate,
|
||||
*/
|
||||
const int actual_bands = in->im->Bands;
|
||||
const int bands =
|
||||
vips_bandfmt_iscomplex( in->im->BandFmt ) ? 2 * actual_bands : actual_bands;
|
||||
vips_band_format_iscomplex( in->im->BandFmt ) ?
|
||||
2 * actual_bands : actual_bands;
|
||||
|
||||
/* Confirm that absolute_x and absolute_y are >= 1, see above.
|
||||
*/
|
||||
|
@ -1518,7 +1518,8 @@ vips_interpolate_nohalo_interpolate( VipsInterpolate* restrict interpolate,
|
||||
*/
|
||||
const int actual_bands = in->im->Bands;
|
||||
const int bands =
|
||||
vips_bandfmt_iscomplex( in->im->BandFmt ) ? 2 * actual_bands : actual_bands;
|
||||
vips_band_format_iscomplex( in->im->BandFmt ) ?
|
||||
2 * actual_bands : actual_bands;
|
||||
|
||||
/* Confirm that absolute_x and absolute_y are >= 2, see above.
|
||||
*/
|
||||
|
@ -135,7 +135,7 @@ vips_shrink_start( VipsImage *out, void *a, void *b )
|
||||
VipsShrink *shrink = (VipsShrink *) b;
|
||||
VipsShrinkSequence *seq;
|
||||
|
||||
if( !(seq = IM_NEW( out, VipsShrinkSequence )) )
|
||||
if( !(seq = VIPS_NEW( out, VipsShrinkSequence )) )
|
||||
return( NULL );
|
||||
|
||||
seq->ir = vips_region_new( in );
|
||||
|
@ -187,8 +187,8 @@ typedef void (*transform_fn)( const VipsTransformation *,
|
||||
*/
|
||||
static void
|
||||
transform_rect( const VipsTransformation *trn, transform_fn transform,
|
||||
const Rect *in, /* In input space */
|
||||
Rect *out ) /* In output space */
|
||||
const VipsRect *in, /* In input space */
|
||||
VipsRect *out ) /* In output space */
|
||||
{
|
||||
double x1, y1; /* Map corners */
|
||||
double x2, y2;
|
||||
@ -196,25 +196,26 @@ transform_rect( const VipsTransformation *trn, transform_fn transform,
|
||||
double x4, y4;
|
||||
double left, right, top, bottom;
|
||||
|
||||
/* Map input Rect.
|
||||
/* Map input VipsRect.
|
||||
*/
|
||||
transform( trn, in->left, in->top, &x1, &y1 );
|
||||
transform( trn, in->left, IM_RECT_BOTTOM( in ), &x3, &y3 );
|
||||
transform( trn, IM_RECT_RIGHT( in ), in->top, &x2, &y2 );
|
||||
transform( trn, IM_RECT_RIGHT( in ), IM_RECT_BOTTOM( in ), &x4, &y4 );
|
||||
transform( trn, in->left, VIPS_RECT_BOTTOM( in ), &x3, &y3 );
|
||||
transform( trn, VIPS_RECT_RIGHT( in ), in->top, &x2, &y2 );
|
||||
transform( trn, VIPS_RECT_RIGHT( in ), VIPS_RECT_BOTTOM( in ),
|
||||
&x4, &y4 );
|
||||
|
||||
/* Find bounding box for these four corners. Round-to-nearest to try
|
||||
* to stop rounding errors growing images.
|
||||
*/
|
||||
left = IM_MIN( x1, IM_MIN( x2, IM_MIN( x3, x4 ) ) );
|
||||
right = IM_MAX( x1, IM_MAX( x2, IM_MAX( x3, x4 ) ) );
|
||||
top = IM_MIN( y1, IM_MIN( y2, IM_MIN( y3, y4 ) ) );
|
||||
bottom = IM_MAX( y1, IM_MAX( y2, IM_MAX( y3, y4 ) ) );
|
||||
left = VIPS_MIN( x1, VIPS_MIN( x2, VIPS_MIN( x3, x4 ) ) );
|
||||
right = VIPS_MAX( x1, VIPS_MAX( x2, VIPS_MAX( x3, x4 ) ) );
|
||||
top = VIPS_MIN( y1, VIPS_MIN( y2, VIPS_MIN( y3, y4 ) ) );
|
||||
bottom = VIPS_MAX( y1, VIPS_MAX( y2, VIPS_MAX( y3, y4 ) ) );
|
||||
|
||||
out->left = IM_RINT( left );
|
||||
out->top = IM_RINT( top );
|
||||
out->width = IM_RINT( right - left );
|
||||
out->height = IM_RINT( bottom - top );
|
||||
out->left = VIPS_RINT( left );
|
||||
out->top = VIPS_RINT( top );
|
||||
out->width = VIPS_RINT( right - left );
|
||||
out->height = VIPS_RINT( bottom - top );
|
||||
}
|
||||
|
||||
/* Given an area in the input image, calculate the bounding box for those
|
||||
@ -222,8 +223,8 @@ transform_rect( const VipsTransformation *trn, transform_fn transform,
|
||||
*/
|
||||
void
|
||||
vips__transform_forward_rect( const VipsTransformation *trn,
|
||||
const Rect *in, /* In input space */
|
||||
Rect *out ) /* In output space */
|
||||
const VipsRect *in, /* In input space */
|
||||
VipsRect *out ) /* In output space */
|
||||
{
|
||||
transform_rect( trn, vips__transform_forward_point, in, out );
|
||||
}
|
||||
@ -233,8 +234,8 @@ vips__transform_forward_rect( const VipsTransformation *trn,
|
||||
*/
|
||||
void
|
||||
vips__transform_invert_rect( const VipsTransformation *trn,
|
||||
const Rect *in, /* In output space */
|
||||
Rect *out ) /* In input space */
|
||||
const VipsRect *in, /* In output space */
|
||||
VipsRect *out ) /* In input space */
|
||||
{
|
||||
transform_rect( trn, vips__transform_invert_point, in, out );
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ extern "C" {
|
||||
static void
|
||||
vips_interpolate_vsqbs_interpolate( VipsInterpolate* restrict interpolate,
|
||||
void* restrict out,
|
||||
REGION* restrict in,
|
||||
VipsRegion* restrict in,
|
||||
double absolute_x,
|
||||
double absolute_y )
|
||||
{
|
||||
@ -338,7 +338,8 @@ vips_interpolate_vsqbs_interpolate( VipsInterpolate* restrict interpolate,
|
||||
*/
|
||||
const int actual_bands = in->im->Bands;
|
||||
const int bands =
|
||||
vips_bandfmt_iscomplex( in->im->BandFmt ) ? 2 * actual_bands : actual_bands;
|
||||
vips_band_format_iscomplex( in->im->BandFmt ) ?
|
||||
2 * actual_bands : actual_bands;
|
||||
|
||||
/* Confirm that absolute_x and absolute_y are >= 1, see above.
|
||||
*/
|
||||
|
@ -23,11 +23,11 @@ bin_SCRIPTS = \
|
||||
batch_rubber_sheet \
|
||||
batch_crop \
|
||||
vipsprofile \
|
||||
vips-7.40
|
||||
vips-7.41
|
||||
|
||||
EXTRA_DIST = \
|
||||
vipsprofile \
|
||||
vips-7.40 \
|
||||
vips-7.41 \
|
||||
light_correct.in \
|
||||
shrink_width.in \
|
||||
batch_image_convert.in \
|
||||
|
Loading…
Reference in New Issue
Block a user