14
14
* */
15
15
16
16
const char * image_resample__doc__ =
17
- " resample(input_array, output_array, matrix, interpolation=NEAREST, alpha=1.0, norm=0 , radius=1)\n\n "
17
+ " resample(input_array, output_array, matrix, interpolation=NEAREST, alpha=1.0, norm=False , radius=1)\n\n "
18
18
19
19
" Resample input_array, blending it in-place into output_array, using an\n "
20
20
" affine transformation.\n\n "
@@ -48,8 +48,8 @@ const char* image_resample__doc__ =
48
48
" The level of transparency to apply. 1.0 is completely opaque.\n "
49
49
" 0.0 is completely transparent.\n\n "
50
50
51
- " norm : float , optional\n "
52
- " The norm for the interpolation function. Default is 0 .\n\n "
51
+ " norm : bool , optional\n "
52
+ " Whether to norm the interpolation function. Default is `False` .\n\n "
53
53
54
54
" radius: float, optional\n "
55
55
" The radius of the kernel, if method is SINC, LANCZOS or BLACKMAN.\n "
@@ -120,6 +120,7 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
120
120
PyObject *py_transform = NULL ;
121
121
resample_params_t params;
122
122
int resample_;
123
+ int norm_;
123
124
124
125
PyArrayObject *input_array = NULL ;
125
126
PyArrayObject *output_array = NULL ;
@@ -132,9 +133,9 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
132
133
" resample" , " alpha" , " norm" , " radius" , NULL };
133
134
134
135
if (!PyArg_ParseTupleAndKeywords (
135
- args, kwargs, " OOO|iiddd :resample" , (char **)kwlist,
136
+ args, kwargs, " OOO|iidid :resample" , (char **)kwlist,
136
137
&py_input_array, &py_output_array, &py_transform,
137
- ¶ms.interpolation , &resample_, ¶ms.alpha , ¶ms. norm ,
138
+ ¶ms.interpolation , &resample_, ¶ms.alpha , &norm_ ,
138
139
¶ms.radius )) {
139
140
return NULL ;
140
141
}
@@ -146,6 +147,7 @@ image_resample(PyObject *self, PyObject* args, PyObject *kwargs)
146
147
}
147
148
148
149
params.resample = (resample_ != 0 );
150
+ params.norm = (norm_ != 0 );
149
151
150
152
input_array = (PyArrayObject *)PyArray_FromAny (
151
153
py_input_array, NULL , 2 , 3 , NPY_ARRAY_C_CONTIGUOUS, NULL );
0 commit comments