@@ -94,7 +94,6 @@ vips_getpoint_build(VipsObject *object)
94
94
VipsGetpoint * getpoint = (VipsGetpoint * ) object ;
95
95
VipsImage * * t = (VipsImage * * ) vips_object_local_array (object , 4 );
96
96
97
- double * vector ;
98
97
VipsArrayDouble * out_array ;
99
98
100
99
if (VIPS_OBJECT_CLASS (vips_getpoint_parent_class )-> build (object ))
@@ -104,7 +103,7 @@ vips_getpoint_build(VipsObject *object)
104
103
*/
105
104
gboolean iscomplex = getpoint -> unpack_complex &&
106
105
vips_band_format_iscomplex (getpoint -> in -> BandFmt );
107
- VipsBandFormat target_bands = iscomplex ?
106
+ int target_bands = iscomplex ?
108
107
getpoint -> in -> Bands * 2 : getpoint -> in -> Bands ;
109
108
VipsBandFormat target_format = iscomplex ?
110
109
VIPS_FORMAT_DPCOMPLEX : VIPS_FORMAT_DOUBLE ;
@@ -123,11 +122,7 @@ vips_getpoint_build(VipsObject *object)
123
122
vips_image_write (t [2 ], t [3 ]))
124
123
return -1 ;
125
124
126
- if (!(vector = VIPS_ARRAY (getpoint -> in , target_bands , double )))
127
- return -1 ;
128
- memcpy (vector , t [3 ]-> data , VIPS_IMAGE_SIZEOF_PEL (t [3 ]));
129
-
130
- out_array = vips_array_double_new (vector , target_bands );
125
+ out_array = vips_array_double_new ((double * ) t [3 ]-> data , target_bands );
131
126
g_object_set (object ,
132
127
"out_array" , out_array ,
133
128
NULL );
@@ -201,8 +196,8 @@ vips_getpoint_init(VipsGetpoint *getpoint)
201
196
* Reads a single pixel on an image.
202
197
*
203
198
* The pixel values are returned in @vector, the length of the
204
- * array in @n. You must free the array with [[email protected] ] when you are done with
205
- * it.
199
+ * array in @n. You must free the array with [[email protected] ] when you are
200
+ * done with it.
206
201
*
207
202
* The result array has an element for each band. If @unpack_complex is set,
208
203
* pixels in complex images are returned as double-length arrays.
0 commit comments