doc polish
This commit is contained in:
parent
2349dcf110
commit
aa53f632e7
@ -10,18 +10,18 @@
|
|||||||
</refnamediv>
|
</refnamediv>
|
||||||
|
|
||||||
There are full libvips bindings for quite a few environments now: C, C++,
|
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
|
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
|
well. If you want to write a new binding, one of these should be close
|
||||||
to what you need.
|
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
|
The libvips C API (vips_add() and so on) is very inconvenient and dangerous
|
||||||
languages due to its heavy use of varargs.
|
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
|
create operator, set parameters, execute, extract results. For example, you can
|
||||||
execute vips_invert() like this:
|
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
|
libvips has a couple of extra things to let you examine the arguments and
|
||||||
of an operator. Use vips_lib.vips_argument_map() to loop over all the arguments
|
types of an operator at runtime. Use vips_lib.vips_argument_map() to loop
|
||||||
of an operator, and vips_object_get_argument() to fetch the type and flags
|
over all the arguments of an operator, and vips_object_get_argument()
|
||||||
of a specific argument.
|
to fetch the type and flags of a specific argument.
|
||||||
|
|
||||||
Use vips_operation_get_flags() to get general information about an operator.
|
Use vips_operation_get_flags() to get general information about an operator.
|
||||||
|
|
||||||
@ -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
|
`VImage::call()`, or use the member functions on `VImage` to get type-safe
|
||||||
calls for at least the required operator arguments.
|
calls for at least the required operator arguments.
|
||||||
|
|
||||||
@ -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,
|
module implements the general `vips_call()` function for PHP language types,
|
||||||
and a larger pure PHP layer makes it convenient to use.
|
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
|
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
|
describing the interface in a standard way. These comments are read by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user