From 008d6d7a787481ec6fc163e889fc9a99f16f59a0 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 16 Nov 2014 12:57:27 +0000 Subject: [PATCH] more doc polishing --- doc/reference/using-C.xml | 13 ++++++------ doc/reference/using-cpp.xml | 39 +++++++++++++++++----------------- doc/reference/using-python.xml | 3 ++- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/doc/reference/using-C.xml b/doc/reference/using-C.xml index 391de8d6..a9a067e5 100644 --- a/doc/reference/using-C.xml +++ b/doc/reference/using-C.xml @@ -2,6 +2,7 @@ + VIPS from C @@ -15,7 +16,7 @@ - Using VIPS from C + Introduction VIPS comes with a convenient, high-level C API. You should read the API docs for full details, but this section will try to give a brief @@ -24,15 +25,15 @@ - When your program starts, use VIPS_INIT() to set up - the VIPS library. You should pass it the name of your program, usually - argv[0]. Use vips_shutdown() - when you exit. + When your program starts, use VIPS_INIT() + to start up the VIPS library. You should pass it the name + of your program, usually argv[0]. Use + vips_shutdown() when you exit. You can add the VIPS flags to your %GObject command-line processing - with vips_get_option_group(), see below. + with vips_get_option_group(), see below. diff --git a/doc/reference/using-cpp.xml b/doc/reference/using-cpp.xml index 5400f478..a25ac104 100644 --- a/doc/reference/using-cpp.xml +++ b/doc/reference/using-cpp.xml @@ -2,6 +2,7 @@ + VIPS from C++ @@ -15,16 +16,14 @@ - Using VIPS from C++ + Introduction VIPS comes with a convenient C++ API. It is a very thin wrapper over the - C API and provides automatic reference counting, exceptions, operator + C API and adds automatic reference counting, exceptions, operator overloads, and automatic constant expansion. You can drop down to the C API at any point, so all the C API docs also work for C++. - -VIPS from C++ example /* compile with: * g++ -g -Wall try.cc `pkg-config vips-cc --cflags --libs` @@ -84,11 +83,11 @@ main( int argc, char **argv ) return( 0 ); } - Everything before VImage in = VImage::.. is exactly as the C - API. + API. This boilerplate gives the example a set of standard command-line + flags. @@ -172,13 +171,13 @@ main( int argc, char **argv ) vips_add(): - int vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... ); +int vips_add( VipsImage *left, VipsImage *right, VipsImage **out, ... ); appears in C++ as: - VImage VImage::add( VImage right, VOption *options = 0 ); +VImage VImage::add( VImage right, VOption *options = 0 ); @@ -193,7 +192,7 @@ main( int argc, char **argv ) Next we reload the image. The VImage::avg() will have scanned the image and reached the end of the file, we need to scan again for the next operation. If we'd selected random access mode (the default) in the - original VImage::new_from_file(), we would not need to load again. + original VImage::new_from_file(), we would not need to reload. @@ -227,14 +226,14 @@ main( int argc, char **argv ) bandwise join of two RGB images would be a six-band image) with: - VImage rgb = ...; - VImage six_band = rgb.bandjoin( rgb ); +VImage rgb = ...; +VImage six_band = rgb.bandjoin( rgb ); You can also bandjoin a constant, for example: - VImage rgb_with_alpha = rgb.bandjoin( 255 ); +VImage rgb_with_alpha = rgb.bandjoin( 255 ); Will add an extra band to an image, with every element in the new band @@ -243,7 +242,7 @@ main( int argc, char **argv ) converted. For example: - VImage a = (a < 128).ifthenelse( 128, a ); +VImage a = (a < 128).ifthenelse( 128, a ); Will set every band element of a less than 128 to 128. @@ -264,20 +263,20 @@ main( int argc, char **argv ) named after the enum. For example, the C function: - int vips_math( VipsImage *in, VipsImage **out, VipsOperationMath math, ... ); +int vips_math( VipsImage *in, VipsImage **out, VipsOperationMath math, ... ); where #VipsOperationMath has the member #VIPS_OPERATION_MATH_SIN, has a C convenience function vips_sin(): - int vips_sin( VipsImage *in, VipsImage **out, ... ); +int vips_sin( VipsImage *in, VipsImage **out, ... ); and a C++ member function VImage::sin(): - VImage VImage::sin( VOption *options = 0 ); +VImage VImage::sin( VOption *options = 0 ); @@ -287,10 +286,10 @@ main( int argc, char **argv ) Extending the C++ interface - The C++ interface comes in two parts. First, VImage8.h defines a simple - layer over #GObject for automatic reference counting, then a generic way - to call any vips8 operation with VImage::call(), then a few convenience - functions, then a set of overloads. + The C++ interface comes in two parts. First, VImage8.h + defines a simple layer over #GObject for automatic reference counting, + then a generic way to call any vips8 operation with VImage::call(), + then a few convenience functions, then a set of overloads. diff --git a/doc/reference/using-python.xml b/doc/reference/using-python.xml index 0be7eff5..4270fde5 100644 --- a/doc/reference/using-python.xml +++ b/doc/reference/using-python.xml @@ -94,7 +94,8 @@ im = im.similarity(scale = 0.9, interpolate = Vips.Interpolate.new("bicubic")) Finally, .write_to_file() sends the image back to the filesystem. There's also .write_to_buffer() to make a - string containing the formatted image. + string containing the formatted image, and .write() to + write to another image.