@img/sharp-libvips-dev 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +3 -3
  2. package/cplusplus/VConnection.cpp +54 -54
  3. package/cplusplus/VError.cpp +20 -18
  4. package/cplusplus/VImage.cpp +636 -589
  5. package/cplusplus/VInterpolate.cpp +22 -22
  6. package/cplusplus/VRegion.cpp +4 -4
  7. package/cplusplus/vips-operators.cpp +2326 -2301
  8. package/include/aom/aom_codec.h +10 -6
  9. package/include/aom/aom_decoder.h +1 -1
  10. package/include/aom/aom_encoder.h +9 -2
  11. package/include/aom/aomcx.h +72 -3
  12. package/include/cairo/cairo-ft.h +1 -1
  13. package/include/cairo/cairo-gobject.h +8 -0
  14. package/include/cairo/cairo-svg.h +3 -3
  15. package/include/cairo/cairo-version.h +2 -2
  16. package/include/cairo/cairo.h +91 -24
  17. package/include/glib-2.0/glib/gmacros.h +1 -1
  18. package/include/glib-2.0/glib/gtestutils.h +1 -1
  19. package/include/glib-2.0/gobject/gtype.h +7 -7
  20. package/include/harfbuzz/hb-version.h +2 -2
  21. package/include/hwy/aligned_allocator.h +211 -0
  22. package/include/hwy/base.h +1517 -0
  23. package/include/hwy/cache_control.h +108 -0
  24. package/include/hwy/detect_compiler_arch.h +281 -0
  25. package/include/hwy/detect_targets.h +644 -0
  26. package/include/hwy/foreach_target.h +340 -0
  27. package/include/hwy/highway.h +435 -0
  28. package/include/hwy/highway_export.h +74 -0
  29. package/include/hwy/nanobenchmark.h +171 -0
  30. package/include/hwy/ops/arm_neon-inl.h +8913 -0
  31. package/include/hwy/ops/arm_sve-inl.h +5105 -0
  32. package/include/hwy/ops/emu128-inl.h +2811 -0
  33. package/include/hwy/ops/generic_ops-inl.h +4745 -0
  34. package/include/hwy/ops/ppc_vsx-inl.h +5716 -0
  35. package/include/hwy/ops/rvv-inl.h +5070 -0
  36. package/include/hwy/ops/scalar-inl.h +1995 -0
  37. package/include/hwy/ops/set_macros-inl.h +578 -0
  38. package/include/hwy/ops/shared-inl.h +539 -0
  39. package/include/hwy/ops/tuple-inl.h +125 -0
  40. package/include/hwy/ops/wasm_128-inl.h +5917 -0
  41. package/include/hwy/ops/x86_128-inl.h +11173 -0
  42. package/include/hwy/ops/x86_256-inl.h +7529 -0
  43. package/include/hwy/ops/x86_512-inl.h +6849 -0
  44. package/include/hwy/per_target.h +44 -0
  45. package/include/hwy/print-inl.h +62 -0
  46. package/include/hwy/print.h +75 -0
  47. package/include/hwy/robust_statistics.h +148 -0
  48. package/include/hwy/targets.h +338 -0
  49. package/include/hwy/timer-inl.h +200 -0
  50. package/include/hwy/timer.h +55 -0
  51. package/include/jconfig.h +2 -2
  52. package/include/jpeglib.h +3 -2
  53. package/include/libheif/heif.h +461 -384
  54. package/include/libheif/heif_cxx.h +4 -1
  55. package/include/libheif/heif_plugin.h +1 -1
  56. package/include/libheif/heif_properties.h +138 -0
  57. package/include/libheif/heif_regions.h +866 -0
  58. package/include/libheif/heif_version.h +3 -3
  59. package/include/libpng16/pnglibconf.h +1 -1
  60. package/include/pnglibconf.h +1 -1
  61. package/include/vips/VConnection8.h +43 -49
  62. package/include/vips/VError8.h +27 -24
  63. package/include/vips/VImage8.h +4861 -4597
  64. package/include/vips/VInterpolate8.h +24 -27
  65. package/include/vips/VRegion8.h +32 -33
  66. package/include/vips/arithmetic.h +169 -169
  67. package/include/vips/basic.h +33 -33
  68. package/include/vips/buf.h +56 -54
  69. package/include/vips/colour.h +95 -95
  70. package/include/vips/connection.h +190 -193
  71. package/include/vips/conversion.h +91 -91
  72. package/include/vips/convolution.h +36 -30
  73. package/include/vips/create.h +63 -63
  74. package/include/vips/dbuf.h +35 -37
  75. package/include/vips/debug.h +65 -33
  76. package/include/vips/draw.h +41 -41
  77. package/include/vips/enumtypes.h +54 -51
  78. package/include/vips/error.h +63 -63
  79. package/include/vips/foreign.h +263 -223
  80. package/include/vips/format.h +48 -48
  81. package/include/vips/freqfilt.h +22 -22
  82. package/include/vips/gate.h +55 -47
  83. package/include/vips/generate.h +34 -34
  84. package/include/vips/header.h +111 -101
  85. package/include/vips/histogram.h +28 -28
  86. package/include/vips/image.h +213 -213
  87. package/include/vips/interpolate.h +40 -41
  88. package/include/vips/memory.h +61 -52
  89. package/include/vips/morphology.h +24 -24
  90. package/include/vips/mosaicing.h +32 -33
  91. package/include/vips/object.h +371 -357
  92. package/include/vips/operation.h +68 -67
  93. package/include/vips/private.h +76 -76
  94. package/include/vips/rect.h +26 -26
  95. package/include/vips/region.h +92 -92
  96. package/include/vips/resample.h +38 -38
  97. package/include/vips/sbuf.h +53 -54
  98. package/include/vips/semaphore.h +24 -24
  99. package/include/vips/thread.h +30 -27
  100. package/include/vips/threadpool.h +48 -49
  101. package/include/vips/transform.h +39 -39
  102. package/include/vips/type.h +90 -85
  103. package/include/vips/util.h +274 -229
  104. package/include/vips/vector.h +24 -144
  105. package/include/vips/version.h +9 -9
  106. package/include/vips/vips.h +41 -40
  107. package/include/zlib.h +23 -19
  108. package/package.json +1 -1
  109. package/versions.json +9 -9
@@ -10,28 +10,28 @@
10
10
 
11
11
  /*
12
12
 
13
- Copyright (C) 1991-2001 The National Gallery
13
+ Copyright (C) 1991-2001 The National Gallery
14
14
 
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU Lesser General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU Lesser General Public License as published by
17
+ the Free Software Foundation; either version 2 of the License, or
18
+ (at your option) any later version.
19
19
 
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU Lesser General Public License for more details.
20
+ This program is distributed in the hope that it will be useful,
21
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
22
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
+ GNU Lesser General Public License for more details.
24
24
 
25
- You should have received a copy of the GNU Lesser General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28
- 02110-1301 USA
25
+ You should have received a copy of the GNU Lesser General Public License
26
+ along with this program; if not, write to the Free Software
27
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28
+ 02110-1301 USA
29
29
 
30
30
  */
31
31
 
32
32
  /*
33
33
 
34
- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
34
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
35
35
 
36
36
  */
37
37
 
@@ -57,488 +57,488 @@ VIPS_NAMESPACE_START
57
57
  */
58
58
 
59
59
  std::vector<double>
60
- to_vectorv( int n, ... )
60
+ to_vectorv(int n, ...)
61
61
  {
62
- std::vector<double> vector( n );
62
+ std::vector<double> vector(n);
63
63
  va_list ap;
64
64
 
65
- va_start( ap, n );
66
- for( int i = 0; i < n; i++ )
67
- vector[i] = va_arg( ap, double );
68
- va_end( ap );
65
+ va_start(ap, n);
66
+ for (int i = 0; i < n; i++)
67
+ vector[i] = va_arg(ap, double);
68
+ va_end(ap);
69
69
 
70
- return( vector );
70
+ return vector;
71
71
  }
72
72
 
73
73
  std::vector<double>
74
- to_vector( double value )
74
+ to_vector(double value)
75
75
  {
76
- return( to_vectorv( 1, value ) );
76
+ return to_vectorv(1, value);
77
77
  }
78
78
 
79
79
  std::vector<double>
80
- to_vector( int n, double array[] )
80
+ to_vector(int n, double array[])
81
81
  {
82
- std::vector<double> vector( n );
82
+ std::vector<double> vector(n);
83
83
 
84
- for( int i = 0; i < n; i++ )
84
+ for (int i = 0; i < n; i++)
85
85
  vector[i] = array[i];
86
86
 
87
- return( vector );
87
+ return vector;
88
88
  }
89
89
 
90
90
  std::vector<double>
91
- negate( std::vector<double> vector )
91
+ negate(std::vector<double> vector)
92
92
  {
93
- std::vector<double> new_vector( vector.size() );
93
+ std::vector<double> new_vector(vector.size());
94
94
 
95
- for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
95
+ for (std::vector<double>::size_type i = 0; i < vector.size(); i++)
96
96
  new_vector[i] = vector[i] * -1;
97
97
 
98
- return( new_vector );
98
+ return new_vector;
99
99
  }
100
100
 
101
101
  std::vector<double>
102
- invert( std::vector<double> vector )
102
+ invert(std::vector<double> vector)
103
103
  {
104
- std::vector<double> new_vector( vector.size() );
104
+ std::vector<double> new_vector(vector.size());
105
105
 
106
- for( std::vector<double>::size_type i = 0; i < vector.size(); i++ )
106
+ for (std::vector<double>::size_type i = 0; i < vector.size(); i++)
107
107
  new_vector[i] = 1.0 / vector[i];
108
108
 
109
- return( new_vector );
109
+ return new_vector;
110
110
  }
111
111
 
112
112
  VOption::~VOption()
113
113
  {
114
114
  std::list<Pair *>::iterator i;
115
115
 
116
- for( i = options.begin(); i != options.end(); ++i )
116
+ for (i = options.begin(); i != options.end(); ++i)
117
117
  delete *i;
118
118
  }
119
119
 
120
120
  // input bool
121
121
  VOption *
122
- VOption::set( const char *name, bool value )
122
+ VOption::set(const char *name, bool value)
123
123
  {
124
- Pair *pair = new Pair( name );
124
+ Pair *pair = new Pair(name);
125
125
 
126
126
  pair->input = true;
127
- g_value_init( &pair->value, G_TYPE_BOOLEAN );
128
- g_value_set_boolean( &pair->value, value );
129
- options.push_back( pair );
127
+ g_value_init(&pair->value, G_TYPE_BOOLEAN);
128
+ g_value_set_boolean(&pair->value, value);
129
+ options.push_back(pair);
130
130
 
131
- return( this );
131
+ return this;
132
132
  }
133
133
 
134
134
  // input int ... this path is used for enums as well
135
135
  VOption *
136
- VOption::set( const char *name, int value )
136
+ VOption::set(const char *name, int value)
137
137
  {
138
- Pair *pair = new Pair( name );
138
+ Pair *pair = new Pair(name);
139
139
 
140
140
  pair->input = true;
141
- g_value_init( &pair->value, G_TYPE_INT );
142
- g_value_set_int( &pair->value, value );
143
- options.push_back( pair );
141
+ g_value_init(&pair->value, G_TYPE_INT);
142
+ g_value_set_int(&pair->value, value);
143
+ options.push_back(pair);
144
144
 
145
- return( this );
145
+ return this;
146
146
  }
147
147
 
148
148
  // input guint64
149
149
  VOption *
150
- VOption::set( const char *name, guint64 value )
150
+ VOption::set(const char *name, guint64 value)
151
151
  {
152
- Pair *pair = new Pair( name );
152
+ Pair *pair = new Pair(name);
153
153
 
154
154
  pair->input = true;
155
- g_value_init( &pair->value, G_TYPE_UINT64 );
156
- g_value_set_uint64( &pair->value, value );
157
- options.push_back( pair );
155
+ g_value_init(&pair->value, G_TYPE_UINT64);
156
+ g_value_set_uint64(&pair->value, value);
157
+ options.push_back(pair);
158
158
 
159
- return( this );
159
+ return this;
160
160
  }
161
161
 
162
162
  // input double
163
163
  VOption *
164
- VOption::set( const char *name, double value )
164
+ VOption::set(const char *name, double value)
165
165
  {
166
- Pair *pair = new Pair( name );
166
+ Pair *pair = new Pair(name);
167
167
 
168
168
  pair->input = true;
169
- g_value_init( &pair->value, G_TYPE_DOUBLE );
170
- g_value_set_double( &pair->value, value );
171
- options.push_back( pair );
169
+ g_value_init(&pair->value, G_TYPE_DOUBLE);
170
+ g_value_set_double(&pair->value, value);
171
+ options.push_back(pair);
172
172
 
173
- return( this );
173
+ return this;
174
174
  }
175
175
 
176
176
  VOption *
177
- VOption::set( const char *name, const char *value )
177
+ VOption::set(const char *name, const char *value)
178
178
  {
179
- Pair *pair = new Pair( name );
179
+ Pair *pair = new Pair(name);
180
180
 
181
181
  pair->input = true;
182
- g_value_init( &pair->value, G_TYPE_STRING );
183
- g_value_set_string( &pair->value, value );
184
- options.push_back( pair );
182
+ g_value_init(&pair->value, G_TYPE_STRING);
183
+ g_value_set_string(&pair->value, value);
184
+ options.push_back(pair);
185
185
 
186
- return( this );
186
+ return this;
187
187
  }
188
188
 
189
189
  // input vips object (image, source, target, etc. etc.)
190
190
  VOption *
191
- VOption::set( const char *name, const VObject value )
191
+ VOption::set(const char *name, const VObject value)
192
192
  {
193
- Pair *pair = new Pair( name );
193
+ Pair *pair = new Pair(name);
194
194
  VipsObject *object = value.get_object();
195
- GType type = G_OBJECT_TYPE( object );
195
+ GType type = G_OBJECT_TYPE(object);
196
196
 
197
197
  pair->input = true;
198
- g_value_init( &pair->value, type );
199
- g_value_set_object( &pair->value, object );
200
- options.push_back( pair );
198
+ g_value_init(&pair->value, type);
199
+ g_value_set_object(&pair->value, object);
200
+ options.push_back(pair);
201
201
 
202
- return( this );
202
+ return this;
203
203
  }
204
204
 
205
205
  // input int array
206
206
  VOption *
207
- VOption::set( const char *name, std::vector<int> value )
207
+ VOption::set(const char *name, std::vector<int> value)
208
208
  {
209
- Pair *pair = new Pair( name );
209
+ Pair *pair = new Pair(name);
210
210
 
211
211
  int *array;
212
212
 
213
213
  pair->input = true;
214
214
 
215
- g_value_init( &pair->value, VIPS_TYPE_ARRAY_INT );
216
- vips_value_set_array_int( &pair->value, NULL,
217
- static_cast< int >( value.size() ) );
218
- array = vips_value_get_array_int( &pair->value, NULL );
215
+ g_value_init(&pair->value, VIPS_TYPE_ARRAY_INT);
216
+ vips_value_set_array_int(&pair->value, nullptr,
217
+ static_cast<int>(value.size()));
218
+ array = vips_value_get_array_int(&pair->value, nullptr);
219
219
 
220
- for( std::vector<double>::size_type i = 0; i < value.size(); i++ )
220
+ for (std::vector<double>::size_type i = 0; i < value.size(); i++)
221
221
  array[i] = value[i];
222
222
 
223
- options.push_back( pair );
223
+ options.push_back(pair);
224
224
 
225
- return( this );
225
+ return this;
226
226
  }
227
227
 
228
228
  // input double array
229
229
  VOption *
230
- VOption::set( const char *name, std::vector<double> value )
230
+ VOption::set(const char *name, std::vector<double> value)
231
231
  {
232
- Pair *pair = new Pair( name );
232
+ Pair *pair = new Pair(name);
233
233
 
234
234
  double *array;
235
235
 
236
236
  pair->input = true;
237
237
 
238
- g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE );
239
- vips_value_set_array_double( &pair->value, NULL,
240
- static_cast< int >( value.size() ) );
241
- array = vips_value_get_array_double( &pair->value, NULL );
238
+ g_value_init(&pair->value, VIPS_TYPE_ARRAY_DOUBLE);
239
+ vips_value_set_array_double(&pair->value, nullptr,
240
+ static_cast<int>(value.size()));
241
+ array = vips_value_get_array_double(&pair->value, nullptr);
242
242
 
243
- for( std::vector<double>::size_type i = 0; i < value.size(); i++ )
243
+ for (std::vector<double>::size_type i = 0; i < value.size(); i++)
244
244
  array[i] = value[i];
245
245
 
246
- options.push_back( pair );
246
+ options.push_back(pair);
247
247
 
248
- return( this );
248
+ return this;
249
249
  }
250
250
 
251
251
  // input image array
252
252
  VOption *
253
- VOption::set( const char *name, std::vector<VImage> value )
253
+ VOption::set(const char *name, std::vector<VImage> value)
254
254
  {
255
- Pair *pair = new Pair( name );
255
+ Pair *pair = new Pair(name);
256
256
 
257
257
  VipsImage **array;
258
258
 
259
259
  pair->input = true;
260
260
 
261
- g_value_init( &pair->value, VIPS_TYPE_ARRAY_IMAGE );
262
- vips_value_set_array_image( &pair->value,
263
- static_cast< int >( value.size() ) );
264
- array = vips_value_get_array_image( &pair->value, NULL );
261
+ g_value_init(&pair->value, VIPS_TYPE_ARRAY_IMAGE);
262
+ vips_value_set_array_image(&pair->value,
263
+ static_cast<int>(value.size()));
264
+ array = vips_value_get_array_image(&pair->value, nullptr);
265
265
 
266
- for( std::vector<double>::size_type i = 0; i < value.size(); i++ ) {
266
+ for (std::vector<double>::size_type i = 0; i < value.size(); i++) {
267
267
  VipsImage *vips_image = value[i].get_image();
268
268
 
269
269
  array[i] = vips_image;
270
- g_object_ref( vips_image );
270
+ g_object_ref(vips_image);
271
271
  }
272
272
 
273
- options.push_back( pair );
273
+ options.push_back(pair);
274
274
 
275
- return( this );
275
+ return this;
276
276
  }
277
277
 
278
278
  // input blob
279
279
  VOption *
280
- VOption::set( const char *name, VipsBlob *value )
280
+ VOption::set(const char *name, VipsBlob *value)
281
281
  {
282
- Pair *pair = new Pair( name );
282
+ Pair *pair = new Pair(name);
283
283
 
284
284
  pair->input = true;
285
- g_value_init( &pair->value, VIPS_TYPE_BLOB );
286
- g_value_set_boxed( &pair->value, value );
287
- options.push_back( pair );
285
+ g_value_init(&pair->value, VIPS_TYPE_BLOB);
286
+ g_value_set_boxed(&pair->value, value);
287
+ options.push_back(pair);
288
288
 
289
- return( this );
289
+ return this;
290
290
  }
291
291
 
292
292
  // output bool
293
293
  VOption *
294
- VOption::set( const char *name, bool *value )
294
+ VOption::set(const char *name, bool *value)
295
295
  {
296
- Pair *pair = new Pair( name );
296
+ Pair *pair = new Pair(name);
297
297
 
298
298
  pair->input = false;
299
299
  pair->vbool = value;
300
- g_value_init( &pair->value, G_TYPE_BOOLEAN );
300
+ g_value_init(&pair->value, G_TYPE_BOOLEAN);
301
301
 
302
- options.push_back( pair );
302
+ options.push_back(pair);
303
303
 
304
- return( this );
304
+ return this;
305
305
  }
306
306
 
307
307
  // output int
308
308
  VOption *
309
- VOption::set( const char *name, int *value )
309
+ VOption::set(const char *name, int *value)
310
310
  {
311
- Pair *pair = new Pair( name );
311
+ Pair *pair = new Pair(name);
312
312
 
313
313
  pair->input = false;
314
314
  pair->vint = value;
315
- g_value_init( &pair->value, G_TYPE_INT );
315
+ g_value_init(&pair->value, G_TYPE_INT);
316
316
 
317
- options.push_back( pair );
317
+ options.push_back(pair);
318
318
 
319
- return( this );
319
+ return this;
320
320
  }
321
321
 
322
322
  // output double
323
323
  VOption *
324
- VOption::set( const char *name, double *value )
324
+ VOption::set(const char *name, double *value)
325
325
  {
326
- Pair *pair = new Pair( name );
326
+ Pair *pair = new Pair(name);
327
327
 
328
328
  pair->input = false;
329
329
  pair->vdouble = value;
330
- g_value_init( &pair->value, G_TYPE_DOUBLE );
330
+ g_value_init(&pair->value, G_TYPE_DOUBLE);
331
331
 
332
- options.push_back( pair );
332
+ options.push_back(pair);
333
333
 
334
- return( this );
334
+ return this;
335
335
  }
336
336
 
337
337
  // output image
338
338
  VOption *
339
- VOption::set( const char *name, VImage *value )
339
+ VOption::set(const char *name, VImage *value)
340
340
  {
341
- Pair *pair = new Pair( name );
341
+ Pair *pair = new Pair(name);
342
342
 
343
343
  pair->input = false;
344
344
  pair->vimage = value;
345
- g_value_init( &pair->value, VIPS_TYPE_IMAGE );
345
+ g_value_init(&pair->value, VIPS_TYPE_IMAGE);
346
346
 
347
- options.push_back( pair );
347
+ options.push_back(pair);
348
348
 
349
- return( this );
349
+ return this;
350
350
  }
351
351
 
352
352
  // output doublearray
353
353
  VOption *
354
- VOption::set( const char *name, std::vector<double> *value )
354
+ VOption::set(const char *name, std::vector<double> *value)
355
355
  {
356
- Pair *pair = new Pair( name );
356
+ Pair *pair = new Pair(name);
357
357
 
358
358
  pair->input = false;
359
359
  pair->vvector = value;
360
- g_value_init( &pair->value, VIPS_TYPE_ARRAY_DOUBLE );
360
+ g_value_init(&pair->value, VIPS_TYPE_ARRAY_DOUBLE);
361
361
 
362
- options.push_back( pair );
362
+ options.push_back(pair);
363
363
 
364
- return( this );
364
+ return this;
365
365
  }
366
366
 
367
367
  // output blob
368
368
  VOption *
369
- VOption::set( const char *name, VipsBlob **value )
369
+ VOption::set(const char *name, VipsBlob **value)
370
370
  {
371
- Pair *pair = new Pair( name );
371
+ Pair *pair = new Pair(name);
372
372
 
373
373
  pair->input = false;
374
374
  pair->vblob = value;
375
- g_value_init( &pair->value, VIPS_TYPE_BLOB );
375
+ g_value_init(&pair->value, VIPS_TYPE_BLOB);
376
376
 
377
- options.push_back( pair );
377
+ options.push_back(pair);
378
378
 
379
- return( this );
379
+ return this;
380
380
  }
381
381
 
382
382
  // just g_object_set_property(), except we allow set enum from string
383
383
  static void
384
- set_property( VipsObject *object, const char *name, const GValue *value )
384
+ set_property(VipsObject *object, const char *name, const GValue *value)
385
385
  {
386
- VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS( object );
387
- GType type = G_VALUE_TYPE( value );
386
+ VipsObjectClass *object_class = VIPS_OBJECT_GET_CLASS(object);
387
+ GType type = G_VALUE_TYPE(value);
388
388
 
389
389
  GParamSpec *pspec;
390
390
  VipsArgumentClass *argument_class;
391
391
  VipsArgumentInstance *argument_instance;
392
392
 
393
- if( vips_object_get_argument( object, name,
394
- &pspec, &argument_class, &argument_instance ) ) {
395
- g_warning( "%s", vips_error_buffer() );
393
+ if (vips_object_get_argument(object, name,
394
+ &pspec, &argument_class, &argument_instance)) {
395
+ g_warning("%s", vips_error_buffer());
396
396
  vips_error_clear();
397
397
  return;
398
398
  }
399
399
 
400
- if( G_IS_PARAM_SPEC_ENUM( pspec ) &&
401
- type == G_TYPE_STRING ) {
402
- GType pspec_type = G_PARAM_SPEC_VALUE_TYPE( pspec );
400
+ if (G_IS_PARAM_SPEC_ENUM(pspec) &&
401
+ type == G_TYPE_STRING) {
402
+ GType pspec_type = G_PARAM_SPEC_VALUE_TYPE(pspec);
403
403
 
404
404
  int enum_value;
405
- GValue value2 = { 0 };
405
+ GValue value2 = G_VALUE_INIT;
406
406
 
407
- if( (enum_value = vips_enum_from_nick( object_class->nickname,
408
- pspec_type, g_value_get_string( value ) )) < 0 ) {
409
- g_warning( "%s", vips_error_buffer() );
407
+ if ((enum_value = vips_enum_from_nick(object_class->nickname,
408
+ pspec_type, g_value_get_string(value))) < 0) {
409
+ g_warning("%s", vips_error_buffer());
410
410
  vips_error_clear();
411
411
  return;
412
412
  }
413
413
 
414
- g_value_init( &value2, pspec_type );
415
- g_value_set_enum( &value2, enum_value );
416
- g_object_set_property( G_OBJECT( object ), name, &value2 );
417
- g_value_unset( &value2 );
414
+ g_value_init(&value2, pspec_type);
415
+ g_value_set_enum(&value2, enum_value);
416
+ g_object_set_property(G_OBJECT(object), name, &value2);
417
+ g_value_unset(&value2);
418
418
  }
419
419
  else
420
- g_object_set_property( G_OBJECT( object ), name, value );
420
+ g_object_set_property(G_OBJECT(object), name, value);
421
421
  }
422
422
 
423
423
  // walk the options and set props on the operation
424
424
  void
425
- VOption::set_operation( VipsOperation *operation )
425
+ VOption::set_operation(VipsOperation *operation)
426
426
  {
427
427
  std::list<Pair *>::iterator i;
428
428
 
429
- for( i = options.begin(); i != options.end(); ++i )
430
- if( (*i)->input ) {
429
+ for (i = options.begin(); i != options.end(); ++i)
430
+ if ((*i)->input) {
431
431
  #ifdef VIPS_DEBUG_VERBOSE
432
- printf( "set_operation: " );
433
- vips_object_print_name( VIPS_OBJECT( operation ) );
432
+ printf("set_operation: ");
433
+ vips_object_print_name(VIPS_OBJECT(operation));
434
434
  char *str_value =
435
- g_strdup_value_contents( &(*i)->value );
436
- printf( ".%s = %s\n", (*i)->name, str_value );
437
- g_free( str_value );
435
+ g_strdup_value_contents(&(*i)->value);
436
+ printf(".%s = %s\n", (*i)->name, str_value);
437
+ g_free(str_value);
438
438
  #endif /*VIPS_DEBUG_VERBOSE*/
439
439
 
440
- set_property( VIPS_OBJECT( operation ),
441
- (*i)->name, &(*i)->value );
440
+ set_property(VIPS_OBJECT(operation),
441
+ (*i)->name, &(*i)->value);
442
442
  }
443
443
  }
444
444
 
445
445
  // walk the options and fetch any requested outputs
446
446
  void
447
- VOption::get_operation( VipsOperation *operation )
447
+ VOption::get_operation(VipsOperation *operation)
448
448
  {
449
449
  std::list<Pair *>::iterator i;
450
450
 
451
- for( i = options.begin(); i != options.end(); ++i )
452
- if( ! (*i)->input ) {
451
+ for (i = options.begin(); i != options.end(); ++i)
452
+ if (!(*i)->input) {
453
453
  const char *name = (*i)->name;
454
454
 
455
- g_object_get_property( G_OBJECT( operation ),
456
- name, &(*i)->value );
455
+ g_object_get_property(G_OBJECT(operation),
456
+ name, &(*i)->value);
457
457
 
458
458
  #ifdef VIPS_DEBUG_VERBOSE
459
- printf( "get_operation: " );
460
- vips_object_print_name( VIPS_OBJECT( operation ) );
459
+ printf("get_operation: ");
460
+ vips_object_print_name(VIPS_OBJECT(operation));
461
461
  char *str_value = g_strdup_value_contents(
462
- &(*i)->value );
463
- printf( ".%s = %s\n", name, str_value );
464
- g_free( str_value );
462
+ &(*i)->value);
463
+ printf(".%s = %s\n", name, str_value);
464
+ g_free(str_value);
465
465
  #endif /*VIPS_DEBUG_VERBOSE*/
466
466
 
467
467
  GValue *value = &(*i)->value;
468
- GType type = G_VALUE_TYPE( value );
468
+ GType type = G_VALUE_TYPE(value);
469
469
 
470
- if( type == VIPS_TYPE_IMAGE ) {
470
+ if (type == VIPS_TYPE_IMAGE) {
471
471
  // rebox object
472
472
  VipsImage *image = VIPS_IMAGE(
473
- g_value_get_object( value ) );
474
- *((*i)->vimage) = VImage( image );
473
+ g_value_get_object(value));
474
+ *((*i)->vimage) = VImage(image);
475
475
  }
476
- else if( type == G_TYPE_INT )
477
- *((*i)->vint) = g_value_get_int( value );
478
- else if( type == G_TYPE_BOOLEAN )
479
- *((*i)->vbool) = g_value_get_boolean( value );
480
- else if( type == G_TYPE_DOUBLE )
481
- *((*i)->vdouble) = g_value_get_double( value );
482
- else if( type == VIPS_TYPE_ARRAY_DOUBLE ) {
476
+ else if (type == G_TYPE_INT)
477
+ *((*i)->vint) = g_value_get_int(value);
478
+ else if (type == G_TYPE_BOOLEAN)
479
+ *((*i)->vbool) = g_value_get_boolean(value);
480
+ else if (type == G_TYPE_DOUBLE)
481
+ *((*i)->vdouble) = g_value_get_double(value);
482
+ else if (type == VIPS_TYPE_ARRAY_DOUBLE) {
483
483
  int length;
484
484
  double *array =
485
- vips_value_get_array_double( value,
486
- &length );
485
+ vips_value_get_array_double(value,
486
+ &length);
487
487
 
488
- ((*i)->vvector)->resize( length );
489
- for( int j = 0; j < length; j++ )
488
+ ((*i)->vvector)->resize(length);
489
+ for (int j = 0; j < length; j++)
490
490
  (*((*i)->vvector))[j] = array[j];
491
491
  }
492
- else if( type == VIPS_TYPE_BLOB ) {
492
+ else if (type == VIPS_TYPE_BLOB) {
493
493
  // our caller gets a reference
494
494
  *((*i)->vblob) =
495
- (VipsBlob *) g_value_dup_boxed( value );
495
+ (VipsBlob *) g_value_dup_boxed(value);
496
496
  }
497
497
  }
498
498
  }
499
499
 
500
500
  void
501
- VImage::call_option_string( const char *operation_name,
502
- const char *option_string, VOption *options )
501
+ VImage::call_option_string(const char *operation_name,
502
+ const char *option_string, VOption *options)
503
503
  {
504
504
  VipsOperation *operation;
505
505
 
506
- VIPS_DEBUG_MSG( "call_option_string: starting for %s ...\n",
507
- operation_name );
506
+ VIPS_DEBUG_MSG("call_option_string: starting for %s ...\n",
507
+ operation_name);
508
508
 
509
- if( !(operation = vips_operation_new( operation_name )) ) {
509
+ if (!(operation = vips_operation_new(operation_name))) {
510
510
  delete options;
511
- throw( VError() );
511
+ throw(VError());
512
512
  }
513
513
 
514
514
  /* Set str options before vargs options, so the user can't
515
515
  * override things we set deliberately.
516
516
  */
517
- if( option_string &&
518
- vips_object_set_from_string( VIPS_OBJECT( operation ),
519
- option_string ) ) {
520
- vips_object_unref_outputs( VIPS_OBJECT( operation ) );
521
- g_object_unref( operation );
517
+ if (option_string &&
518
+ vips_object_set_from_string(VIPS_OBJECT(operation),
519
+ option_string)) {
520
+ vips_object_unref_outputs(VIPS_OBJECT(operation));
521
+ g_object_unref(operation);
522
522
  delete options;
523
- throw( VError() );
523
+ throw(VError());
524
524
  }
525
525
 
526
- if( options )
527
- options->set_operation( operation );
526
+ if (options)
527
+ options->set_operation(operation);
528
528
 
529
529
  /* Build from cache.
530
530
  */
531
- if( vips_cache_operation_buildp( &operation ) ) {
532
- vips_object_unref_outputs( VIPS_OBJECT( operation ) );
533
- g_object_unref( operation );
531
+ if (vips_cache_operation_buildp(&operation)) {
532
+ vips_object_unref_outputs(VIPS_OBJECT(operation));
533
+ g_object_unref(operation);
534
534
  delete options;
535
- throw( VError() );
535
+ throw(VError());
536
536
  }
537
537
 
538
538
  /* Walk args again, writing output.
539
539
  */
540
- if( options )
541
- options->get_operation( operation );
540
+ if (options)
541
+ options->get_operation(operation);
542
542
 
543
543
  /* We're done with options!
544
544
  */
@@ -548,17 +548,17 @@ VImage::call_option_string( const char *operation_name,
548
548
  * one of its arguments or have finished its work. Either
549
549
  * way, we can unref.
550
550
  */
551
- g_object_unref( operation );
551
+ g_object_unref(operation);
552
552
  }
553
553
 
554
554
  void
555
- VImage::call( const char *operation_name, VOption *options )
555
+ VImage::call(const char *operation_name, VOption *options)
556
556
  {
557
- call_option_string( operation_name, NULL, options );
557
+ call_option_string(operation_name, nullptr, options);
558
558
  }
559
559
 
560
560
  VImage
561
- VImage::new_from_file( const char *name, VOption *options )
561
+ VImage::new_from_file(const char *name, VOption *options)
562
562
  {
563
563
  char filename[VIPS_PATH_MAX];
564
564
  char option_string[VIPS_PATH_MAX];
@@ -566,147 +566,147 @@ VImage::new_from_file( const char *name, VOption *options )
566
566
 
567
567
  VImage out;
568
568
 
569
- vips__filename_split8( name, filename, option_string );
570
- if( !(operation_name = vips_foreign_find_load( filename )) ) {
569
+ vips__filename_split8(name, filename, option_string);
570
+ if (!(operation_name = vips_foreign_find_load(filename))) {
571
571
  delete options;
572
572
  throw VError();
573
573
  }
574
574
 
575
- call_option_string( operation_name, option_string,
576
- (options ? options : VImage::option())->
577
- set( "filename", filename )->
578
- set( "out", &out ) );
575
+ call_option_string(operation_name, option_string,
576
+ (options ? options : VImage::option())
577
+ ->set("filename", filename)
578
+ ->set("out", &out));
579
579
 
580
- return( out );
580
+ return out;
581
581
  }
582
582
 
583
583
  VImage
584
- VImage::new_from_buffer( const void *buf, size_t len, const char *option_string,
585
- VOption *options )
584
+ VImage::new_from_buffer(const void *buf, size_t len, const char *option_string,
585
+ VOption *options)
586
586
  {
587
587
  const char *operation_name;
588
588
  VipsBlob *blob;
589
589
  VImage out;
590
590
 
591
- if( !(operation_name = vips_foreign_find_load_buffer( buf, len )) ) {
591
+ if (!(operation_name = vips_foreign_find_load_buffer(buf, len))) {
592
592
  delete options;
593
- throw( VError() );
593
+ throw(VError());
594
594
  }
595
595
 
596
596
  /* We don't take a copy of the data or free it.
597
597
  */
598
- blob = vips_blob_new( NULL, buf, len );
599
- options = (options ? options : VImage::option())->
600
- set( "buffer", blob )->
601
- set( "out", &out );
602
- vips_area_unref( VIPS_AREA( blob ) );
598
+ blob = vips_blob_new(nullptr, buf, len);
599
+ options = (options ? options : VImage::option())
600
+ ->set("buffer", blob)
601
+ ->set("out", &out);
602
+ vips_area_unref(VIPS_AREA(blob));
603
603
 
604
- call_option_string( operation_name, option_string, options );
604
+ call_option_string(operation_name, option_string, options);
605
605
 
606
- return( out );
606
+ return out;
607
607
  }
608
608
 
609
609
  VImage
610
- VImage::new_from_buffer( const std::string &buf, const char *option_string,
611
- VOption *options )
610
+ VImage::new_from_buffer(const std::string &buf, const char *option_string,
611
+ VOption *options)
612
612
  {
613
- return( new_from_buffer( buf.c_str(), buf.size(),
614
- option_string, options ) );
613
+ return new_from_buffer(buf.c_str(), buf.size(),
614
+ option_string, options);
615
615
  }
616
616
 
617
617
  VImage
618
- VImage::new_from_source( VSource source, const char *option_string,
619
- VOption *options )
618
+ VImage::new_from_source(VSource source, const char *option_string,
619
+ VOption *options)
620
620
  {
621
621
  const char *operation_name;
622
622
  VImage out;
623
623
 
624
- if( !(operation_name = vips_foreign_find_load_source(
625
- source.get_source() )) ) {
624
+ if (!(operation_name = vips_foreign_find_load_source(
625
+ source.get_source()))) {
626
626
  delete options;
627
- throw( VError() );
627
+ throw(VError());
628
628
  }
629
629
 
630
- options = (options ? options : VImage::option())->
631
- set( "source", source )->
632
- set( "out", &out );
630
+ options = (options ? options : VImage::option())
631
+ ->set("source", source)
632
+ ->set("out", &out);
633
633
 
634
- call_option_string( operation_name, option_string, options );
634
+ call_option_string(operation_name, option_string, options);
635
635
 
636
- return( out );
636
+ return out;
637
637
  }
638
638
 
639
- VImage
640
- VImage::new_from_memory_steal( void *data, size_t size,
641
- int width, int height, int bands, VipsBandFormat format )
639
+ VImage
640
+ VImage::new_from_memory_steal(void *data, size_t size,
641
+ int width, int height, int bands, VipsBandFormat format)
642
642
  {
643
643
  VipsImage *image;
644
644
 
645
- if( !(image = vips_image_new_from_memory( data, size,
646
- width, height, bands, format )) )
647
- throw( VError() );
645
+ if (!(image = vips_image_new_from_memory(data, size,
646
+ width, height, bands, format)))
647
+ throw(VError());
648
648
 
649
- g_signal_connect( image, "postclose",
650
- G_CALLBACK( vips_image_free_buffer ), data);
649
+ g_signal_connect(image, "postclose",
650
+ G_CALLBACK(vips_image_free_buffer), data);
651
651
 
652
- return( VImage( image ) );
652
+ return VImage(image);
653
653
  }
654
654
 
655
655
  VImage
656
- VImage::new_matrix( int width, int height )
656
+ VImage::new_matrix(int width, int height)
657
657
  {
658
- return( VImage( vips_image_new_matrix( width, height ) ) );
658
+ return VImage(vips_image_new_matrix(width, height));
659
659
  }
660
660
 
661
661
  VImage
662
- VImage::new_matrixv( int width, int height, ... )
662
+ VImage::new_matrixv(int width, int height, ...)
663
663
  {
664
- VImage matrix = new_matrix( width, height );
664
+ VImage matrix = new_matrix(width, height);
665
665
  VipsImage *vips_matrix = matrix.get_image();
666
666
 
667
667
  va_list ap;
668
668
 
669
- va_start( ap, height );
670
- for( int y = 0; y < height; y++ )
671
- for( int x = 0; x < width; x++ )
672
- *VIPS_MATRIX( vips_matrix, x, y ) =
673
- va_arg( ap, double );
674
- va_end( ap );
669
+ va_start(ap, height);
670
+ for (int y = 0; y < height; y++)
671
+ for (int x = 0; x < width; x++)
672
+ *VIPS_MATRIX(vips_matrix, x, y) =
673
+ va_arg(ap, double);
674
+ va_end(ap);
675
675
 
676
- return( matrix );
676
+ return matrix;
677
677
  }
678
678
 
679
679
  VImage
680
- VImage::write( VImage out ) const
680
+ VImage::write(VImage out) const
681
681
  {
682
- if( vips_image_write( this->get_image(), out.get_image() ) )
682
+ if (vips_image_write(this->get_image(), out.get_image()))
683
683
  throw VError();
684
684
 
685
- return( out );
685
+ return out;
686
686
  }
687
687
 
688
688
  void
689
- VImage::write_to_file( const char *name, VOption *options ) const
689
+ VImage::write_to_file(const char *name, VOption *options) const
690
690
  {
691
691
  char filename[VIPS_PATH_MAX];
692
692
  char option_string[VIPS_PATH_MAX];
693
693
  const char *operation_name;
694
694
 
695
- vips__filename_split8( name, filename, option_string );
696
- if( !(operation_name = vips_foreign_find_save( filename )) ) {
695
+ vips__filename_split8(name, filename, option_string);
696
+ if (!(operation_name = vips_foreign_find_save(filename))) {
697
697
  delete options;
698
698
  throw VError();
699
699
  }
700
700
 
701
- call_option_string( operation_name, option_string,
702
- (options ? options : VImage::option())->
703
- set( "in", *this )->
704
- set( "filename", filename ) );
701
+ call_option_string(operation_name, option_string,
702
+ (options ? options : VImage::option())
703
+ ->set("in", *this)
704
+ ->set("filename", filename));
705
705
  }
706
706
 
707
707
  void
708
- VImage::write_to_buffer( const char *suffix, void **buf, size_t *size,
709
- VOption *options ) const
708
+ VImage::write_to_buffer(const char *suffix, void **buf, size_t *size,
709
+ VOption *options) const
710
710
  {
711
711
  char filename[VIPS_PATH_MAX];
712
712
  char option_string[VIPS_PATH_MAX];
@@ -718,87 +718,104 @@ VImage::write_to_buffer( const char *suffix, void **buf, size_t *size,
718
718
  *
719
719
  * We need to hide any errors from this first phase.
720
720
  */
721
- vips__filename_split8( suffix, filename, option_string );
721
+ vips__filename_split8(suffix, filename, option_string);
722
722
 
723
723
  vips_error_freeze();
724
- operation_name = vips_foreign_find_save_target( filename );
724
+ operation_name = vips_foreign_find_save_target(filename);
725
725
  vips_error_thaw();
726
726
 
727
- if( operation_name ) {
727
+ if (operation_name) {
728
728
  VTarget target = VTarget::new_to_memory();
729
729
 
730
- call_option_string( operation_name, option_string,
731
- (options ? options : VImage::option())->
732
- set( "in", *this )->
733
- set( "target", target ) );
730
+ call_option_string(operation_name, option_string,
731
+ (options ? options : VImage::option())
732
+ ->set("in", *this)
733
+ ->set("target", target));
734
734
 
735
- g_object_get( target.get_target(), "blob", &blob, (void *) NULL );
735
+ g_object_get(target.get_target(), "blob", &blob, nullptr);
736
736
  }
737
- else if( (operation_name = vips_foreign_find_save_buffer( filename )) ) {
738
- call_option_string( operation_name, option_string,
739
- (options ? options : VImage::option())->
740
- set( "in", *this )->
741
- set( "buffer", &blob ) );
737
+ else if ((operation_name = vips_foreign_find_save_buffer(filename))) {
738
+ call_option_string(operation_name, option_string,
739
+ (options ? options : VImage::option())
740
+ ->set("in", *this)
741
+ ->set("buffer", &blob));
742
742
  }
743
743
  else {
744
744
  delete options;
745
745
  throw VError();
746
746
  }
747
747
 
748
- if( blob ) {
749
- if( buf ) {
750
- *buf = VIPS_AREA( blob )->data;
751
- VIPS_AREA( blob )->free_fn = NULL;
748
+ if (blob) {
749
+ if (buf) {
750
+ *buf = VIPS_AREA(blob)->data;
751
+ VIPS_AREA(blob)->free_fn = nullptr;
752
752
  }
753
- if( size )
754
- *size = VIPS_AREA( blob )->length;
753
+ if (size)
754
+ *size = VIPS_AREA(blob)->length;
755
755
 
756
- vips_area_unref( VIPS_AREA( blob ) );
756
+ vips_area_unref(VIPS_AREA(blob));
757
757
  }
758
758
  }
759
759
 
760
760
  void
761
- VImage::write_to_target( const char *suffix, VTarget target,
762
- VOption *options ) const
761
+ VImage::write_to_target(const char *suffix, VTarget target,
762
+ VOption *options) const
763
763
  {
764
764
  char filename[VIPS_PATH_MAX];
765
765
  char option_string[VIPS_PATH_MAX];
766
766
  const char *operation_name;
767
767
 
768
- vips__filename_split8( suffix, filename, option_string );
769
- if( !(operation_name = vips_foreign_find_save_target( filename )) ) {
768
+ vips__filename_split8(suffix, filename, option_string);
769
+ if (!(operation_name = vips_foreign_find_save_target(filename))) {
770
770
  delete options;
771
771
  throw VError();
772
772
  }
773
773
 
774
- call_option_string( operation_name, option_string,
775
- (options ? options : VImage::option())->
776
- set( "in", *this )->
777
- set( "target", target ) );
774
+ call_option_string(operation_name, option_string,
775
+ (options ? options : VImage::option())
776
+ ->set("in", *this)
777
+ ->set("target", target));
778
+ }
779
+
780
+ VImage
781
+ VImage::thumbnail_buffer(void *buf, size_t len, int width, VOption *options)
782
+ {
783
+ VipsBlob *blob;
784
+ VImage out;
785
+
786
+ /* We don't take a copy of the data or free it.
787
+ */
788
+ blob = vips_blob_new(nullptr, buf, len);
789
+ options = (options ? options : VImage::option())->set("buffer", blob)->set("width", width)->set("out", &out);
790
+ vips_area_unref(VIPS_AREA(blob));
791
+
792
+ call("thumbnail_buffer", options);
793
+
794
+ return out;
778
795
  }
779
796
 
780
797
  VRegion
781
798
  VImage::region() const
782
799
  {
783
- return VRegion::new_from_image( *this );
800
+ return VRegion::new_from_image(*this);
784
801
  }
785
802
 
786
803
  VRegion
787
- VImage::region( VipsRect *rect ) const
804
+ VImage::region(VipsRect *rect) const
788
805
  {
789
- VRegion region = VRegion::new_from_image( *this );
806
+ VRegion region = VRegion::new_from_image(*this);
790
807
 
791
- region.prepare( rect );
808
+ region.prepare(rect);
792
809
 
793
810
  return region;
794
811
  }
795
812
 
796
813
  VRegion
797
- VImage::region( int left, int top, int width, int height ) const
814
+ VImage::region(int left, int top, int width, int height) const
798
815
  {
799
- VRegion region = VRegion::new_from_image( *this );
816
+ VRegion region = VRegion::new_from_image(*this);
800
817
 
801
- region.prepare( left, top, width, height );
818
+ region.prepare(left, top, width, height);
802
819
 
803
820
  return region;
804
821
  }
@@ -806,743 +823,773 @@ VImage::region( int left, int top, int width, int height ) const
806
823
  #include "vips-operators.cpp"
807
824
 
808
825
  std::vector<VImage>
809
- VImage::bandsplit( VOption *options ) const
826
+ VImage::bandsplit(VOption *options) const
810
827
  {
811
828
  std::vector<VImage> b;
812
829
  b.reserve(bands());
813
830
 
814
- for( int i = 0; i < bands(); i++ )
815
- b.push_back( extract_band( i ) );
831
+ for (int i = 0; i < bands(); i++)
832
+ b.push_back(extract_band(i));
816
833
 
817
- return( b );
834
+ return b;
818
835
  }
819
836
 
820
837
  VImage
821
- VImage::bandjoin( VImage other, VOption *options ) const
838
+ VImage::bandjoin(VImage other, VOption *options) const
822
839
  {
823
840
  VImage v[2] = { *this, other };
824
- std::vector<VImage> vec( v, v + VIPS_NUMBER( v ) );
841
+ std::vector<VImage> vec(v, v + VIPS_NUMBER(v));
825
842
 
826
- return( bandjoin( vec, options ) );
843
+ return bandjoin(vec, options);
827
844
  }
828
845
 
829
846
  VImage
830
- VImage::composite( VImage other, VipsBlendMode mode, VOption *options ) const
847
+ VImage::composite(VImage other, VipsBlendMode mode, VOption *options) const
831
848
  {
832
849
  VImage v[2] = { *this, other };
833
- std::vector<VImage> ivec( v, v + VIPS_NUMBER( v ) );
834
- int m[1] = { static_cast<int>( mode ) };
835
- std::vector<int> mvec( m, m + VIPS_NUMBER( m ) );
850
+ std::vector<VImage> ivec(v, v + VIPS_NUMBER(v));
851
+ int m[1] = { static_cast<int>(mode) };
852
+ std::vector<int> mvec(m, m + VIPS_NUMBER(m));
836
853
 
837
- return( composite( ivec, mvec, options ) );
854
+ return composite(ivec, mvec, options);
838
855
  }
839
856
 
840
857
  std::complex<double>
841
- VImage::minpos( VOption *options ) const
858
+ VImage::minpos(VOption *options) const
842
859
  {
843
860
  double x, y;
844
861
 
845
862
  (void) min(
846
- (options ? options : VImage::option()) ->
847
- set( "x", &x ) ->
848
- set( "y", &y ) );
863
+ (options ? options : VImage::option())
864
+ ->set("x", &x)
865
+ ->set("y", &y));
849
866
 
850
- return( std::complex<double>( x, y ) );
867
+ return std::complex<double>(x, y);
851
868
  }
852
869
 
853
870
  std::complex<double>
854
- VImage::maxpos( VOption *options ) const
871
+ VImage::maxpos(VOption *options) const
855
872
  {
856
873
  double x, y;
857
874
 
858
875
  (void) max(
859
- (options ? options : VImage::option()) ->
860
- set( "x", &x ) ->
861
- set( "y", &y ) );
876
+ (options ? options : VImage::option())
877
+ ->set("x", &x)
878
+ ->set("y", &y));
862
879
 
863
- return( std::complex<double>( x, y ) );
880
+ return std::complex<double>(x, y);
864
881
  }
865
882
 
866
883
  // Operator overloads
867
884
 
868
885
  VImage
869
- VImage::operator[]( int index ) const
886
+ VImage::operator[](int index) const
870
887
  {
871
- return( this->extract_band( index ) );
888
+ return this->extract_band(index);
872
889
  }
873
890
 
874
891
  std::vector<double>
875
- VImage::operator()( int x, int y ) const
892
+ VImage::operator()(int x, int y) const
876
893
  {
877
- return( this->getpoint( x, y ) );
894
+ return this->getpoint(x, y);
878
895
  }
879
896
 
880
897
  VImage
881
- operator+( const VImage a, const VImage b )
898
+ operator+(const VImage a, const VImage b)
882
899
  {
883
- return( a.add( b ) );
900
+ return a.add(b);
884
901
  }
885
902
 
886
903
  VImage
887
- operator+( double a, const VImage b )
904
+ operator+(double a, const VImage b)
888
905
  {
889
- return( b.linear( 1.0, a ) );
906
+ return b.linear(1.0, a);
890
907
  }
891
908
 
892
909
  VImage
893
- operator+( const VImage a, double b )
910
+ operator+(const VImage a, double b)
894
911
  {
895
- return( a.linear( 1.0, b ) );
912
+ return a.linear(1.0, b);
896
913
  }
897
914
 
898
915
  VImage
899
- operator+( const std::vector<double> a, const VImage b )
916
+ operator+(const std::vector<double> a, const VImage b)
900
917
  {
901
- return( b.linear( 1.0, a ) );
918
+ return b.linear(1.0, a);
902
919
  }
903
920
 
904
921
  VImage
905
- operator+( const VImage a, const std::vector<double> b )
922
+ operator+(const VImage a, const std::vector<double> b)
906
923
  {
907
- return( a.linear( 1.0, b ) );
924
+ return a.linear(1.0, b);
908
925
  }
909
926
 
910
927
  VImage &
911
- operator+=( VImage &a, const VImage b )
928
+ operator+=(VImage &a, const VImage b)
912
929
  {
913
- return( a = a + b );
930
+ a = a + b;
931
+ return a;
914
932
  }
915
933
 
916
934
  VImage &
917
- operator+=( VImage &a, const double b )
935
+ operator+=(VImage &a, const double b)
918
936
  {
919
- return( a = a + b );
937
+ a = a + b;
938
+ return a;
920
939
  }
921
940
 
922
941
  VImage &
923
- operator+=( VImage &a, const std::vector<double> b )
942
+ operator+=(VImage &a, const std::vector<double> b)
924
943
  {
925
- return( a = a + b );
944
+ a = a + b;
945
+ return a;
926
946
  }
927
947
 
928
948
  VImage
929
- operator-( const VImage a, const VImage b )
949
+ operator-(const VImage a, const VImage b)
930
950
  {
931
- return( a.subtract( b ) );
951
+ return a.subtract(b);
932
952
  }
933
953
 
934
954
  VImage
935
- operator-( double a, const VImage b )
955
+ operator-(double a, const VImage b)
936
956
  {
937
- return( b.linear( -1.0, a ) );
957
+ return b.linear(-1.0, a);
938
958
  }
939
959
 
940
960
  VImage
941
- operator-( const VImage a, double b )
961
+ operator-(const VImage a, double b)
942
962
  {
943
- return( a.linear( 1.0, -b ) );
963
+ return a.linear(1.0, -b);
944
964
  }
945
965
 
946
966
  VImage
947
- operator-( const std::vector<double> a, const VImage b )
967
+ operator-(const std::vector<double> a, const VImage b)
948
968
  {
949
- return( b.linear( -1.0, a ) );
969
+ return b.linear(-1.0, a);
950
970
  }
951
971
 
952
972
  VImage
953
- operator-( const VImage a, const std::vector<double> b )
973
+ operator-(const VImage a, const std::vector<double> b)
954
974
  {
955
- return( a.linear( 1.0, vips::negate( b ) ) );
975
+ return a.linear(1.0, vips::negate(b));
956
976
  }
957
977
 
958
978
  VImage &
959
- operator-=( VImage &a, const VImage b )
979
+ operator-=(VImage &a, const VImage b)
960
980
  {
961
- return( a = a - b );
981
+ a = a - b;
982
+ return a;
962
983
  }
963
984
 
964
985
  VImage &
965
- operator-=( VImage &a, const double b )
986
+ operator-=(VImage &a, const double b)
966
987
  {
967
- return( a = a - b );
988
+ a = a - b;
989
+ return a;
968
990
  }
969
991
 
970
992
  VImage &
971
- operator-=( VImage &a, const std::vector<double> b )
993
+ operator-=(VImage &a, const std::vector<double> b)
972
994
  {
973
- return( a = a - b );
995
+ a = a - b;
996
+ return a;
974
997
  }
975
998
 
976
999
  VImage
977
- operator-( const VImage a )
1000
+ operator-(const VImage a)
978
1001
  {
979
- return( a * -1 );
1002
+ return a * -1;
980
1003
  }
981
1004
 
982
1005
  VImage
983
- operator*( const VImage a, const VImage b )
1006
+ operator*(const VImage a, const VImage b)
984
1007
  {
985
- return( a.multiply( b ) );
1008
+ return a.multiply(b);
986
1009
  }
987
1010
 
988
1011
  VImage
989
- operator*( double a, const VImage b )
1012
+ operator*(double a, const VImage b)
990
1013
  {
991
- return( b.linear( a, 0.0 ) );
1014
+ return b.linear(a, 0.0);
992
1015
  }
993
1016
 
994
1017
  VImage
995
- operator*( const VImage a, double b )
1018
+ operator*(const VImage a, double b)
996
1019
  {
997
- return( a.linear( b, 0.0 ) );
1020
+ return a.linear(b, 0.0);
998
1021
  }
999
1022
 
1000
1023
  VImage
1001
- operator*( const std::vector<double> a, const VImage b )
1024
+ operator*(const std::vector<double> a, const VImage b)
1002
1025
  {
1003
- return( b.linear( a, 0.0 ) );
1026
+ return b.linear(a, 0.0);
1004
1027
  }
1005
1028
 
1006
1029
  VImage
1007
- operator*( const VImage a, const std::vector<double> b )
1030
+ operator*(const VImage a, const std::vector<double> b)
1008
1031
  {
1009
- return( a.linear( b, 0.0 ) );
1032
+ return a.linear(b, 0.0);
1010
1033
  }
1011
1034
 
1012
1035
  VImage &
1013
- operator*=( VImage &a, const VImage b )
1036
+ operator*=(VImage &a, const VImage b)
1014
1037
  {
1015
- return( a = a * b );
1038
+ a = a * b;
1039
+ return a;
1016
1040
  }
1017
1041
 
1018
1042
  VImage &
1019
- operator*=( VImage &a, const double b )
1043
+ operator*=(VImage &a, const double b)
1020
1044
  {
1021
- return( a = a * b );
1045
+ a = a * b;
1046
+ return a;
1022
1047
  }
1023
1048
 
1024
1049
  VImage &
1025
- operator*=( VImage &a, const std::vector<double> b )
1050
+ operator*=(VImage &a, const std::vector<double> b)
1026
1051
  {
1027
- return( a = a * b );
1052
+ a = a * b;
1053
+ return a;
1028
1054
  }
1029
1055
 
1030
1056
  VImage
1031
- operator/( const VImage a, const VImage b )
1057
+ operator/(const VImage a, const VImage b)
1032
1058
  {
1033
- return( a.divide( b ) );
1059
+ return a.divide(b);
1034
1060
  }
1035
1061
 
1036
1062
  VImage
1037
- operator/( double a, const VImage b )
1063
+ operator/(double a, const VImage b)
1038
1064
  {
1039
- return( b.pow( -1.0 ).linear( a, 0.0 ) );
1065
+ return b.pow(-1.0).linear(a, 0.0);
1040
1066
  }
1041
1067
 
1042
1068
  VImage
1043
- operator/( const VImage a, double b )
1069
+ operator/(const VImage a, double b)
1044
1070
  {
1045
- return( a.linear( 1.0 / b, 0.0 ) );
1071
+ return a.linear(1.0 / b, 0.0);
1046
1072
  }
1047
1073
 
1048
1074
  VImage
1049
- operator/( const std::vector<double> a, const VImage b )
1075
+ operator/(const std::vector<double> a, const VImage b)
1050
1076
  {
1051
- return( b.pow( -1.0 ).linear( a, 0.0 ) );
1077
+ return b.pow(-1.0).linear(a, 0.0);
1052
1078
  }
1053
1079
 
1054
1080
  VImage
1055
- operator/( const VImage a, const std::vector<double> b )
1081
+ operator/(const VImage a, const std::vector<double> b)
1056
1082
  {
1057
- return( a.linear( vips::invert( b ), 0.0 ) );
1083
+ return a.linear(vips::invert(b), 0.0);
1058
1084
  }
1059
1085
 
1060
1086
  VImage &
1061
- operator/=( VImage &a, const VImage b )
1087
+ operator/=(VImage &a, const VImage b)
1062
1088
  {
1063
- return( a = a / b );
1089
+ a = a / b;
1090
+ return a;
1064
1091
  }
1065
1092
 
1066
1093
  VImage &
1067
- operator/=( VImage &a, const double b )
1094
+ operator/=(VImage &a, const double b)
1068
1095
  {
1069
- return( a = a / b );
1096
+ a = a / b;
1097
+ return a;
1070
1098
  }
1071
1099
 
1072
1100
  VImage &
1073
- operator/=( VImage &a, const std::vector<double> b )
1101
+ operator/=(VImage &a, const std::vector<double> b)
1074
1102
  {
1075
- return( a = a / b );
1103
+ a = a / b;
1104
+ return a;
1076
1105
  }
1077
1106
 
1078
1107
  VImage
1079
- operator%( const VImage a, const VImage b )
1108
+ operator%(const VImage a, const VImage b)
1080
1109
  {
1081
- return( a.remainder( b ) );
1110
+ return a.remainder(b);
1082
1111
  }
1083
1112
 
1084
1113
  VImage
1085
- operator%( const VImage a, const double b )
1114
+ operator%(const VImage a, const double b)
1086
1115
  {
1087
- return( a.remainder_const( to_vector( b ) ) );
1116
+ return a.remainder_const(to_vector(b));
1088
1117
  }
1089
1118
 
1090
1119
  VImage
1091
- operator%( const VImage a, const std::vector<double> b )
1120
+ operator%(const VImage a, const std::vector<double> b)
1092
1121
  {
1093
- return( a.remainder_const( b ) );
1122
+ return a.remainder_const(b);
1094
1123
  }
1095
1124
 
1096
1125
  VImage &
1097
- operator%=( VImage &a, const VImage b )
1126
+ operator%=(VImage &a, const VImage b)
1098
1127
  {
1099
- return( a = a % b );
1128
+ a = a % b;
1129
+ return a;
1100
1130
  }
1101
1131
 
1102
1132
  VImage &
1103
- operator%=( VImage &a, const double b )
1133
+ operator%=(VImage &a, const double b)
1104
1134
  {
1105
- return( a = a % b );
1135
+ a = a % b;
1136
+ return a;
1106
1137
  }
1107
1138
 
1108
1139
  VImage &
1109
- operator%=( VImage &a, const std::vector<double> b )
1140
+ operator%=(VImage &a, const std::vector<double> b)
1110
1141
  {
1111
- return( a = a % b );
1142
+ a = a % b;
1143
+ return a;
1112
1144
  }
1113
1145
 
1114
1146
  VImage
1115
- operator<( const VImage a, const VImage b )
1147
+ operator<(const VImage a, const VImage b)
1116
1148
  {
1117
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESS ) );
1149
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_LESS);
1118
1150
  }
1119
1151
 
1120
1152
  VImage
1121
- operator<( const double a, const VImage b )
1153
+ operator<(const double a, const VImage b)
1122
1154
  {
1123
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
1124
- to_vector( a ) ) );
1155
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_MORE,
1156
+ to_vector(a));
1125
1157
  }
1126
1158
 
1127
1159
  VImage
1128
- operator<( const VImage a, const double b )
1160
+ operator<(const VImage a, const double b)
1129
1161
  {
1130
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
1131
- to_vector( b ) ) );
1162
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_LESS,
1163
+ to_vector(b));
1132
1164
  }
1133
1165
 
1134
1166
  VImage
1135
- operator<( const std::vector<double> a, const VImage b )
1167
+ operator<(const std::vector<double> a, const VImage b)
1136
1168
  {
1137
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
1138
- a ) );
1169
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_MORE,
1170
+ a);
1139
1171
  }
1140
1172
 
1141
1173
  VImage
1142
- operator<( const VImage a, const std::vector<double> b )
1174
+ operator<(const VImage a, const std::vector<double> b)
1143
1175
  {
1144
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
1145
- b ) );
1176
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_LESS,
1177
+ b);
1146
1178
  }
1147
1179
 
1148
1180
  VImage
1149
- operator<=( const VImage a, const VImage b )
1181
+ operator<=(const VImage a, const VImage b)
1150
1182
  {
1151
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_LESSEQ ) );
1183
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_LESSEQ);
1152
1184
  }
1153
1185
 
1154
1186
  VImage
1155
- operator<=( const double a, const VImage b )
1187
+ operator<=(const double a, const VImage b)
1156
1188
  {
1157
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
1158
- to_vector( a ) ) );
1189
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ,
1190
+ to_vector(a));
1159
1191
  }
1160
1192
 
1161
1193
  VImage
1162
- operator<=( const VImage a, const double b )
1194
+ operator<=(const VImage a, const double b)
1163
1195
  {
1164
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
1165
- to_vector( b ) ) );
1196
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ,
1197
+ to_vector(b));
1166
1198
  }
1167
1199
 
1168
1200
  VImage
1169
- operator<=( const std::vector<double> a, const VImage b )
1201
+ operator<=(const std::vector<double> a, const VImage b)
1170
1202
  {
1171
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
1172
- a ) );
1203
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ,
1204
+ a);
1173
1205
  }
1174
1206
 
1175
1207
  VImage
1176
- operator<=( const VImage a, const std::vector<double> b )
1208
+ operator<=(const VImage a, const std::vector<double> b)
1177
1209
  {
1178
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
1179
- b ) );
1210
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ,
1211
+ b);
1180
1212
  }
1181
1213
 
1182
1214
  VImage
1183
- operator>( const VImage a, const VImage b )
1215
+ operator>(const VImage a, const VImage b)
1184
1216
  {
1185
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_MORE ) );
1217
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_MORE);
1186
1218
  }
1187
1219
 
1188
1220
  VImage
1189
- operator>( const double a, const VImage b )
1221
+ operator>(const double a, const VImage b)
1190
1222
  {
1191
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
1192
- to_vector( a ) ) );
1223
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_LESS,
1224
+ to_vector(a));
1193
1225
  }
1194
1226
 
1195
1227
  VImage
1196
- operator>( const VImage a, const double b )
1228
+ operator>(const VImage a, const double b)
1197
1229
  {
1198
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
1199
- to_vector( b ) ) );
1230
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_MORE,
1231
+ to_vector(b));
1200
1232
  }
1201
1233
 
1202
1234
  VImage
1203
- operator>( const std::vector<double> a, const VImage b )
1235
+ operator>(const std::vector<double> a, const VImage b)
1204
1236
  {
1205
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESS,
1206
- a ) );
1237
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_LESS,
1238
+ a);
1207
1239
  }
1208
1240
 
1209
1241
  VImage
1210
- operator>( const VImage a, const std::vector<double> b )
1242
+ operator>(const VImage a, const std::vector<double> b)
1211
1243
  {
1212
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MORE,
1213
- b ) );
1244
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_MORE,
1245
+ b);
1214
1246
  }
1215
1247
 
1216
1248
  VImage
1217
- operator>=( const VImage a, const VImage b )
1249
+ operator>=(const VImage a, const VImage b)
1218
1250
  {
1219
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_MOREEQ ) );
1251
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_MOREEQ);
1220
1252
  }
1221
1253
 
1222
1254
  VImage
1223
- operator>=( const double a, const VImage b )
1255
+ operator>=(const double a, const VImage b)
1224
1256
  {
1225
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
1226
- to_vector( a ) ) );
1257
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ,
1258
+ to_vector(a));
1227
1259
  }
1228
1260
 
1229
1261
  VImage
1230
- operator>=( const VImage a, const double b )
1262
+ operator>=(const VImage a, const double b)
1231
1263
  {
1232
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
1233
- to_vector( b ) ) );
1264
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ,
1265
+ to_vector(b));
1234
1266
  }
1235
1267
 
1236
1268
  VImage
1237
- operator>=( const std::vector<double> a, const VImage b )
1269
+ operator>=(const std::vector<double> a, const VImage b)
1238
1270
  {
1239
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_LESSEQ,
1240
- a ) );
1271
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_LESSEQ,
1272
+ a);
1241
1273
  }
1242
1274
 
1243
1275
  VImage
1244
- operator>=( const VImage a, const std::vector<double> b )
1276
+ operator>=(const VImage a, const std::vector<double> b)
1245
1277
  {
1246
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_MOREEQ,
1247
- b ) );
1278
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_MOREEQ,
1279
+ b);
1248
1280
  }
1249
1281
 
1250
1282
  VImage
1251
- operator==( const VImage a, const VImage b )
1283
+ operator==(const VImage a, const VImage b)
1252
1284
  {
1253
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_EQUAL ) );
1285
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_EQUAL);
1254
1286
  }
1255
1287
 
1256
1288
  VImage
1257
- operator==( const double a, const VImage b )
1289
+ operator==(const double a, const VImage b)
1258
1290
  {
1259
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
1260
- to_vector( a ) ) );
1291
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL,
1292
+ to_vector(a));
1261
1293
  }
1262
1294
 
1263
1295
  VImage
1264
- operator==( const VImage a, const double b )
1296
+ operator==(const VImage a, const double b)
1265
1297
  {
1266
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
1267
- to_vector( b ) ) );
1298
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL,
1299
+ to_vector(b));
1268
1300
  }
1269
1301
 
1270
1302
  VImage
1271
- operator==( const std::vector<double> a, const VImage b )
1303
+ operator==(const std::vector<double> a, const VImage b)
1272
1304
  {
1273
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
1274
- a ) );
1305
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL,
1306
+ a);
1275
1307
  }
1276
1308
 
1277
1309
  VImage
1278
- operator==( const VImage a, const std::vector<double> b )
1310
+ operator==(const VImage a, const std::vector<double> b)
1279
1311
  {
1280
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_EQUAL,
1281
- b ) );
1312
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_EQUAL,
1313
+ b);
1282
1314
  }
1283
1315
 
1284
1316
  VImage
1285
- operator!=( const VImage a, const VImage b )
1317
+ operator!=(const VImage a, const VImage b)
1286
1318
  {
1287
- return( a.relational( b, VIPS_OPERATION_RELATIONAL_NOTEQ ) );
1319
+ return a.relational(b, VIPS_OPERATION_RELATIONAL_NOTEQ);
1288
1320
  }
1289
1321
 
1290
1322
  VImage
1291
- operator!=( const double a, const VImage b )
1323
+ operator!=(const double a, const VImage b)
1292
1324
  {
1293
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
1294
- to_vector( a ) ) );
1325
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ,
1326
+ to_vector(a));
1295
1327
  }
1296
1328
 
1297
1329
  VImage
1298
- operator!=( const VImage a, const double b )
1330
+ operator!=(const VImage a, const double b)
1299
1331
  {
1300
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
1301
- to_vector( b ) ) );
1332
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ,
1333
+ to_vector(b));
1302
1334
  }
1303
1335
 
1304
1336
  VImage
1305
- operator!=( const std::vector<double> a, const VImage b )
1337
+ operator!=(const std::vector<double> a, const VImage b)
1306
1338
  {
1307
- return( b.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
1308
- a ) );
1339
+ return b.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ,
1340
+ a);
1309
1341
  }
1310
1342
 
1311
1343
  VImage
1312
- operator!=( const VImage a, const std::vector<double> b )
1344
+ operator!=(const VImage a, const std::vector<double> b)
1313
1345
  {
1314
- return( a.relational_const( VIPS_OPERATION_RELATIONAL_NOTEQ,
1315
- b ) );
1346
+ return a.relational_const(VIPS_OPERATION_RELATIONAL_NOTEQ,
1347
+ b);
1316
1348
  }
1317
1349
 
1318
1350
  VImage
1319
- operator&( const VImage a, const VImage b )
1351
+ operator&(const VImage a, const VImage b)
1320
1352
  {
1321
- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_AND ) );
1353
+ return a.boolean(b, VIPS_OPERATION_BOOLEAN_AND);
1322
1354
  }
1323
1355
 
1324
1356
  VImage
1325
- operator&( const double a, const VImage b )
1357
+ operator&(const double a, const VImage b)
1326
1358
  {
1327
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND,
1328
- to_vector( a ) ) );
1359
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_AND,
1360
+ to_vector(a));
1329
1361
  }
1330
1362
 
1331
1363
  VImage
1332
- operator&( const VImage a, const double b )
1364
+ operator&(const VImage a, const double b)
1333
1365
  {
1334
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND,
1335
- to_vector( b ) ) );
1366
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_AND,
1367
+ to_vector(b));
1336
1368
  }
1337
1369
 
1338
1370
  VImage
1339
- operator&( const std::vector<double> a, const VImage b )
1371
+ operator&(const std::vector<double> a, const VImage b)
1340
1372
  {
1341
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_AND, a ) );
1373
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_AND, a);
1342
1374
  }
1343
1375
 
1344
1376
  VImage
1345
- operator&( const VImage a, const std::vector<double> b )
1377
+ operator&(const VImage a, const std::vector<double> b)
1346
1378
  {
1347
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_AND, b ) );
1379
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_AND, b);
1348
1380
  }
1349
1381
 
1350
1382
  VImage &
1351
- operator&=( VImage &a, const VImage b )
1383
+ operator&=(VImage &a, const VImage b)
1352
1384
  {
1353
- return( a = a & b );
1385
+ a = a & b;
1386
+ return a;
1354
1387
  }
1355
1388
 
1356
1389
  VImage &
1357
- operator&=( VImage &a, const double b )
1390
+ operator&=(VImage &a, const double b)
1358
1391
  {
1359
- return( a = a & b );
1392
+ a = a & b;
1393
+ return a;
1360
1394
  }
1361
1395
 
1362
1396
  VImage &
1363
- operator&=( VImage &a, const std::vector<double> b )
1397
+ operator&=(VImage &a, const std::vector<double> b)
1364
1398
  {
1365
- return( a = a & b );
1399
+ a = a & b;
1400
+ return a;
1366
1401
  }
1367
1402
 
1368
1403
  VImage
1369
- operator|( const VImage a, const VImage b )
1404
+ operator|(const VImage a, const VImage b)
1370
1405
  {
1371
- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_OR ) );
1406
+ return a.boolean(b, VIPS_OPERATION_BOOLEAN_OR);
1372
1407
  }
1373
1408
 
1374
1409
  VImage
1375
- operator|( const double a, const VImage b )
1410
+ operator|(const double a, const VImage b)
1376
1411
  {
1377
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
1378
- to_vector( a ) ) );
1412
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_OR,
1413
+ to_vector(a));
1379
1414
  }
1380
1415
 
1381
1416
  VImage
1382
- operator|( const VImage a, const double b )
1417
+ operator|(const VImage a, const double b)
1383
1418
  {
1384
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
1385
- to_vector( b ) ) );
1419
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_OR,
1420
+ to_vector(b));
1386
1421
  }
1387
1422
 
1388
1423
  VImage
1389
- operator|( const std::vector<double> a, const VImage b )
1424
+ operator|(const std::vector<double> a, const VImage b)
1390
1425
  {
1391
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
1392
- a ) );
1426
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_OR,
1427
+ a);
1393
1428
  }
1394
1429
 
1395
1430
  VImage
1396
- operator|( const VImage a, const std::vector<double> b )
1431
+ operator|(const VImage a, const std::vector<double> b)
1397
1432
  {
1398
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_OR,
1399
- b ) );
1433
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_OR,
1434
+ b);
1400
1435
  }
1401
1436
 
1402
1437
  VImage &
1403
- operator|=( VImage &a, const VImage b )
1438
+ operator|=(VImage &a, const VImage b)
1404
1439
  {
1405
- return( a = a | b );
1440
+ a = a | b;
1441
+ return a;
1406
1442
  }
1407
1443
 
1408
1444
  VImage &
1409
- operator|=( VImage &a, const double b )
1445
+ operator|=(VImage &a, const double b)
1410
1446
  {
1411
- return( a = a | b );
1447
+ a = a | b;
1448
+ return a;
1412
1449
  }
1413
1450
 
1414
1451
  VImage &
1415
- operator|=( VImage &a, const std::vector<double> b )
1452
+ operator|=(VImage &a, const std::vector<double> b)
1416
1453
  {
1417
- return( a = a | b );
1454
+ a = a | b;
1455
+ return a;
1418
1456
  }
1419
1457
 
1420
1458
  VImage
1421
- operator^( const VImage a, const VImage b )
1459
+ operator^(const VImage a, const VImage b)
1422
1460
  {
1423
- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_EOR ) );
1461
+ return a.boolean(b, VIPS_OPERATION_BOOLEAN_EOR);
1424
1462
  }
1425
1463
 
1426
1464
  VImage
1427
- operator^( const double a, const VImage b )
1465
+ operator^(const double a, const VImage b)
1428
1466
  {
1429
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
1430
- to_vector( a ) ) );
1467
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_EOR,
1468
+ to_vector(a));
1431
1469
  }
1432
1470
 
1433
1471
  VImage
1434
- operator^( const VImage a, const double b )
1472
+ operator^(const VImage a, const double b)
1435
1473
  {
1436
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
1437
- to_vector( b ) ) );
1474
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_EOR,
1475
+ to_vector(b));
1438
1476
  }
1439
1477
 
1440
1478
  VImage
1441
- operator^( const std::vector<double> a, const VImage b )
1479
+ operator^(const std::vector<double> a, const VImage b)
1442
1480
  {
1443
- return( b.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
1444
- a ) );
1481
+ return b.boolean_const(VIPS_OPERATION_BOOLEAN_EOR,
1482
+ a);
1445
1483
  }
1446
1484
 
1447
1485
  VImage
1448
- operator^( const VImage a, const std::vector<double> b )
1486
+ operator^(const VImage a, const std::vector<double> b)
1449
1487
  {
1450
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_EOR,
1451
- b ) );
1488
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_EOR,
1489
+ b);
1452
1490
  }
1453
1491
 
1454
1492
  VImage &
1455
- operator^=( VImage &a, const VImage b )
1493
+ operator^=(VImage &a, const VImage b)
1456
1494
  {
1457
- return( a = a ^ b );
1495
+ a = a ^ b;
1496
+ return a;
1458
1497
  }
1459
1498
 
1460
1499
  VImage &
1461
- operator^=( VImage &a, const double b )
1500
+ operator^=(VImage &a, const double b)
1462
1501
  {
1463
- return( a = a ^ b );
1502
+ a = a ^ b;
1503
+ return a;
1464
1504
  }
1465
1505
 
1466
1506
  VImage &
1467
- operator^=( VImage &a, const std::vector<double> b )
1507
+ operator^=(VImage &a, const std::vector<double> b)
1468
1508
  {
1469
- return( a = a ^ b );
1509
+ a = a ^ b;
1510
+ return a;
1470
1511
  }
1471
1512
 
1472
1513
  VImage
1473
- operator<<( const VImage a, const VImage b )
1514
+ operator<<(const VImage a, const VImage b)
1474
1515
  {
1475
- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_LSHIFT ) );
1516
+ return a.boolean(b, VIPS_OPERATION_BOOLEAN_LSHIFT);
1476
1517
  }
1477
1518
 
1478
1519
  VImage
1479
- operator<<( const VImage a, const double b )
1520
+ operator<<(const VImage a, const double b)
1480
1521
  {
1481
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT,
1482
- to_vector( b ) ) );
1522
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_LSHIFT,
1523
+ to_vector(b));
1483
1524
  }
1484
1525
 
1485
1526
  VImage
1486
- operator<<( const VImage a, const std::vector<double> b )
1527
+ operator<<(const VImage a, const std::vector<double> b)
1487
1528
  {
1488
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_LSHIFT,
1489
- b ) );
1529
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_LSHIFT,
1530
+ b);
1490
1531
  }
1491
1532
 
1492
1533
  VImage &
1493
- operator<<=( VImage &a, const VImage b )
1534
+ operator<<=(VImage &a, const VImage b)
1494
1535
  {
1495
- return( a = a << b );
1536
+ a = a << b;
1537
+ return a;
1496
1538
  }
1497
1539
 
1498
1540
  VImage &
1499
- operator<<=( VImage &a, const double b )
1541
+ operator<<=(VImage &a, const double b)
1500
1542
  {
1501
- return( a = a << b );
1543
+ a = a << b;
1544
+ return a;
1502
1545
  }
1503
1546
 
1504
1547
  VImage &
1505
- operator<<=( VImage &a, const std::vector<double> b )
1548
+ operator<<=(VImage &a, const std::vector<double> b)
1506
1549
  {
1507
- return( a = a << b );
1550
+ a = a << b;
1551
+ return a;
1508
1552
  }
1509
1553
 
1510
1554
  VImage
1511
- operator>>( const VImage a, const VImage b )
1555
+ operator>>(const VImage a, const VImage b)
1512
1556
  {
1513
- return( a.boolean( b, VIPS_OPERATION_BOOLEAN_RSHIFT ) );
1557
+ return a.boolean(b, VIPS_OPERATION_BOOLEAN_RSHIFT);
1514
1558
  }
1515
1559
 
1516
1560
  VImage
1517
- operator>>( const VImage a, const double b )
1561
+ operator>>(const VImage a, const double b)
1518
1562
  {
1519
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT,
1520
- to_vector( b ) ) );
1563
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_RSHIFT,
1564
+ to_vector(b));
1521
1565
  }
1522
1566
 
1523
1567
  VImage
1524
- operator>>( const VImage a, const std::vector<double> b )
1568
+ operator>>(const VImage a, const std::vector<double> b)
1525
1569
  {
1526
- return( a.boolean_const( VIPS_OPERATION_BOOLEAN_RSHIFT,
1527
- b ) );
1570
+ return a.boolean_const(VIPS_OPERATION_BOOLEAN_RSHIFT,
1571
+ b);
1528
1572
  }
1529
1573
 
1530
1574
  VImage &
1531
- operator>>=( VImage &a, const VImage b )
1575
+ operator>>=(VImage &a, const VImage b)
1532
1576
  {
1533
- return( a = a << b );
1577
+ a = a << b;
1578
+ return a;
1534
1579
  }
1535
1580
 
1536
1581
  VImage &
1537
- operator>>=( VImage &a, const double b )
1582
+ operator>>=(VImage &a, const double b)
1538
1583
  {
1539
- return( a = a << b );
1584
+ a = a << b;
1585
+ return a;
1540
1586
  }
1541
1587
 
1542
1588
  VImage &
1543
- operator>>=( VImage &a, const std::vector<double> b )
1589
+ operator>>=(VImage &a, const std::vector<double> b)
1544
1590
  {
1545
- return( a = a << b );
1591
+ a = a << b;
1592
+ return a;
1546
1593
  }
1547
1594
 
1548
1595
  VIPS_NAMESPACE_END