/**************************************************************************** * Func: fant_resample * * * * Desc: performs resample of image row or column using Fant's resampling * * algorithm presented in IEEE Computer Graphics & Applications Jan 86* * * * Params: source- pointer to source image * * len- length of row or column being processed * * pixel_offset- number of pixels to next pixe in row or col * * out_position- output coordinates for each input pixel * * dest- pointer to destination image * ****************************************************************************/ void fant_resample(image_ptr source, int len, int pixel_offset, float *out_position, image_ptr dest) { int i, j; /* loop variables */ int current_pixel; /* pixel being processed */ int next_pixel; /* one pixel beyond current_pixel */ double intensity; /* linearly interpolated pixel value */ double sizfac; /* size factor */ double inseg; /* part of current pixel to contribute */ double outseg; /* how much required to complete next pixel */ double accum; /* accumulator */ double *in_position; /* normalized scaling data */ in_position = malloc((len+1) * sizeof(double)); /* normalize scaling factors to integer pixel boundaries */ i=0; for(j=0; j