Merge branch 'master' into add-canny

This commit is contained in:
John Cupitt 2018-02-26 09:26:22 +00:00
commit b07a7c60b7
5 changed files with 51 additions and 31 deletions

View File

@ -6,6 +6,9 @@
- hough_line is 4x faster
- hough_circle is 2x faster
12/2/18 started 8.6.3
- use pkg-config to find libjpeg, if we can
5/1/18 started 8.6.2
- vips_sink_screen() keeps a ref to the input image ... stops a rare race
- fix a minor accidental ABI break in 8.6.0 -> 8.6.1 [remicollet]

View File

@ -1034,23 +1034,41 @@ if test x"$with_png" != "xno"; then
)
fi
FIND_JPEG(
[with_jpeg=yes
EXTRA_LIBS_USED="$EXTRA_LIBS_USED -ljpeg"
],
[AC_MSG_WARN([libjpeg not found; disabling JPEG support])
with_jpeg=no
]
)
# look for libjpeg with pkg-config ... fall back to our tester
AC_ARG_WITH([jpeg],
AS_HELP_STRING([--without-jpeg], [build without libjpeg (default: test)]))
# JPEG extension parameters available in libjpeg-turbo >=1.5.0, mozjpeg >=3.0
if test x"$with_jpeg" != x"no"; then
PKG_CHECK_MODULES(JPEG, libjpeg,
[AC_DEFINE(HAVE_JPEG,1,[define if you have libjpeg installed.])
with_jpeg="yes (pkg-config)"
PACKAGES_USED="$PACKAGES_USED libjpeg"
],
[FIND_JPEG(
[with_jpeg="yes (found by search)"
EXTRA_LIBS_USED="$EXTRA_LIBS_USED -ljpeg"
],
[AC_MSG_WARN([libjpeg not found; disabling JPEG support])
with_jpeg=no
]
)
]
)
fi
# features like trellis quant are exposed as extension parameters ...
# mozjpeg 3.2 and later have #define JPEG_C_PARAM_SUPPORTED, but we must
# work with earlier versions
if test x"$with_jpeg" != "xno"; then
save_LIBS="$LIBS"
LIBS="$LIBS $JPEG_LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$JPEG_LIBS $LIBS"
CFLAGS="$JPEG_INCLUDES $CFLAGS"
AC_CHECK_FUNCS(jpeg_c_bool_param_supported,
AC_DEFINE(HAVE_JPEG_EXT_PARAMS,1,
[define if your libjpeg has extension parameters.]))
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# libexif

View File

@ -474,7 +474,7 @@ public:
VipsImage *image;
if( !(image = vips_image_new_from_image( this->get_image(),
&pixel[0], pixel.size() )) )
&pixel[0], static_cast<int>( pixel.size() ) )) )
throw( VError() );
return( VImage( image ) );

View File

@ -10,18 +10,18 @@
</refnamediv>
There are full libvips bindings for quite a few environments now: C, C++,
command-line, Ruby, PHP, Python and JavaScript (node).
command-line, Ruby, PHP, Lua, Python and JavaScript (node).
This chapter runs through the four main styles that have been found to work
well. If you want to write a new binding, one of these should be close
to what you need.
# C API
# Don't bind the top-level C API
The libvips C API (vips_add() and so on) is very inconvenient to use from other
languages due to its heavy use of varargs.
The libvips C API (vips_add() and so on) is very inconvenient and dangerous
to use from other languages due to its heavy use of varargs.
It's much better to use the layer below. This lower layer is structured as:
It's much better to use the layer below. This lower layer is structured as
create operator, set parameters, execute, extract results. For example, you can
execute vips_invert() like this:
@ -113,10 +113,10 @@ main( int argc, char **argv )
}
```
libvips has a couple of extra things to let you fetch the arguments and types
of an operator. Use vips_lib.vips_argument_map() to loop over all the arguments
of an operator, and vips_object_get_argument() to fetch the type and flags
of a specific argument.
libvips has a couple of extra things to let you examine the arguments and
types of an operator at runtime. Use vips_lib.vips_argument_map() to loop
over all the arguments of an operator, and vips_object_get_argument()
to fetch the type and flags of a specific argument.
Use vips_operation_get_flags() to get general information about an operator.
@ -124,7 +124,7 @@ Use vips_operation_get_flags() to get general information about an operator.
The C++ binding uses this lower layer to define a function called
`VImage::call()` which can call any libvips operator with a not-varargs set of
variable arguments.
variable arguments.
A small Python program walks the set of all libvips operators and generates a
set of static bindings. For example:
@ -142,7 +142,7 @@ VImage VImage::invert( VOption *options )
}
```
So from C++ you can call any libvips operator, though without type-safety, with
So from C++ you can call any libvips operator (though without type-safety) with
`VImage::call()`, or use the member functions on `VImage` to get type-safe
calls for at least the required operator arguments.
@ -158,7 +158,7 @@ but use FFI to call into libvips and run operations.
Since these languages are dynamic, they can add another trick: they intercept
the method-missing hook and attempt to run any method calls not implemented by
the `Image` class as libvips operators. This makes these bindings self-writing:
they only contain a small amount of codeand just expose everything they find in
they only contain a small amount of code and just expose everything they find in
the libvips class hierarchy.
# Dynamic langauge without FFI
@ -167,7 +167,7 @@ PHP does not have FFI, unfortunately, so for this language a small native
module implements the general `vips_call()` function for PHP language types,
and a larger pure PHP layer makes it convenient to use.
# `gobject-introspection`
# gobject-introspection
The C source code to libvips has been marked up with special comments
describing the interface in a standard way. These comments are read by

View File

@ -44,7 +44,7 @@ where:
</programlisting>
There's a straightforward relationship with the C API: compare this to
the API docs for vips_rot(), for example.
the API docs for vips_rot().
</para>
</refsect3>
@ -83,7 +83,7 @@ VipsOperation (operation), operations
<title>Optional arguments</title>
<para>
Many operations take optional arguments. You can supply these as
command-line options, for example:
command-line options. For example:
<programlisting>
$ vips gamma
@ -120,10 +120,9 @@ $ vips gamma k2.jpg x.jpg --exponent 0.42
<refsect3 id="using-command-line-array">
<title>Array arguments</title>
<para>
Some operations take arrays of values as arguments, for example,
Some operations take arrays of values as arguments. For example,
vips_affine() needs an array of four numbers for the
2x2 transform matrix. You pass arrays as space-separated lists, for
example:
2x2 transform matrix. You pass arrays as space-separated lists:
<programlisting>
$ vips affine k2.jpg x.jpg "2 0 0 1"
@ -151,7 +150,7 @@ $ vips bandjoin "k2.jpg k4.jpg" x.tif
$ vips -l foreign
</programlisting>
Then get a list of the options a format supports with, for example:
Then get a list of the options a format supports with:
<programlisting>
$ vips jpegsave
@ -160,7 +159,7 @@ $ vips jpegsave
<para>
You can pass options to the implicit load and save operations enclosed
in square brackets after the filename. For example:
in square brackets after the filename:
<programlisting>
vips affine k2.jpg x.jpg[Q=90,strip] "2 0 0 1"