/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* This file contains macro definitions for the Scaling category of
* the macros used by the generic scaleloop function.
*
* This implementation uses a simple equation which simply chooses
* the closest input pixel to the location which is obtained from
* mapping inversely from the output rectangle to the input rectangle.
* The input pixels will be replicated when scaling larger than the
* original image size since the same input pixel will be chosen for
* more than one output pixel. Conversely, when scaling smaller than
* the original image size, the input pixels will be omitted as needed
* to pare them down to the required number of samples for the output
* image. If there is no scaling occuring in one or both directions
* the macros attempt to short-circuit most of the more complicated
* calculations in an attempt to impose little cost for using this
* implementation in the general case. The calculations also do not
* impose any restrictions on the order of delivery of the pixels.
*
* This file can be used to provide the default implementation of the
* Scaling macros, handling both scaled and unscaled cases and any
* order of pixel delivery.
*/
#define DeclareScaleVars \
do { \
inputadjust = srcScan; \
inputadjust -= srcW; \
} else { \
return SCALENOOP; \
} \
% (2 * (dstTW))); \
} \
} else { \
return SCALENOOP; \
} \
} \
} while (0)
do { \
} else { \
} \
srcXincrem = srcX1increm; \
} \
} while (0)
do { \
pixel = GetPixelInc(); \
} else { \
srcXincrem += srcXrem; \
srcX++; \
} \
} \
} while (0)
do { \
} \
} while (0)