0N/A/*
2362N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#ifndef ProcessPath_h_Included
0N/A#define ProcessPath_h_Included
0N/A
0N/A#include <float.h>
0N/A#include "jni_util.h"
0N/A
0N/A#define UPPER_BND (FLT_MAX/4.0f)
0N/A#define LOWER_BND (-UPPER_BND)
0N/A
0N/A/* Precision (in bits) used in forward differencing */
0N/A#define FWD_PREC 7
0N/A
0N/A/* Precision (in bits) used for the rounding in the midpoint test */
0N/A#define MDP_PREC 10
0N/A
0N/A#define MDP_MULT (1<<MDP_PREC)
0N/A#define MDP_HALF_MULT (MDP_MULT >> 1)
0N/A
0N/A/* Bit mask used to separate whole part from the fraction part of the
0N/A * number
0N/A */
0N/A#define MDP_W_MASK (-MDP_MULT)
0N/A
0N/A/* Bit mask used to separate fractional part from the whole part of the
0N/A * number
0N/A */
0N/A#define MDP_F_MASK (MDP_MULT-1)
0N/A
0N/Atypedef struct _DrawHandler {
0N/A void (*pDrawLine)(struct _DrawHandler* hnd,
0N/A jint x0, jint y0, jint x1, jint y1);
0N/A
0N/A void (*pDrawPixel)(struct _DrawHandler* hnd, jint x0, jint y0);
0N/A
0N/A void (*pDrawScanline)(struct _DrawHandler* hnd, jint x0, jint x1, jint y0);
0N/A // TODO Change following names to smth like outXMin
0N/A jint xMin, yMin, xMax, yMax;
0N/A
0N/A /* Boundary values with stroke control rendering hint applied */
0N/A jfloat xMinf, yMinf, xMaxf, yMaxf;
0N/A
0N/A void* pData;
0N/A} DrawHandler;
0N/A
0N/Atypedef enum {
0N/A PH_MODE_DRAW_CLIP,
0N/A PH_MODE_FILL_CLIP
0N/A} PHClip;
0N/A
0N/A/* Constants representing KEY_STROKE_CONTROL rendering hints */
0N/Atypedef enum {
0N/A PH_STROKE_PURE, /* RenderingHints.VALUE_STROKE_PURE */
0N/A PH_STROKE_DEFAULT /* RenderingHints.VALUE_STROKE_DEFAULT */
0N/A} PHStroke;
0N/A
0N/Atypedef struct _ProcessHandler {
0N/A void (*pProcessFixedLine)(struct _ProcessHandler* hnd,
0N/A jint x1,jint y1,
0N/A jint x2,jint y2, jint* pixelInfo,
0N/A jboolean checkBounds,
0N/A jboolean endSubPath);
0N/A void (*pProcessEndSubPath)(struct _ProcessHandler* hnd);
0N/A DrawHandler* dhnd;
0N/A PHStroke stroke;
0N/A PHClip clipMode;
0N/A void* pData;
0N/A} ProcessHandler;
0N/A
0N/A
0N/Ajboolean doDrawPath(DrawHandler* hnd,
0N/A void (*pProcessEndSubPath)(ProcessHandler* hnd),
0N/A jint transX, jint transY,
0N/A jfloat* coords, jint maxCoords,
0N/A jbyte* types, jint numTypes,
0N/A PHStroke stroke);
0N/A
0N/Ajboolean doFillPath(DrawHandler* hnd,
0N/A jint transX, jint transY,
0N/A jfloat* coords, jint maxCoords,
0N/A jbyte* types, jint numTypes,
0N/A PHStroke stroke,
0N/A jint fillRule);
0N/A
0N/A#endif