/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __SCALE_REGION_H__
#define __SCALE_REGION_H__

#define LANCZOS_SPP      (4000)    /* number of data pts per unit x in lookup table */
#define LANCZOS_MIN      (1.0/LANCZOS_SPP)
#define LANCZOS_WIDTH    (3)       /* 3 for Lanczos3 code, for L4 prefer DUAL_LANCZOS below */
#define LANCZOS_WIDTH2   (1 + (LANCZOS_WIDTH * 2))
#define LANCZOS_SAMPLES  (LANCZOS_SPP * (LANCZOS_WIDTH + 1))

typedef enum
{
  REDUCE_X = 0,
  REDUCE_Y,
  EXPAND_X,
  EXPAND_Y
} ScaleMode;

typedef struct
{
  gint    length;
  gdouble q[5];
  gdouble weight;
}  InterpolateKernel;


void     scale_region          (PixelRegion           *srcPR,
                                PixelRegion           *destPR,
                                GimpInterpolationType  interpolation,
                                GimpProgressFunc       progress_callback,
                                gpointer               progress_data);

gfloat * create_lanczos_lookup (void);


#endif  /*  __SCALE_REGION_H__  */
