2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2005-01-12 02:31:07 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2005-01-12 02:31:07 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2005-01-12 02:31:07 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2005-01-12 02:31:07 +08:00
|
|
|
*/
|
|
|
|
|
2007-08-08 16:35:45 +08:00
|
|
|
#ifndef __SCALE_REGION_H__
|
|
|
|
#define __SCALE_REGION_H__
|
2005-01-12 02:31:07 +08:00
|
|
|
|
|
|
|
|
2006-10-12 00:24:43 +08:00
|
|
|
#define LANCZOS_SPP (4000) /* number of data pts per unit x in lookup table */
|
2006-09-22 03:48:44 +08:00
|
|
|
#define LANCZOS_MIN (1.0/LANCZOS_SPP)
|
2007-07-18 20:47:00 +08:00
|
|
|
#define LANCZOS_WIDTH (3) /* 3 for Lanczos3 code, for L4 prefer DUAL_LANCZOS below */
|
2006-09-06 23:29:45 +08:00
|
|
|
#define LANCZOS_WIDTH2 (1 + (LANCZOS_WIDTH * 2))
|
|
|
|
#define LANCZOS_SAMPLES (LANCZOS_SPP * (LANCZOS_WIDTH + 1))
|
2005-01-12 02:31:07 +08:00
|
|
|
|
|
|
|
|
2006-11-24 22:08:40 +08:00
|
|
|
void scale_region (PixelRegion *srcPR,
|
|
|
|
PixelRegion *destPR,
|
|
|
|
GimpInterpolationType interpolation,
|
|
|
|
GimpProgressFunc progress_callback,
|
|
|
|
gpointer progress_data);
|
2005-01-12 02:31:07 +08:00
|
|
|
|
2006-11-24 22:08:40 +08:00
|
|
|
gfloat * create_lanczos_lookup (void);
|
2005-01-12 02:31:07 +08:00
|
|
|
|
2007-07-18 20:47:00 +08:00
|
|
|
|
2007-08-08 16:35:45 +08:00
|
|
|
#endif /* __SCALE_REGION_H__ */
|
2005-01-20 18:31:36 +08:00
|
|
|
|
2007-07-18 20:47:00 +08:00
|
|
|
/*
|
|
|
|
* Determining LANCZOS_SPP value
|
|
|
|
*
|
|
|
|
* 1000 points per unit will produce typically 1 bit of error per channel
|
|
|
|
* on a Lanczos3 window. 4000 should not produce a detectable error caused
|
|
|
|
* by lookup table size.
|
|
|
|
* On 8b colours ie 24bit RGB this req 80kB of memory comparable to a small
|
|
|
|
* 250x150 px image. Filling the array is a small part of the time required
|
|
|
|
* for the transform.
|
|
|
|
* This will need reviewing when GIMP handles images with more bytes per pixel.
|
|
|
|
*/
|
2006-10-12 00:24:43 +08:00
|
|
|
|