6
6
* - rename xshrink -> hshrink for greater consistency
7
7
* 9/9/16
8
8
* - add @centre option
9
+ * 6/6/20 kleisauke
10
+ * - deprecate @centre option, it's now always on
9
11
*/
10
12
11
13
/*
78
80
* Optional arguments:
79
81
*
80
82
* * @kernel: #VipsKernel to use to interpolate (default: lanczos3)
81
- * * @centre: %gboolean use centre rather than corner sampling convention
82
83
*
83
84
* Reduce @in vertically by a float factor. The pixels in @out are
84
85
* interpolated with a 1D mask generated by @kernel.
85
86
*
86
- * Set @centre to use centre rather than corner sampling convention. Centre
87
- * convention can be useful to match the behaviour of other systems.
88
- *
89
87
* This is a very low-level operation: see vips_resize() for a more
90
88
* convenient way to resize images.
91
89
*
107
105
* Optional arguments:
108
106
*
109
107
* * @kernel: #VipsKernel to use to interpolate (default: lanczos3)
110
- * * @centre: %gboolean use centre rather than corner sampling convention
111
108
*
112
109
* Reduce @in horizontally by a float factor. The pixels in @out are
113
110
* interpolated with a 1D mask generated by @kernel.
114
111
*
115
- * Set @centre to use centre rather than corner sampling convention. Centre
116
- * convention can be useful to match the behaviour of other systems.
117
- *
118
112
* This is a very low-level operation: see vips_resize() for a more
119
113
* convenient way to resize images.
120
114
*
@@ -136,7 +130,7 @@ typedef struct _VipsReduce {
136
130
*/
137
131
VipsKernel kernel ;
138
132
139
- /* Use centre rather than corner sampling convention .
133
+ /* Deprecated .
140
134
*/
141
135
gboolean centre ;
142
136
@@ -152,18 +146,16 @@ vips_reduce_build( VipsObject *object )
152
146
VipsResample * resample = VIPS_RESAMPLE ( object );
153
147
VipsReduce * reduce = (VipsReduce * ) object ;
154
148
VipsImage * * t = (VipsImage * * )
155
- vips_object_local_array ( object , 3 );
149
+ vips_object_local_array ( object , 2 );
156
150
157
151
if ( VIPS_OBJECT_CLASS ( vips_reduce_parent_class )-> build ( object ) )
158
152
return ( -1 );
159
153
160
154
if ( vips_reducev ( resample -> in , & t [0 ], reduce -> vshrink ,
161
155
"kernel" , reduce -> kernel ,
162
- "centre" , reduce -> centre ,
163
156
NULL ) ||
164
157
vips_reduceh ( t [0 ], & t [1 ], reduce -> hshrink ,
165
158
"kernel" , reduce -> kernel ,
166
- "centre" , reduce -> centre ,
167
159
NULL ) ||
168
160
vips_image_write ( t [1 ], resample -> out ) )
169
161
return ( -1 );
@@ -210,13 +202,6 @@ vips_reduce_class_init( VipsReduceClass *class )
210
202
G_STRUCT_OFFSET ( VipsReduce , kernel ),
211
203
VIPS_TYPE_KERNEL , VIPS_KERNEL_LANCZOS3 );
212
204
213
- VIPS_ARG_BOOL ( class , "centre" , 7 ,
214
- _ ( "Centre" ),
215
- _ ( "Use centre sampling convention" ),
216
- VIPS_ARGUMENT_OPTIONAL_INPUT ,
217
- G_STRUCT_OFFSET ( VipsReduce , centre ),
218
- FALSE );
219
-
220
205
/* The old names .. now use h and v everywhere.
221
206
*/
222
207
VIPS_ARG_DOUBLE ( class , "xshrink" , 8 ,
@@ -233,6 +218,15 @@ vips_reduce_class_init( VipsReduceClass *class )
233
218
G_STRUCT_OFFSET ( VipsReduce , vshrink ),
234
219
1.0 , 1000000.0 , 1.0 );
235
220
221
+ /* We used to let people pick centre or corner, but it's automatic now.
222
+ */
223
+ VIPS_ARG_BOOL ( class , "centre" , 7 ,
224
+ _ ( "Centre" ),
225
+ _ ( "Use centre sampling convention" ),
226
+ VIPS_ARGUMENT_OPTIONAL_INPUT | VIPS_ARGUMENT_DEPRECATED ,
227
+ G_STRUCT_OFFSET ( VipsReduce , centre ),
228
+ FALSE );
229
+
236
230
}
237
231
238
232
static void
@@ -252,14 +246,10 @@ vips_reduce_init( VipsReduce *reduce )
252
246
* Optional arguments:
253
247
*
254
248
* * @kernel: #VipsKernel to use to interpolate (default: lanczos3)
255
- * * @centre: %gboolean use centre rather than corner sampling convention
256
249
*
257
250
* Reduce @in by a pair of factors with a pair of 1D kernels. This
258
251
* will not work well for shrink factors greater than three.
259
252
*
260
- * Set @centre to use centre rather than corner sampling convention. Centre
261
- * convention can be useful to match the behaviour of other systems.
262
- *
263
253
* This is a very low-level operation: see vips_resize() for a more
264
254
* convenient way to resize images.
265
255
*
0 commit comments