#ifndef float_image_interpolate_C0_H #define float_image_interpolate_C0_H /* Bilinear (C0) interpolation of floating-point images. */ /* Last edited on 2009-06-03 20:28:28 by stolfi */ #include #include #include /* IMAGE INTERPOLATION For the procedures in this section, the pixel on column {ix} and row {iy} is assumed to be centered at point {(ix+0.5,iy+0.5)}. */ float float_image_interpolate_C0_sample(float_image_t *A, int c, double x, double y, ix_reduction_t red); /* Returns the value of channel {c} of image {A} at the point {(x,y)}, computed by bilinear interpolation from nearby samples. More precisely, if {x} and {y} are of the form {ix + fx} and {iy + fy}, with integer {ix,iy} and {fx,fy} in {[-0.5 _ +0.5]}, then returns the weighted average of the four samples in columns {ix-1} and {ix}, with weights {0.5-fx} and {0.5+fx}, and rows {iy-1} and {iy}, with weights {0.5-fy} and {0.5+fy}. Indices outside the valid ranges are reduced according to {ix_reduce(i, N, red)}. */ void float_image_interpolate_C0_pixel(float_image_t *A, double x, double y, ix_reduction_t red, float v[]); /* For {c=0..NC-1}, stores into {v[c]} the value of chanel {c} of image {A} at the point {(x,y)}, computed as in {float_image_interpolate_C0_sample}; where {NC} is the number of channels of {A}. */ #endif