@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
@@ -5,28 +5,28 @@
5
5
 
6
6
  /*
7
7
 
8
- This file is part of VIPS.
8
+ This file is part of VIPS.
9
9
 
10
- VIPS is free software; you can redistribute it and/or modify
11
- it under the terms of the GNU Lesser General Public License as published by
12
- the Free Software Foundation; either version 2 of the License, or
13
- (at your option) any later version.
10
+ VIPS is free software; you can redistribute it and/or modify
11
+ it under the terms of the GNU Lesser General Public License as published by
12
+ the Free Software Foundation; either version 2 of the License, or
13
+ (at your option) any later version.
14
14
 
15
- This program is distributed in the hope that it will be useful,
16
- but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- GNU Lesser General Public License for more details.
15
+ This program is distributed in the hope that it will be useful,
16
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ GNU Lesser General Public License for more details.
19
19
 
20
- You should have received a copy of the GNU Lesser General Public License
21
- along with this program; if not, write to the Free Software
22
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23
- 02110-1301 USA
20
+ You should have received a copy of the GNU Lesser General Public License
21
+ along with this program; if not, write to the Free Software
22
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23
+ 02110-1301 USA
24
24
 
25
25
  */
26
26
 
27
27
  /*
28
28
 
29
- These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
29
+ These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk
30
30
 
31
31
  */
32
32
 
@@ -44,21 +44,21 @@ extern "C" {
44
44
  #endif /*__cplusplus*/
45
45
 
46
46
  #define VIPS_TYPE_CONNECTION (vips_connection_get_type())
47
- #define VIPS_CONNECTION( obj ) \
48
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
49
- VIPS_TYPE_CONNECTION, VipsConnection ))
50
- #define VIPS_CONNECTION_CLASS( klass ) \
51
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
52
- VIPS_TYPE_CONNECTION, VipsConnectionClass))
53
- #define VIPS_IS_CONNECTION( obj ) \
54
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_CONNECTION ))
55
- #define VIPS_IS_CONNECTION_CLASS( klass ) \
56
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_CONNECTION ))
57
- #define VIPS_CONNECTION_GET_CLASS( obj ) \
58
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
59
- VIPS_TYPE_CONNECTION, VipsConnectionClass ))
60
-
61
- /* Communicate with something like a socket or pipe.
47
+ #define VIPS_CONNECTION(obj) \
48
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
49
+ VIPS_TYPE_CONNECTION, VipsConnection))
50
+ #define VIPS_CONNECTION_CLASS(klass) \
51
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
52
+ VIPS_TYPE_CONNECTION, VipsConnectionClass))
53
+ #define VIPS_IS_CONNECTION(obj) \
54
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_CONNECTION))
55
+ #define VIPS_IS_CONNECTION_CLASS(klass) \
56
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_CONNECTION))
57
+ #define VIPS_CONNECTION_GET_CLASS(obj) \
58
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
59
+ VIPS_TYPE_CONNECTION, VipsConnectionClass))
60
+
61
+ /* Communicate with something like a socket or pipe.
62
62
  */
63
63
  typedef struct _VipsConnection {
64
64
  VipsObject parent_object;
@@ -68,20 +68,20 @@ typedef struct _VipsConnection {
68
68
  /* Read/write this fd if connected to a system pipe/socket. Override
69
69
  * ::read() and ::write() to do something else.
70
70
  */
71
- int descriptor;
71
+ int descriptor;
72
72
 
73
73
  /* A descriptor we close with vips_tracked_close().
74
74
  */
75
- int tracked_descriptor;
75
+ int tracked_descriptor;
76
76
 
77
77
  /* A descriptor we close with close().
78
78
  */
79
- int close_descriptor;
79
+ int close_descriptor;
80
80
 
81
81
  /* If descriptor is a file, the filename we opened. Handy for error
82
- * messages.
82
+ * messages.
83
83
  */
84
- char *filename;
84
+ char *filename;
85
85
 
86
86
  } VipsConnection;
87
87
 
@@ -91,30 +91,30 @@ typedef struct _VipsConnectionClass {
91
91
  } VipsConnectionClass;
92
92
 
93
93
  VIPS_API
94
- GType vips_connection_get_type( void );
94
+ GType vips_connection_get_type(void);
95
95
 
96
96
  VIPS_API
97
- const char *vips_connection_filename( VipsConnection *connection );
97
+ const char *vips_connection_filename(VipsConnection *connection);
98
98
  VIPS_API
99
- const char *vips_connection_nick( VipsConnection *connection );
99
+ const char *vips_connection_nick(VipsConnection *connection);
100
100
 
101
101
  VIPS_API
102
- void vips_pipe_read_limit_set( gint64 limit );
102
+ void vips_pipe_read_limit_set(gint64 limit);
103
103
 
104
104
  #define VIPS_TYPE_SOURCE (vips_source_get_type())
105
- #define VIPS_SOURCE( obj ) \
106
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
107
- VIPS_TYPE_SOURCE, VipsSource ))
108
- #define VIPS_SOURCE_CLASS( klass ) \
109
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
110
- VIPS_TYPE_SOURCE, VipsSourceClass))
111
- #define VIPS_IS_SOURCE( obj ) \
112
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE ))
113
- #define VIPS_IS_SOURCE_CLASS( klass ) \
114
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE ))
115
- #define VIPS_SOURCE_GET_CLASS( obj ) \
116
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
117
- VIPS_TYPE_SOURCE, VipsSourceClass ))
105
+ #define VIPS_SOURCE(obj) \
106
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
107
+ VIPS_TYPE_SOURCE, VipsSource))
108
+ #define VIPS_SOURCE_CLASS(klass) \
109
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
110
+ VIPS_TYPE_SOURCE, VipsSourceClass))
111
+ #define VIPS_IS_SOURCE(obj) \
112
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE))
113
+ #define VIPS_IS_SOURCE_CLASS(klass) \
114
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE))
115
+ #define VIPS_SOURCE_GET_CLASS(obj) \
116
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
117
+ VIPS_TYPE_SOURCE, VipsSourceClass))
118
118
 
119
119
  /* Read from something like a socket, file or memory area and present the data
120
120
  * with a unified seek / read / map interface.
@@ -126,7 +126,7 @@ void vips_pipe_read_limit_set( gint64 limit );
126
126
  struct _VipsSource {
127
127
  VipsConnection parent_object;
128
128
 
129
- /* We have two phases:
129
+ /* We have two phases:
130
130
  *
131
131
  * During the header phase, we save bytes read from the input (if this
132
132
  * is an unseekable source) so that we can rewind and try again, if
@@ -140,7 +140,7 @@ struct _VipsSource {
140
140
  /* TRUE if this input is something like a pipe. These don't support
141
141
  * seek or map -- all you can do is read() bytes sequentially.
142
142
  *
143
- * If you attempt to map or get the size of a pipe-style input, it'll
143
+ * If you attempt to map or get the size of a pipe-style input, it'll
144
144
  * get read entirely into memory. Seeks will cause read up to the seek
145
145
  * point.
146
146
  */
@@ -151,7 +151,7 @@ struct _VipsSource {
151
151
  *
152
152
  * length is -1 for is_pipe sources.
153
153
  *
154
- * off_t can be 32 bits on some platforms, so make sure we have a
154
+ * off_t can be 32 bits on some platforms, so make sure we have a
155
155
  * full 64.
156
156
  */
157
157
  gint64 read_position;
@@ -160,12 +160,12 @@ struct _VipsSource {
160
160
  /*< private >*/
161
161
 
162
162
  /* For sources where we have the whole image in memory (from a memory
163
- * buffer, from mmaping the file, from reading the pipe into memory),
163
+ * buffer, from mmaping the file, from reading the pipe into memory),
164
164
  * a pointer to the start.
165
165
  */
166
166
  const void *data;
167
167
 
168
- /* For is_pipe sources, save data read during header phase here. If
168
+ /* For is_pipe sources, save data read during header phase here. If
169
169
  * we rewind and try again, serve data from this until it runs out.
170
170
  *
171
171
  * If we need to force the whole pipe into memory, read everything to
@@ -177,7 +177,7 @@ struct _VipsSource {
177
177
  */
178
178
  GByteArray *sniff;
179
179
 
180
- /* For a memory source, the blob we read from.
180
+ /* For a memory source, the blob we read from.
181
181
  */
182
182
  VipsBlob *blob;
183
183
 
@@ -185,7 +185,6 @@ struct _VipsSource {
185
185
  */
186
186
  void *mmap_baseaddr;
187
187
  size_t mmap_length;
188
-
189
188
  };
190
189
 
191
190
  typedef struct _VipsSourceClass {
@@ -200,7 +199,7 @@ typedef struct _VipsSourceClass {
200
199
  * We must return gint64, since ssize_t is often defined as unsigned
201
200
  * on Windows.
202
201
  */
203
- gint64 (*read)( VipsSource *, void *, size_t );
202
+ gint64 (*read)(VipsSource *, void *, size_t);
204
203
 
205
204
  /* Seek to a certain position, args exactly as lseek(2). Set errno on
206
205
  * error.
@@ -211,68 +210,68 @@ typedef struct _VipsSourceClass {
211
210
  * We have to use int64 rather than off_t, since we must work on
212
211
  * Windows, where off_t can be 32-bits.
213
212
  */
214
- gint64 (*seek)( VipsSource *, gint64, int );
213
+ gint64 (*seek)(VipsSource *, gint64, int);
215
214
 
216
215
  } VipsSourceClass;
217
216
 
218
217
  VIPS_API
219
- GType vips_source_get_type( void );
218
+ GType vips_source_get_type(void);
220
219
 
221
220
  VIPS_API
222
- VipsSource *vips_source_new_from_descriptor( int descriptor );
221
+ VipsSource *vips_source_new_from_descriptor(int descriptor);
223
222
  VIPS_API
224
- VipsSource *vips_source_new_from_file( const char *filename );
223
+ VipsSource *vips_source_new_from_file(const char *filename);
225
224
  VIPS_API
226
- VipsSource *vips_source_new_from_blob( VipsBlob *blob );
225
+ VipsSource *vips_source_new_from_blob(VipsBlob *blob);
227
226
  VIPS_API
228
- VipsSource *vips_source_new_from_target( VipsTarget *target );
227
+ VipsSource *vips_source_new_from_target(VipsTarget *target);
229
228
  VIPS_API
230
- VipsSource *vips_source_new_from_memory( const void *data, size_t size );
229
+ VipsSource *vips_source_new_from_memory(const void *data, size_t size);
231
230
  VIPS_API
232
- VipsSource *vips_source_new_from_options( const char *options );
231
+ VipsSource *vips_source_new_from_options(const char *options);
233
232
 
234
233
  VIPS_API
235
- void vips_source_minimise( VipsSource *source );
234
+ void vips_source_minimise(VipsSource *source);
236
235
  VIPS_API
237
- int vips_source_unminimise( VipsSource *source );
236
+ int vips_source_unminimise(VipsSource *source);
238
237
  VIPS_API
239
- int vips_source_decode( VipsSource *source );
238
+ int vips_source_decode(VipsSource *source);
240
239
  VIPS_API
241
- gint64 vips_source_read( VipsSource *source, void *data, size_t length );
240
+ gint64 vips_source_read(VipsSource *source, void *data, size_t length);
242
241
  VIPS_API
243
- gboolean vips_source_is_mappable( VipsSource *source );
242
+ gboolean vips_source_is_mappable(VipsSource *source);
244
243
  VIPS_API
245
- gboolean vips_source_is_file( VipsSource *source );
244
+ gboolean vips_source_is_file(VipsSource *source);
246
245
  VIPS_API
247
- const void *vips_source_map( VipsSource *source, size_t *length );
246
+ const void *vips_source_map(VipsSource *source, size_t *length);
248
247
  VIPS_API
249
- VipsBlob *vips_source_map_blob( VipsSource *source );
248
+ VipsBlob *vips_source_map_blob(VipsSource *source);
250
249
  VIPS_API
251
- gint64 vips_source_seek( VipsSource *source, gint64 offset, int whence );
250
+ gint64 vips_source_seek(VipsSource *source, gint64 offset, int whence);
252
251
  VIPS_API
253
- int vips_source_rewind( VipsSource *source );
252
+ int vips_source_rewind(VipsSource *source);
254
253
  VIPS_API
255
- gint64 vips_source_sniff_at_most( VipsSource *source,
256
- unsigned char **data, size_t length );
254
+ gint64 vips_source_sniff_at_most(VipsSource *source,
255
+ unsigned char **data, size_t length);
257
256
  VIPS_API
258
- unsigned char *vips_source_sniff( VipsSource *source, size_t length );
257
+ unsigned char *vips_source_sniff(VipsSource *source, size_t length);
259
258
  VIPS_API
260
- gint64 vips_source_length( VipsSource *source );
259
+ gint64 vips_source_length(VipsSource *source);
261
260
 
262
261
  #define VIPS_TYPE_SOURCE_CUSTOM (vips_source_custom_get_type())
263
- #define VIPS_SOURCE_CUSTOM( obj ) \
264
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
265
- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustom ))
266
- #define VIPS_SOURCE_CUSTOM_CLASS( klass ) \
267
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
268
- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass))
269
- #define VIPS_IS_SOURCE_CUSTOM( obj ) \
270
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE_CUSTOM ))
271
- #define VIPS_IS_SOURCE_CUSTOM_CLASS( klass ) \
272
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE_CUSTOM ))
273
- #define VIPS_SOURCE_CUSTOM_GET_CLASS( obj ) \
274
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
275
- VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass ))
262
+ #define VIPS_SOURCE_CUSTOM(obj) \
263
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
264
+ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustom))
265
+ #define VIPS_SOURCE_CUSTOM_CLASS(klass) \
266
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
267
+ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass))
268
+ #define VIPS_IS_SOURCE_CUSTOM(obj) \
269
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE_CUSTOM))
270
+ #define VIPS_IS_SOURCE_CUSTOM_CLASS(klass) \
271
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE_CUSTOM))
272
+ #define VIPS_SOURCE_CUSTOM_GET_CLASS(obj) \
273
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
274
+ VIPS_TYPE_SOURCE_CUSTOM, VipsSourceCustomClass))
276
275
 
277
276
  /* Subclass of source_custom with signals for handlers. This is supposed to be
278
277
  * useful for language bindings.
@@ -289,34 +288,34 @@ typedef struct _VipsSourceCustomClass {
289
288
  * We must use gint64 everywhere since there's no G_TYPE_SIZE.
290
289
  */
291
290
 
292
- gint64 (*read)( VipsSourceCustom *, void *, gint64 );
293
- gint64 (*seek)( VipsSourceCustom *, gint64, int );
291
+ gint64 (*read)(VipsSourceCustom *, void *, gint64);
292
+ gint64 (*seek)(VipsSourceCustom *, gint64, int);
294
293
 
295
294
  } VipsSourceCustomClass;
296
295
 
297
296
  VIPS_API
298
- GType vips_source_custom_get_type( void );
297
+ GType vips_source_custom_get_type(void);
299
298
  VIPS_API
300
- VipsSourceCustom *vips_source_custom_new( void );
299
+ VipsSourceCustom *vips_source_custom_new(void);
301
300
 
302
- /* A GInputStream that wraps a VipsSource. This lets us eg.
301
+ /* A GInputStream that wraps a VipsSource. This lets us eg.
303
302
  * hook librsvg up to libvips using their GInputStream interface.
304
303
  */
305
304
 
306
305
  #define VIPS_TYPE_G_INPUT_STREAM (vips_g_input_stream_get_type())
307
- #define VIPS_G_INPUT_STREAM( obj ) \
308
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
309
- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStream ))
310
- #define VIPS_G_INPUT_STREAM_CLASS( klass ) \
311
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
312
- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass))
313
- #define VIPS_IS_G_INPUT_STREAM( obj ) \
314
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_G_INPUT_STREAM ))
315
- #define VIPS_IS_G_INPUT_STREAM_CLASS( klass ) \
316
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_G_INPUT_STREAM ))
317
- #define VIPS_G_INPUT_STREAM_GET_CLASS( obj ) \
318
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
319
- VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass ))
306
+ #define VIPS_G_INPUT_STREAM(obj) \
307
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
308
+ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStream))
309
+ #define VIPS_G_INPUT_STREAM_CLASS(klass) \
310
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
311
+ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass))
312
+ #define VIPS_IS_G_INPUT_STREAM(obj) \
313
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_G_INPUT_STREAM))
314
+ #define VIPS_IS_G_INPUT_STREAM_CLASS(klass) \
315
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_G_INPUT_STREAM))
316
+ #define VIPS_G_INPUT_STREAM_GET_CLASS(obj) \
317
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
318
+ VIPS_TYPE_G_INPUT_STREAM, VipsGInputStreamClass))
320
319
 
321
320
  typedef struct _VipsGInputStream {
322
321
  GInputStream parent_instance;
@@ -335,26 +334,26 @@ typedef struct _VipsGInputStreamClass {
335
334
  } VipsGInputStreamClass;
336
335
 
337
336
  VIPS_API
338
- GInputStream *vips_g_input_stream_new_from_source( VipsSource *source );
337
+ GInputStream *vips_g_input_stream_new_from_source(VipsSource *source);
339
338
 
340
- /* A VipsSource that wraps a GInputStream. This lets us eg. load PNGs from
339
+ /* A VipsSource that wraps a GInputStream. This lets us eg. load PNGs from
341
340
  * GFile objects.
342
341
  */
343
342
 
344
343
  #define VIPS_TYPE_SOURCE_G_INPUT_STREAM (vips_source_g_input_stream_get_type())
345
- #define VIPS_SOURCE_G_INPUT_STREAM( obj ) \
346
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
347
- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStream ))
348
- #define VIPS_SOURCE_G_INPUT_STREAM_CLASS( klass ) \
349
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
350
- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass))
351
- #define VIPS_IS_SOURCE_G_INPUT_STREAM( obj ) \
352
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_SOURCE_G_INPUT_STREAM ))
353
- #define VIPS_IS_SOURCE_G_INPUT_STREAM_CLASS( klass ) \
354
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_SOURCE_G_INPUT_STREAM ))
355
- #define VIPS_SOURCE_G_INPUT_STREAM_GET_CLASS( obj ) \
356
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
357
- VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass ))
344
+ #define VIPS_SOURCE_G_INPUT_STREAM(obj) \
345
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
346
+ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStream))
347
+ #define VIPS_SOURCE_G_INPUT_STREAM_CLASS(klass) \
348
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
349
+ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass))
350
+ #define VIPS_IS_SOURCE_G_INPUT_STREAM(obj) \
351
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_SOURCE_G_INPUT_STREAM))
352
+ #define VIPS_IS_SOURCE_G_INPUT_STREAM_CLASS(klass) \
353
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_SOURCE_G_INPUT_STREAM))
354
+ #define VIPS_SOURCE_G_INPUT_STREAM_GET_CLASS(obj) \
355
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
356
+ VIPS_TYPE_SOURCE_G_INPUT_STREAM, VipsSourceGInputStreamClass))
358
357
 
359
358
  typedef struct _VipsSourceGInputStream {
360
359
  VipsSource parent_instance;
@@ -376,28 +375,28 @@ typedef struct _VipsSourceGInputStreamClass {
376
375
  } VipsSourceGInputStreamClass;
377
376
 
378
377
  VIPS_API
379
- VipsSourceGInputStream *vips_source_g_input_stream_new( GInputStream *stream );
378
+ VipsSourceGInputStream *vips_source_g_input_stream_new(GInputStream *stream);
380
379
 
381
380
  #define VIPS_TYPE_TARGET (vips_target_get_type())
382
- #define VIPS_TARGET( obj ) \
383
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
384
- VIPS_TYPE_TARGET, VipsTarget ))
385
- #define VIPS_TARGET_CLASS( klass ) \
386
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
387
- VIPS_TYPE_TARGET, VipsTargetClass))
388
- #define VIPS_IS_TARGET( obj ) \
389
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_TARGET ))
390
- #define VIPS_IS_TARGET_CLASS( klass ) \
391
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_TARGET ))
392
- #define VIPS_TARGET_GET_CLASS( obj ) \
393
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
394
- VIPS_TYPE_TARGET, VipsTargetClass ))
381
+ #define VIPS_TARGET(obj) \
382
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
383
+ VIPS_TYPE_TARGET, VipsTarget))
384
+ #define VIPS_TARGET_CLASS(klass) \
385
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
386
+ VIPS_TYPE_TARGET, VipsTargetClass))
387
+ #define VIPS_IS_TARGET(obj) \
388
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_TARGET))
389
+ #define VIPS_IS_TARGET_CLASS(klass) \
390
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_TARGET))
391
+ #define VIPS_TARGET_GET_CLASS(obj) \
392
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
393
+ VIPS_TYPE_TARGET, VipsTargetClass))
395
394
 
396
395
  /* PNG writes in 8kb chunks, so we need to be a little larger than that.
397
396
  */
398
397
  #define VIPS_TARGET_BUFFER_SIZE (8500)
399
398
 
400
- /* Output to something like a socket, pipe or memory area.
399
+ /* Output to something like a socket, pipe or memory area.
401
400
  */
402
401
  struct _VipsTarget {
403
402
  VipsConnection parent_object;
@@ -412,7 +411,7 @@ struct _VipsTarget {
412
411
  */
413
412
  gboolean ended;
414
413
 
415
- /* Write memory output here. We use a GString rather than a
414
+ /* Write memory output here. We use a GString rather than a
416
415
  * GByteArray since we need eg. g_string_overwrite_len().
417
416
  * @position tracks the current write position in this.
418
417
  */
@@ -436,7 +435,6 @@ struct _VipsTarget {
436
435
  */
437
436
  gboolean delete_on_close;
438
437
  char *delete_on_close_filename;
439
-
440
438
  };
441
439
 
442
440
  typedef struct _VipsTargetClass {
@@ -447,14 +445,14 @@ typedef struct _VipsTargetClass {
447
445
  * We must return gint64, since ssize_t is often defined as unsigned
448
446
  * on Windows.
449
447
  */
450
- gint64 (*write)( VipsTarget *, const void *, size_t );
448
+ gint64 (*write)(VipsTarget *, const void *, size_t);
451
449
 
452
450
  /* Deprecated in favour of ::end.
453
451
  */
454
- void (*finish)( VipsTarget * );
452
+ void (*finish)(VipsTarget *);
455
453
 
456
454
  /* libtiff needs to be able to seek and read on targets,
457
- * unfortunately.
455
+ * unfortunately.
458
456
  *
459
457
  * This will not work for eg. pipes, of course.
460
458
  */
@@ -465,78 +463,77 @@ typedef struct _VipsTargetClass {
465
463
  * We must return gint64, since ssize_t is often defined as unsigned
466
464
  * on Windows.
467
465
  */
468
- gint64 (*read)( VipsTarget *, void *, size_t );
466
+ gint64 (*read)(VipsTarget *, void *, size_t);
469
467
 
470
468
  /* Seek output. Args exactly as lseek(2).
471
469
  */
472
- off_t (*seek)( VipsTarget *, off_t offset, int whence);
470
+ off_t (*seek)(VipsTarget *, off_t offset, int whence);
473
471
 
474
472
  /* Output has been generated, so do any clearing up,
475
473
  * eg. copy the bytes we saved in memory to the target blob.
476
474
  */
477
- int (*end)( VipsTarget * );
475
+ int (*end)(VipsTarget *);
478
476
 
479
477
  } VipsTargetClass;
480
478
 
481
479
  VIPS_API
482
- GType vips_target_get_type( void );
480
+ GType vips_target_get_type(void);
483
481
 
484
482
  VIPS_API
485
- VipsTarget *vips_target_new_to_descriptor( int descriptor );
483
+ VipsTarget *vips_target_new_to_descriptor(int descriptor);
486
484
  VIPS_API
487
- VipsTarget *vips_target_new_to_file( const char *filename );
485
+ VipsTarget *vips_target_new_to_file(const char *filename);
488
486
  VIPS_API
489
- VipsTarget *vips_target_new_to_memory( void );
487
+ VipsTarget *vips_target_new_to_memory(void);
490
488
  VIPS_API
491
- VipsTarget *vips_target_new_temp( VipsTarget *target );
489
+ VipsTarget *vips_target_new_temp(VipsTarget *target);
492
490
  VIPS_API
493
- int vips_target_write( VipsTarget *target, const void *data, size_t length );
491
+ int vips_target_write(VipsTarget *target, const void *data, size_t length);
494
492
  VIPS_API
495
- gint64 vips_target_read( VipsTarget *target, void *buffer, size_t length );
493
+ gint64 vips_target_read(VipsTarget *target, void *buffer, size_t length);
496
494
  VIPS_API
497
- off_t vips_target_seek( VipsTarget *target, off_t offset, int whence );
495
+ off_t vips_target_seek(VipsTarget *target, off_t offset, int whence);
498
496
  VIPS_API
499
- int vips_target_end( VipsTarget *target );
497
+ int vips_target_end(VipsTarget *target);
500
498
  VIPS_DEPRECATED_FOR(vips_target_end)
501
- void vips_target_finish( VipsTarget *target );
499
+ void vips_target_finish(VipsTarget *target);
502
500
  VIPS_API
503
- unsigned char *vips_target_steal( VipsTarget *target, size_t *length );
501
+ unsigned char *vips_target_steal(VipsTarget *target, size_t *length);
504
502
  VIPS_API
505
- char *vips_target_steal_text( VipsTarget *target );
503
+ char *vips_target_steal_text(VipsTarget *target);
506
504
 
507
505
  VIPS_API
508
- int vips_target_putc( VipsTarget *target, int ch );
509
- #define VIPS_TARGET_PUTC( S, C ) ( \
510
- (S)->write_point < VIPS_TARGET_BUFFER_SIZE ? \
511
- ((S)->output_buffer[(S)->write_point++] = (C), 0) : \
512
- vips_target_putc( (S), (C) ) \
513
- )
506
+ int vips_target_putc(VipsTarget *target, int ch);
507
+ #define VIPS_TARGET_PUTC(S, C) ( \
508
+ (S)->write_point < VIPS_TARGET_BUFFER_SIZE \
509
+ ? ((S)->output_buffer[(S)->write_point++] = (C), 0) \
510
+ : vips_target_putc((S), (C)))
514
511
  VIPS_API
515
- int vips_target_writes( VipsTarget *target, const char *str );
512
+ int vips_target_writes(VipsTarget *target, const char *str);
516
513
  VIPS_API
517
- int vips_target_writef( VipsTarget *target, const char *fmt, ... )
518
- G_GNUC_PRINTF( 2, 3 );
514
+ int vips_target_writef(VipsTarget *target, const char *fmt, ...)
515
+ G_GNUC_PRINTF(2, 3);
519
516
  VIPS_API
520
- int vips_target_write_amp( VipsTarget *target, const char *str );
517
+ int vips_target_write_amp(VipsTarget *target, const char *str);
521
518
 
522
519
  #define VIPS_TYPE_TARGET_CUSTOM (vips_target_custom_get_type())
523
- #define VIPS_TARGET_CUSTOM( obj ) \
524
- (G_TYPE_CHECK_INSTANCE_CAST( (obj), \
525
- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustom ))
526
- #define VIPS_TARGET_CUSTOM_CLASS( klass ) \
527
- (G_TYPE_CHECK_CLASS_CAST( (klass), \
528
- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass))
529
- #define VIPS_IS_TARGET_CUSTOM( obj ) \
530
- (G_TYPE_CHECK_INSTANCE_TYPE( (obj), VIPS_TYPE_TARGET_CUSTOM ))
531
- #define VIPS_IS_TARGET_CUSTOM_CLASS( klass ) \
532
- (G_TYPE_CHECK_CLASS_TYPE( (klass), VIPS_TYPE_TARGET_CUSTOM ))
533
- #define VIPS_TARGET_CUSTOM_GET_CLASS( obj ) \
534
- (G_TYPE_INSTANCE_GET_CLASS( (obj), \
535
- VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass ))
520
+ #define VIPS_TARGET_CUSTOM(obj) \
521
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), \
522
+ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustom))
523
+ #define VIPS_TARGET_CUSTOM_CLASS(klass) \
524
+ (G_TYPE_CHECK_CLASS_CAST((klass), \
525
+ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass))
526
+ #define VIPS_IS_TARGET_CUSTOM(obj) \
527
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), VIPS_TYPE_TARGET_CUSTOM))
528
+ #define VIPS_IS_TARGET_CUSTOM_CLASS(klass) \
529
+ (G_TYPE_CHECK_CLASS_TYPE((klass), VIPS_TYPE_TARGET_CUSTOM))
530
+ #define VIPS_TARGET_CUSTOM_GET_CLASS(obj) \
531
+ (G_TYPE_INSTANCE_GET_CLASS((obj), \
532
+ VIPS_TYPE_TARGET_CUSTOM, VipsTargetCustomClass))
536
533
 
537
534
  #define VIPS_TARGET_CUSTOM_BUFFER_SIZE (4096)
538
535
 
539
- /* Output to something like a socket, pipe or memory area.
536
+ /* Output to something like a socket, pipe or memory area.
540
537
  */
541
538
  typedef struct _VipsTargetCustom {
542
539
  VipsTarget parent_object;
@@ -550,18 +547,18 @@ typedef struct _VipsTargetCustomClass {
550
547
  * We must use gint64 everywhere since there's no G_TYPE_SIZE.
551
548
  */
552
549
 
553
- gint64 (*write)( VipsTargetCustom *, const void *, gint64 );
554
- void (*finish)( VipsTargetCustom * );
555
- gint64 (*read)( VipsTargetCustom *, void *, gint64 );
556
- gint64 (*seek)( VipsTargetCustom *, gint64, int );
557
- int (*end)( VipsTargetCustom * );
550
+ gint64 (*write)(VipsTargetCustom *, const void *, gint64);
551
+ void (*finish)(VipsTargetCustom *);
552
+ gint64 (*read)(VipsTargetCustom *, void *, gint64);
553
+ gint64 (*seek)(VipsTargetCustom *, gint64, int);
554
+ int (*end)(VipsTargetCustom *);
558
555
 
559
556
  } VipsTargetCustomClass;
560
557
 
561
558
  VIPS_API
562
- GType vips_target_custom_get_type( void );
559
+ GType vips_target_custom_get_type(void);
563
560
  VIPS_API
564
- VipsTargetCustom *vips_target_custom_new( void );
561
+ VipsTargetCustom *vips_target_custom_new(void);
565
562
 
566
563
  #ifdef __cplusplus
567
564
  }