Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06ac53b

Browse files
committed
tiny cleanups
1 parent 3dd308b commit 06ac53b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

libvips/arithmetic/getpoint.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ vips_getpoint_build(VipsObject *object)
9494
VipsGetpoint *getpoint = (VipsGetpoint *) object;
9595
VipsImage **t = (VipsImage **) vips_object_local_array(object, 4);
9696

97-
double *vector;
9897
VipsArrayDouble *out_array;
9998

10099
if (VIPS_OBJECT_CLASS(vips_getpoint_parent_class)->build(object))
@@ -104,7 +103,7 @@ vips_getpoint_build(VipsObject *object)
104103
*/
105104
gboolean iscomplex = getpoint->unpack_complex &&
106105
vips_band_format_iscomplex(getpoint->in->BandFmt);
107-
VipsBandFormat target_bands = iscomplex ?
106+
int target_bands = iscomplex ?
108107
getpoint->in->Bands * 2 : getpoint->in->Bands;
109108
VipsBandFormat target_format = iscomplex ?
110109
VIPS_FORMAT_DPCOMPLEX : VIPS_FORMAT_DOUBLE;
@@ -123,11 +122,7 @@ vips_getpoint_build(VipsObject *object)
123122
vips_image_write(t[2], t[3]))
124123
return -1;
125124

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);
131126
g_object_set(object,
132127
"out_array", out_array,
133128
NULL);
@@ -201,8 +196,8 @@ vips_getpoint_init(VipsGetpoint *getpoint)
201196
* Reads a single pixel on an image.
202197
*
203198
* 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.
206201
*
207202
* The result array has an element for each band. If @unpack_complex is set,
208203
* pixels in complex images are returned as double-length arrays.

0 commit comments

Comments
 (0)