split out ImagingResampleInner from ImagingResample

This commit is contained in:
homm 2016-11-30 21:59:21 +03:00
parent 9842505a60
commit 2c2bdd80ef

View File

@ -547,11 +547,16 @@ typedef Imaging (*ResampleFunction)(Imaging imOut, Imaging imIn,
float x0, float x1, struct filter *filterp);
Imaging
ImagingResampleInner(Imaging imIn, int xsize, int ysize,
struct filter *filterp, float box[4],
ResampleFunction ResampleHorizontal,
ResampleFunction ResampleVertical);
Imaging
ImagingResample(Imaging imIn, int xsize, int ysize, int filter, float box[4])
{
Imaging imTemp = NULL;
Imaging imOut = NULL;
struct filter *filterp;
ResampleFunction ResampleHorizontal;
ResampleFunction ResampleVertical;
@ -603,6 +608,20 @@ ImagingResample(Imaging imIn, int xsize, int ysize, int filter, float box[4])
);
}
return ImagingResampleInner(imIn, xsize, ysize, filterp, box,
ResampleHorizontal, ResampleVertical);
}
Imaging
ImagingResampleInner(Imaging imIn, int xsize, int ysize,
struct filter *filterp, float box[4],
ResampleFunction ResampleHorizontal,
ResampleFunction ResampleVertical)
{
Imaging imTemp = NULL;
Imaging imOut = NULL;
/* two-pass resize, first pass */
if (box[0] || box[2] != xsize) {
imTemp = ImagingNew(imIn->mode, xsize, imIn->ysize);