@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
@@ -8,28 +8,28 @@
8
8
 
9
9
  /*
10
10
 
11
- This file is part of VIPS.
12
-
13
- VIPS is free software; you can redistribute it and/or modify
14
- it under the terms of the GNU Lesser General Public License as published by
15
- the Free Software Foundation; either version 2 of the License, or
16
- (at your option) any later version.
17
-
18
- This program is distributed in the hope that it will be useful,
19
- but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- GNU Lesser General Public License for more details.
22
-
23
- You should have received a copy of the GNU Lesser General Public License
24
- along with this program; if not, write to the Free Software
25
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
- 02110-1301 USA
11
+ This file is part of VIPS.
12
+
13
+ VIPS is free software; you can redistribute it and/or modify
14
+ it under the terms of the GNU Lesser General Public License as published by
15
+ the Free Software Foundation; either version 2 of the License, or
16
+ (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU Lesser General Public License for more details.
22
+
23
+ You should have received a copy of the GNU Lesser General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
+ 02110-1301 USA
27
27
 
28
28
  */
29
29
 
30
30
  /*
31
31
 
32
- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
32
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
33
33
 
34
34
  */
35
35
 
@@ -47,8 +47,8 @@
47
47
  extern "C" {
48
48
  #endif /*__cplusplus*/
49
49
 
50
- /* If you read MSB first, you get these two values.
51
- * intel order: byte 0 = b6
50
+ /* If you read MSB first, you get these two values.
51
+ * intel order: byte 0 = b6
52
52
  * SPARC order: byte 0 = 08
53
53
  */
54
54
  #define VIPS_MAGIC_INTEL (0xb6a6f208U)
@@ -64,26 +64,26 @@ extern "C" {
64
64
  #define VIPS_MAX_COORD (10000000)
65
65
 
66
66
  typedef enum {
67
- VIPS_DEMAND_STYLE_ERROR = -1,
68
- VIPS_DEMAND_STYLE_SMALLTILE,
67
+ VIPS_DEMAND_STYLE_ERROR = -1,
68
+ VIPS_DEMAND_STYLE_SMALLTILE,
69
69
  VIPS_DEMAND_STYLE_FATSTRIP,
70
70
  VIPS_DEMAND_STYLE_THINSTRIP,
71
- VIPS_DEMAND_STYLE_ANY
71
+ VIPS_DEMAND_STYLE_ANY
72
72
  } VipsDemandStyle;
73
73
 
74
74
  /* Types of image descriptor we may have. The type field is advisory only: it
75
75
  * does not imply that any fields in IMAGE have valid data.
76
76
  */
77
77
  typedef enum {
78
- VIPS_IMAGE_ERROR = -1,
79
- VIPS_IMAGE_NONE, /* no type set */
80
- VIPS_IMAGE_SETBUF, /* malloced memory array */
81
- VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close */
82
- VIPS_IMAGE_OPENIN, /* input from fd with a window */
83
- VIPS_IMAGE_MMAPIN, /* memory mapped input file */
84
- VIPS_IMAGE_MMAPINRW, /* memory mapped read/write file */
85
- VIPS_IMAGE_OPENOUT, /* output to fd */
86
- VIPS_IMAGE_PARTIAL /* partial image */
78
+ VIPS_IMAGE_ERROR = -1,
79
+ VIPS_IMAGE_NONE, /* no type set */
80
+ VIPS_IMAGE_SETBUF, /* malloced memory array */
81
+ VIPS_IMAGE_SETBUF_FOREIGN, /* memory array, don't free on close */
82
+ VIPS_IMAGE_OPENIN, /* input from fd with a window */
83
+ VIPS_IMAGE_MMAPIN, /* memory mapped input file */
84
+ VIPS_IMAGE_MMAPINRW, /* memory mapped read/write file */
85
+ VIPS_IMAGE_OPENOUT, /* output to fd */
86
+ VIPS_IMAGE_PARTIAL /* partial image */
87
87
  } VipsImageType;
88
88
 
89
89
  typedef enum {
@@ -140,41 +140,41 @@ typedef enum {
140
140
  VIPS_ACCESS_LAST
141
141
  } VipsAccess;
142
142
 
143
- typedef void *(*VipsStartFn)( VipsImage *out, void *a, void *b );
144
- typedef int (*VipsGenerateFn)( VipsRegion *out,
145
- void *seq, void *a, void *b, gboolean *stop );
146
- typedef int (*VipsStopFn)( void *seq, void *a, void *b );
143
+ typedef void *(*VipsStartFn)(VipsImage *out, void *a, void *b);
144
+ typedef int (*VipsGenerateFn)(VipsRegion *out,
145
+ void *seq, void *a, void *b, gboolean *stop);
146
+ typedef int (*VipsStopFn)(void *seq, void *a, void *b);
147
147
 
148
148
  /* Struct we keep a record of execution time in. Passed to eval signal so
149
149
  * it can assess progress.
150
150
  */
151
151
  typedef struct _VipsProgress {
152
152
  /*< private >*/
153
- VipsImage *im; /* Image we are part of */
153
+ VipsImage *im; /* Image we are part of */
154
154
 
155
155
  /*< public >*/
156
- int run; /* Time we have been running */
157
- int eta; /* Estimated seconds of computation left */
158
- gint64 tpels; /* Number of pels we expect to calculate */
159
- gint64 npels; /* Number of pels calculated so far */
160
- int percent; /* Percent complete */
161
- GTimer *start; /* Start time */
156
+ int run; /* Time we have been running */
157
+ int eta; /* Estimated seconds of computation left */
158
+ gint64 tpels; /* Number of pels we expect to calculate */
159
+ gint64 npels; /* Number of pels calculated so far */
160
+ int percent; /* Percent complete */
161
+ GTimer *start; /* Start time */
162
162
  } VipsProgress;
163
163
 
164
164
  #define VIPS_TYPE_IMAGE (vips_image_get_type())
165
- #define VIPS_IMAGE( obj ) \
166
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
167
- VIPS_TYPE_IMAGE, VipsImage ))
168
- #define VIPS_IMAGE_CLASS( klass ) \
169
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
170
- VIPS_TYPE_IMAGE, VipsImageClass))
171
- #define VIPS_IS_IMAGE( obj ) \
172
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_IMAGE ))
173
- #define VIPS_IS_IMAGE_CLASS( klass ) \
174
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_IMAGE ))
175
- #define VIPS_IMAGE_GET_CLASS( obj ) \
176
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
177
- VIPS_TYPE_IMAGE, VipsImageClass ))
165
+ #define VIPS_IMAGE(obj) \
166
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
167
+ VIPS_TYPE_IMAGE, VipsImage))
168
+ #define VIPS_IMAGE_CLASS(klass) \
169
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
170
+ VIPS_TYPE_IMAGE, VipsImageClass))
171
+ #define VIPS_IS_IMAGE(obj) \
172
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_IMAGE))
173
+ #define VIPS_IS_IMAGE_CLASS(klass) \
174
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_IMAGE))
175
+ #define VIPS_IMAGE_GET_CLASS(obj) \
176
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
177
+ VIPS_TYPE_IMAGE, VipsImageClass))
178
178
 
179
179
  /* Matching typedef in basic.h.
180
180
  */
@@ -187,26 +187,26 @@ struct _VipsImage {
187
187
  * Don't use them though, use vips_image_get_width() and friends.
188
188
  */
189
189
 
190
- int Xsize; /* image width, in pixels */
191
- int Ysize; /* image height, in pixels */
192
- int Bands; /* number of image bands */
190
+ int Xsize; /* image width, in pixels */
191
+ int Ysize; /* image height, in pixels */
192
+ int Bands; /* number of image bands */
193
193
 
194
- VipsBandFormat BandFmt; /* pixel format */
195
- VipsCoding Coding; /* pixel coding */
196
- VipsInterpretation Type;/* pixel interpretation */
197
- double Xres; /* horizontal pixels per millimetre */
198
- double Yres; /* vertical pixels per millimetre */
194
+ VipsBandFormat BandFmt; /* pixel format */
195
+ VipsCoding Coding; /* pixel coding */
196
+ VipsInterpretation Type; /* pixel interpretation */
197
+ double Xres; /* horizontal pixels per millimetre */
198
+ double Yres; /* vertical pixels per millimetre */
199
199
 
200
- int Xoffset; /* image origin hint */
201
- int Yoffset; /* image origin hint */
200
+ int Xoffset; /* image origin hint */
201
+ int Yoffset; /* image origin hint */
202
202
 
203
- /* No longer used, the names are here for compat with very, very old
203
+ /* No longer used, the names are here for compat with very, very old
204
204
  * code.
205
205
  */
206
206
  int Length;
207
207
  short Compression;
208
208
  short Level;
209
- int Bbits; /* was number of bits in this format */
209
+ int Bbits; /* was number of bits in this format */
210
210
 
211
211
  /* Old code expects to see this member, newer code has a param on
212
212
  * eval().
@@ -217,8 +217,8 @@ struct _VipsImage {
217
217
  * vips_image_get_history() and friends.
218
218
  */
219
219
  char *Hist; /* don't use, see vips_image_get_history() */
220
- char *filename; /* pointer to copy of filename */
221
- VipsPel *data; /* start of image data for WIO */
220
+ char *filename; /* pointer to copy of filename */
221
+ VipsPel *data; /* start of image data for WIO */
222
222
  int kill; /* set to non-zero to block eval */
223
223
 
224
224
  /* Everything below this private and only used internally by
@@ -232,29 +232,29 @@ struct _VipsImage {
232
232
  float Xres_float;
233
233
  float Yres_float;
234
234
 
235
- char *mode; /* mode string passed to _new() */
236
- VipsImageType dtype; /* descriptor type */
237
- int fd; /* file descriptor */
238
- void *baseaddr; /* pointer to the start of an mmap file */
239
- size_t length; /* size of mmap area */
240
- guint32 magic; /* magic from header, endian-ness of image */
235
+ char *mode; /* mode string passed to _new() */
236
+ VipsImageType dtype; /* descriptor type */
237
+ int fd; /* file descriptor */
238
+ void *baseaddr; /* pointer to the start of an mmap file */
239
+ size_t length; /* size of mmap area */
240
+ guint32 magic; /* magic from header, endian-ness of image */
241
241
 
242
- /* Partial image stuff. All these fields are initialised
242
+ /* Partial image stuff. All these fields are initialised
243
243
  * to NULL and ignored unless set by vips_image_generate() etc.
244
244
  */
245
245
  VipsStartFn start_fn;
246
246
  VipsGenerateFn generate_fn;
247
247
  VipsStopFn stop_fn;
248
- void *client1; /* user arguments */
248
+ void *client1; /* user arguments */
249
249
  void *client2;
250
- GMutex *sslock; /* start-stop lock */
251
- GSList *regions; /* list of regions current for this image */
252
- VipsDemandStyle dhint; /* demand style hint */
250
+ GMutex *sslock; /* start-stop lock */
251
+ GSList *regions; /* list of regions current for this image */
252
+ VipsDemandStyle dhint; /* demand style hint */
253
253
 
254
254
  /* Extra user-defined fields ... see vips_image_get() etc.
255
255
  */
256
- GHashTable *meta; /* GhashTable of GValue */
257
- GSList *meta_traverse; /* traverse order for Meta */
256
+ GHashTable *meta; /* GhashTable of GValue */
257
+ GSList *meta_traverse; /* traverse order for Meta */
258
258
 
259
259
  /* Part of mmap() read ... the sizeof() the header we skip from the
260
260
  * file start. Usually VIPS_SIZEOF_HEADER, but can be something else
@@ -271,7 +271,7 @@ struct _VipsImage {
271
271
  */
272
272
  GSList *windows;
273
273
 
274
- /* Upstream/downstream relationships, built from args to
274
+ /* Upstream/downstream relationships, built from args to
275
275
  * vips_demand_hint().
276
276
  *
277
277
  * We use these to invalidate downstream pixel buffers.
@@ -328,37 +328,37 @@ typedef struct _VipsImageClass {
328
328
 
329
329
  /* Evaluation is starting.
330
330
  */
331
- void (*preeval)( VipsImage *image, VipsProgress *progress, void *data );
331
+ void (*preeval)(VipsImage *image, VipsProgress *progress, void *data);
332
332
 
333
333
  /* Evaluation progress.
334
334
  */
335
- void (*eval)( VipsImage *image, VipsProgress *progress, void *data );
335
+ void (*eval)(VipsImage *image, VipsProgress *progress, void *data);
336
336
 
337
337
  /* Evaluation is ending.
338
338
  */
339
- void (*posteval)( VipsImage *image, VipsProgress *progress, void *data );
339
+ void (*posteval)(VipsImage *image, VipsProgress *progress, void *data);
340
340
 
341
- /* An image has been written to.
342
- * Used by eg. vips_image_new_mode("x.jpg", "w") to do the
341
+ /* An image has been written to.
342
+ * Used by eg. vips_image_new_mode("x.jpg", "w") to do the
343
343
  * final write to jpeg.
344
344
  * Set *result to non-zero to indicate an error on write.
345
345
  */
346
- void (*written)( VipsImage *image, int *result, void *data );
346
+ void (*written)(VipsImage *image, int *result, void *data);
347
347
 
348
- /* An image has been modified in some way and all caches
349
- * need dropping.
348
+ /* An image has been modified in some way and all caches
349
+ * need dropping.
350
350
  */
351
- void (*invalidate)( VipsImage *image, void *data );
351
+ void (*invalidate)(VipsImage *image, void *data);
352
352
 
353
- /* Minimise this pipeline.
353
+ /* Minimise this pipeline.
354
354
  *
355
355
  * This is triggered (sometimes) at the end of eval to signal that
356
356
  * we're probably done and that operations involved should try to
357
- * minimise memory use by, for example, dropping caches.
357
+ * minimise memory use by, for example, dropping caches.
358
358
  *
359
359
  * See vips_tilecache().
360
360
  */
361
- void (*minimise)( VipsImage *image, void *data );
361
+ void (*minimise)(VipsImage *image, void *data);
362
362
 
363
363
  } VipsImageClass;
364
364
 
@@ -373,230 +373,230 @@ GType vips_image_get_type(void);
373
373
 
374
374
  /* Pixel address calculation macros.
375
375
  */
376
- #define VIPS_IMAGE_SIZEOF_ELEMENT( I ) \
376
+ #define VIPS_IMAGE_SIZEOF_ELEMENT(I) \
377
377
  (vips_format_sizeof_unsafe((I)->BandFmt))
378
- #define VIPS_IMAGE_SIZEOF_PEL( I ) \
379
- (VIPS_IMAGE_SIZEOF_ELEMENT( I ) * (I)->Bands)
380
- #define VIPS_IMAGE_SIZEOF_LINE( I ) \
381
- (VIPS_IMAGE_SIZEOF_PEL( I ) * (I)->Xsize)
382
- #define VIPS_IMAGE_SIZEOF_IMAGE( I ) \
383
- (VIPS_IMAGE_SIZEOF_LINE( I ) * (I)->Ysize)
384
- #define VIPS_IMAGE_N_ELEMENTS( I ) \
378
+ #define VIPS_IMAGE_SIZEOF_PEL(I) \
379
+ (VIPS_IMAGE_SIZEOF_ELEMENT(I) * (I)->Bands)
380
+ #define VIPS_IMAGE_SIZEOF_LINE(I) \
381
+ (VIPS_IMAGE_SIZEOF_PEL(I) * (I)->Xsize)
382
+ #define VIPS_IMAGE_SIZEOF_IMAGE(I) \
383
+ (VIPS_IMAGE_SIZEOF_LINE(I) * (I)->Ysize)
384
+ #define VIPS_IMAGE_N_ELEMENTS(I) \
385
385
  ((I)->Bands * (I)->Xsize)
386
- #define VIPS_IMAGE_N_PELS( I ) \
386
+ #define VIPS_IMAGE_N_PELS(I) \
387
387
  ((guint64) (I)->Xsize * (I)->Ysize)
388
388
 
389
389
  /* If VIPS_DEBUG is defined, add bounds checking.
390
390
  */
391
391
  #ifdef VIPS_DEBUG
392
- #define VIPS_IMAGE_ADDR( I, X, Y ) \
393
- ( ((X) >= 0 && (X) < VIPS_IMAGE( I )->Xsize && \
394
- (Y) >= 0 && (Y) < VIPS_IMAGE( I )->Ysize && \
395
- VIPS_IMAGE( I )->data) ? \
396
- (VIPS_IMAGE( I )->data + \
397
- (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \
398
- (X) * VIPS_IMAGE_SIZEOF_PEL( I )) : \
399
- (fprintf( stderr, \
400
- "VIPS_IMAGE_ADDR: point out of bounds, " \
401
- "file \"%s\", line %d\n" \
402
- "(point x=%d, y=%d\n" \
403
- " should have been within VipsRect left=%d, top=%d, " \
404
- "width=%d, height=%d)\n", \
405
- __FILE__, __LINE__, \
406
- (X), (Y), \
407
- 0, 0, \
408
- VIPS_IMAGE( I )->Xsize, \
409
- VIPS_IMAGE( I )->Ysize ), (VipsPel *) NULL) \
410
- )
392
+ #define VIPS_IMAGE_ADDR(I, X, Y) \
393
+ (((X) >= 0 && (X) < VIPS_IMAGE(I)->Xsize && \
394
+ (Y) >= 0 && (Y) < VIPS_IMAGE(I)->Ysize && \
395
+ VIPS_IMAGE(I)->data) \
396
+ ? (VIPS_IMAGE(I)->data + \
397
+ (Y) *VIPS_IMAGE_SIZEOF_LINE(I) + \
398
+ (X) *VIPS_IMAGE_SIZEOF_PEL(I)) \
399
+ : (fprintf(stderr, \
400
+ "VIPS_IMAGE_ADDR: point out of bounds, " \
401
+ "file \"%s\", line %d\n" \
402
+ "(point x=%d, y=%d\n" \
403
+ " should have been within VipsRect left=%d, top=%d, " \
404
+ "width=%d, height=%d)\n", \
405
+ __FILE__, __LINE__, \
406
+ (X), (Y), \
407
+ 0, 0, \
408
+ VIPS_IMAGE(I)->Xsize, \
409
+ VIPS_IMAGE(I)->Ysize), \
410
+ (VipsPel *) NULL))
411
411
  #else /*!VIPS_DEBUG*/
412
- #define VIPS_IMAGE_ADDR( I, X, Y ) \
412
+ #define VIPS_IMAGE_ADDR(I, X, Y) \
413
413
  ((I)->data + \
414
- (Y) * VIPS_IMAGE_SIZEOF_LINE( I ) + \
415
- (X) * VIPS_IMAGE_SIZEOF_PEL( I ))
414
+ (Y) *VIPS_IMAGE_SIZEOF_LINE(I) + \
415
+ (X) *VIPS_IMAGE_SIZEOF_PEL(I))
416
416
  #endif /*VIPS_DEBUG*/
417
417
 
418
418
  #ifdef VIPS_DEBUG
419
- #define VIPS_MATRIX( I, X, Y ) \
420
- ((VIPS_IMAGE( I )->BandFmt == VIPS_FORMAT_DOUBLE && \
421
- VIPS_IMAGE( I )->Bands == 1) ? \
422
- ((double *) VIPS_IMAGE_ADDR( I, X, Y )) : \
423
- (fprintf( stderr, "VIPS_MATRIX: not a matrix image\n" ), \
424
- (double *) NULL))
419
+ #define VIPS_MATRIX(I, X, Y) \
420
+ ((VIPS_IMAGE(I)->BandFmt == VIPS_FORMAT_DOUBLE && \
421
+ VIPS_IMAGE(I)->Bands == 1) \
422
+ ? ((double *) VIPS_IMAGE_ADDR(I, X, Y)) \
423
+ : (fprintf(stderr, "VIPS_MATRIX: not a matrix image\n"), \
424
+ (double *) NULL))
425
425
  #else /*!VIPS_DEBUG*/
426
- #define VIPS_MATRIX( I, X, Y ) \
427
- ((double *) VIPS_IMAGE_ADDR( I, X, Y ))
426
+ #define VIPS_MATRIX(I, X, Y) \
427
+ ((double *) VIPS_IMAGE_ADDR(I, X, Y))
428
428
  #endif /*VIPS_DEBUG*/
429
429
 
430
430
  VIPS_API
431
- void vips_progress_set( gboolean progress );
431
+ void vips_progress_set(gboolean progress);
432
432
 
433
433
  VIPS_API
434
- void vips_image_invalidate_all( VipsImage *image );
434
+ void vips_image_invalidate_all(VipsImage *image);
435
435
 
436
436
  VIPS_API
437
- void vips_image_minimise_all( VipsImage *image );
437
+ void vips_image_minimise_all(VipsImage *image);
438
438
 
439
439
  VIPS_API
440
- gboolean vips_image_is_sequential( VipsImage *image );
440
+ gboolean vips_image_is_sequential(VipsImage *image);
441
441
 
442
442
  VIPS_API
443
- void vips_image_set_progress( VipsImage *image, gboolean progress );
443
+ void vips_image_set_progress(VipsImage *image, gboolean progress);
444
444
  VIPS_API
445
- gboolean vips_image_iskilled( VipsImage *image );
445
+ gboolean vips_image_iskilled(VipsImage *image);
446
446
  VIPS_API
447
- void vips_image_set_kill( VipsImage *image, gboolean kill );
447
+ void vips_image_set_kill(VipsImage *image, gboolean kill);
448
448
 
449
449
  VIPS_API
450
- char *vips_filename_get_filename( const char *vips_filename );
450
+ char *vips_filename_get_filename(const char *vips_filename);
451
451
  VIPS_API
452
- char *vips_filename_get_options( const char *vips_filename );
452
+ char *vips_filename_get_options(const char *vips_filename);
453
453
 
454
454
  VIPS_API
455
- VipsImage *vips_image_new( void );
455
+ VipsImage *vips_image_new(void);
456
456
  VIPS_API
457
- VipsImage *vips_image_new_memory( void );
457
+ VipsImage *vips_image_new_memory(void);
458
458
  VIPS_API
459
- VipsImage *vips_image_memory( void );
459
+ VipsImage *vips_image_memory(void);
460
460
  VIPS_API
461
- VipsImage *vips_image_new_from_file( const char *name, ... )
461
+ VipsImage *vips_image_new_from_file(const char *name, ...)
462
462
  G_GNUC_NULL_TERMINATED;
463
463
  VIPS_API
464
- VipsImage *vips_image_new_from_file_RW( const char *filename );
464
+ VipsImage *vips_image_new_from_file_RW(const char *filename);
465
465
  VIPS_API
466
- VipsImage *vips_image_new_from_file_raw( const char *filename,
467
- int xsize, int ysize, int bands, guint64 offset );
466
+ VipsImage *vips_image_new_from_file_raw(const char *filename,
467
+ int xsize, int ysize, int bands, guint64 offset);
468
468
  VIPS_API
469
- VipsImage *vips_image_new_from_memory( const void *data, size_t size,
470
- int width, int height, int bands, VipsBandFormat format );
469
+ VipsImage *vips_image_new_from_memory(const void *data, size_t size,
470
+ int width, int height, int bands, VipsBandFormat format);
471
471
  VIPS_API
472
- VipsImage *vips_image_new_from_memory_copy( const void *data, size_t size,
473
- int width, int height, int bands, VipsBandFormat format );
472
+ VipsImage *vips_image_new_from_memory_copy(const void *data, size_t size,
473
+ int width, int height, int bands, VipsBandFormat format);
474
474
  VIPS_API
475
- VipsImage *vips_image_new_from_buffer( const void *buf, size_t len,
476
- const char *option_string, ... )
475
+ VipsImage *vips_image_new_from_buffer(const void *buf, size_t len,
476
+ const char *option_string, ...)
477
477
  G_GNUC_NULL_TERMINATED;
478
478
  VIPS_API
479
- VipsImage *vips_image_new_from_source( VipsSource *source,
480
- const char *option_string, ... ) G_GNUC_NULL_TERMINATED;
479
+ VipsImage *vips_image_new_from_source(VipsSource *source,
480
+ const char *option_string, ...) G_GNUC_NULL_TERMINATED;
481
481
  VIPS_API
482
- VipsImage *vips_image_new_matrix( int width, int height );
482
+ VipsImage *vips_image_new_matrix(int width, int height);
483
483
  VIPS_API
484
- VipsImage *vips_image_new_matrixv( int width, int height, ... );
484
+ VipsImage *vips_image_new_matrixv(int width, int height, ...);
485
485
  VIPS_API
486
- VipsImage *vips_image_new_matrix_from_array( int width, int height,
487
- const double *array, int size );
486
+ VipsImage *vips_image_new_matrix_from_array(int width, int height,
487
+ const double *array, int size);
488
488
  VIPS_API
489
- VipsImage *vips_image_matrix_from_array( int width, int height,
490
- const double *array, int size );
489
+ VipsImage *vips_image_matrix_from_array(int width, int height,
490
+ const double *array, int size);
491
491
  VIPS_API
492
- VipsImage *vips_image_new_from_image( VipsImage *image,
493
- const double *c, int n );
492
+ VipsImage *vips_image_new_from_image(VipsImage *image,
493
+ const double *c, int n);
494
494
  VIPS_API
495
- VipsImage *vips_image_new_from_image1( VipsImage *image, double c );
495
+ VipsImage *vips_image_new_from_image1(VipsImage *image, double c);
496
496
 
497
497
  VIPS_API
498
- void vips_image_set_delete_on_close( VipsImage *image,
499
- gboolean delete_on_close );
498
+ void vips_image_set_delete_on_close(VipsImage *image,
499
+ gboolean delete_on_close);
500
500
  VIPS_API
501
- guint64 vips_get_disc_threshold( void );
501
+ guint64 vips_get_disc_threshold(void);
502
502
  VIPS_API
503
- VipsImage *vips_image_new_temp_file( const char *format );
503
+ VipsImage *vips_image_new_temp_file(const char *format);
504
504
 
505
505
  VIPS_API
506
- int vips_image_write( VipsImage *image, VipsImage *out );
506
+ int vips_image_write(VipsImage *image, VipsImage *out);
507
507
  VIPS_API
508
- int vips_image_write_to_file( VipsImage *image, const char *name, ... )
508
+ int vips_image_write_to_file(VipsImage *image, const char *name, ...)
509
509
  G_GNUC_NULL_TERMINATED;
510
510
  VIPS_API
511
- int vips_image_write_to_buffer( VipsImage *in,
512
- const char *suffix, void **buf, size_t *size, ... )
511
+ int vips_image_write_to_buffer(VipsImage *in,
512
+ const char *suffix, void **buf, size_t *size, ...)
513
513
  G_GNUC_NULL_TERMINATED;
514
514
  VIPS_API
515
- int vips_image_write_to_target( VipsImage *in,
516
- const char *suffix, VipsTarget *target, ... )
515
+ int vips_image_write_to_target(VipsImage *in,
516
+ const char *suffix, VipsTarget *target, ...)
517
517
  G_GNUC_NULL_TERMINATED;
518
518
  VIPS_API
519
- void *vips_image_write_to_memory( VipsImage *in, size_t *size );
519
+ void *vips_image_write_to_memory(VipsImage *in, size_t *size);
520
520
 
521
521
  VIPS_API
522
- int vips_image_decode_predict( VipsImage *in,
523
- int *bands, VipsBandFormat *format );
522
+ int vips_image_decode_predict(VipsImage *in,
523
+ int *bands, VipsBandFormat *format);
524
524
  VIPS_API
525
- int vips_image_decode( VipsImage *in, VipsImage **out );
525
+ int vips_image_decode(VipsImage *in, VipsImage **out);
526
526
  VIPS_API
527
- int vips_image_encode( VipsImage *in, VipsImage **out, VipsCoding coding );
527
+ int vips_image_encode(VipsImage *in, VipsImage **out, VipsCoding coding);
528
528
 
529
529
  VIPS_API
530
- gboolean vips_image_isMSBfirst( VipsImage *image );
530
+ gboolean vips_image_isMSBfirst(VipsImage *image);
531
531
  VIPS_API
532
- gboolean vips_image_isfile( VipsImage *image );
532
+ gboolean vips_image_isfile(VipsImage *image);
533
533
  VIPS_API
534
- gboolean vips_image_ispartial( VipsImage *image );
534
+ gboolean vips_image_ispartial(VipsImage *image);
535
535
  VIPS_API
536
- gboolean vips_image_hasalpha( VipsImage *image );
536
+ gboolean vips_image_hasalpha(VipsImage *image);
537
537
 
538
538
  VIPS_API
539
- VipsImage *vips_image_copy_memory( VipsImage *image );
539
+ VipsImage *vips_image_copy_memory(VipsImage *image);
540
540
  VIPS_API
541
- int vips_image_wio_input( VipsImage *image );
541
+ int vips_image_wio_input(VipsImage *image);
542
542
  VIPS_API
543
- int vips_image_pio_input( VipsImage *image );
543
+ int vips_image_pio_input(VipsImage *image);
544
544
  VIPS_API
545
- int vips_image_pio_output( VipsImage *image );
545
+ int vips_image_pio_output(VipsImage *image);
546
546
  VIPS_API
547
- int vips_image_inplace( VipsImage *image );
547
+ int vips_image_inplace(VipsImage *image);
548
548
  VIPS_API
549
- int vips_image_write_prepare( VipsImage *image );
549
+ int vips_image_write_prepare(VipsImage *image);
550
550
 
551
551
  VIPS_API
552
- int vips_image_write_line( VipsImage *image, int ypos, VipsPel *linebuffer );
552
+ int vips_image_write_line(VipsImage *image, int ypos, VipsPel *linebuffer);
553
553
 
554
554
  VIPS_API
555
- gboolean vips_band_format_isint( VipsBandFormat format );
555
+ gboolean vips_band_format_isint(VipsBandFormat format);
556
556
  VIPS_API
557
- gboolean vips_band_format_isuint( VipsBandFormat format );
557
+ gboolean vips_band_format_isuint(VipsBandFormat format);
558
558
  VIPS_API
559
- gboolean vips_band_format_is8bit( VipsBandFormat format );
559
+ gboolean vips_band_format_is8bit(VipsBandFormat format);
560
560
  VIPS_API
561
- gboolean vips_band_format_isfloat( VipsBandFormat format );
561
+ gboolean vips_band_format_isfloat(VipsBandFormat format);
562
562
  VIPS_API
563
- gboolean vips_band_format_iscomplex( VipsBandFormat format );
563
+ gboolean vips_band_format_iscomplex(VipsBandFormat format);
564
564
 
565
565
  VIPS_API
566
- int vips_system( const char *cmd_format, ... )
566
+ int vips_system(const char *cmd_format, ...)
567
567
  G_GNUC_NULL_TERMINATED;
568
568
 
569
569
  /* Defined in type.c but declared here, since they use VipsImage.
570
570
  */
571
571
  VIPS_API
572
- VipsArrayImage *vips_array_image_new( VipsImage **array, int n );
572
+ VipsArrayImage *vips_array_image_new(VipsImage **array, int n);
573
573
  VIPS_API
574
- VipsArrayImage *vips_array_image_newv( int n, ... );
574
+ VipsArrayImage *vips_array_image_newv(int n, ...);
575
575
  VIPS_API
576
- VipsArrayImage *vips_array_image_new_from_string( const char *string,
577
- VipsAccess flags );
576
+ VipsArrayImage *vips_array_image_new_from_string(const char *string,
577
+ VipsAccess flags);
578
578
  VIPS_API
579
- VipsArrayImage *vips_array_image_empty( void );
579
+ VipsArrayImage *vips_array_image_empty(void);
580
580
  VIPS_API
581
- VipsArrayImage *vips_array_image_append( VipsArrayImage *array,
582
- VipsImage *image );
581
+ VipsArrayImage *vips_array_image_append(VipsArrayImage *array,
582
+ VipsImage *image);
583
583
  VIPS_API
584
- VipsImage **vips_array_image_get( VipsArrayImage *array, int *n );
584
+ VipsImage **vips_array_image_get(VipsArrayImage *array, int *n);
585
585
  VIPS_API
586
- VipsImage **vips_value_get_array_image( const GValue *value, int *n );
586
+ VipsImage **vips_value_get_array_image(const GValue *value, int *n);
587
587
  VIPS_API
588
- void vips_value_set_array_image( GValue *value, int n );
588
+ void vips_value_set_array_image(GValue *value, int n);
589
589
 
590
590
  /* Defined in reorder.c, but really a function on image.
591
591
  */
592
592
  VIPS_API
593
- int vips_reorder_prepare_many( VipsImage *image,
594
- VipsRegion **regions, VipsRect *r );
593
+ int vips_reorder_prepare_many(VipsImage *image,
594
+ VipsRegion **regions, VipsRect *r);
595
595
  VIPS_API
596
- void vips_reorder_margin_hint( VipsImage *image, int margin );
596
+ void vips_reorder_margin_hint(VipsImage *image, int margin);
597
597
 
598
598
  VIPS_API
599
- void vips_image_free_buffer( VipsImage *image, void *buffer );
599
+ void vips_image_free_buffer(VipsImage *image, void *buffer);
600
600
 
601
601
  #ifdef __cplusplus
602
602
  }