namespace ov::reference::interpolate_pil

namespace interpolate_pil {

// structs

struct filter;

// global functions

template <typename T_out, typename T_in>
T_out round_up(T_in x);

template <typename T_out, typename T_in>
T_out clip(
    const T_in& x,
    const T_out& min = std::numeric_limits<T_out>::min(),
    const T_out& max = std::numeric_limits<T_out>::max()
    );

static double bilinear_filter(double x, double);
static double bicubic_filter(double x, double a);

static int precompute_coeffs(
    int in_size,
    float in0,
    float in1,
    int out_size,
    const filter& filterp,
    std::vector<int>& bounds,
    std::vector<double>& kk
    );

template <typename T>
void imaging_resample_horizontal(
    T \* im_out,
    Shape im_out_shape,
    const T \* im_in,
    Shape im_in_shape,
    int offset,
    int ksize,
    std::vector<int>& bounds,
    std::vector<double>& kk
    );

template <typename T>
void imaging_resample_vertical(
    T \* im_out,
    Shape im_out_shape,
    const T \* im_in,
    Shape im_in_shape,
    int offset,
    int ksize,
    std::vector<int>& bounds,
    std::vector<double>& kk
    );

template <typename T>
void imaging_resample_inner(
    const T \* im_in,
    size_t im_in_xsize,
    size_t im_in_ysize,
    size_t xsize,
    size_t ysize,
    const filter& filterp,
    float \* box,
    T \* im_out
    );

} // namespace interpolate_pil