001: /*
002: *
003: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
004: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License version
008: * 2 only, as published by the Free Software Foundation.
009: *
010: * This program is distributed in the hope that it will be useful, but
011: * WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * General Public License version 2 for more details (a copy is
014: * included at /legal/license.txt).
015: *
016: * You should have received a copy of the GNU General Public License
017: * version 2 along with this work; if not, write to the Free Software
018: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
022: * Clara, CA 95054 or visit www.sun.com if you need additional
023: * information or have any questions.
024: */
025:
026: package com.sun.pisces;
027:
028: public abstract class RendererBase extends LineSink {
029:
030: // Enumerated constants
031:
032: public static final int DEFAULT_SUBPIXEL_LG_POSITIONS_X = 3;
033: public static final int DEFAULT_SUBPIXEL_LG_POSITIONS_Y = 3;
034:
035: public static final int WIND_EVEN_ODD = 0;
036: public static final int WIND_NON_ZERO = 1;
037:
038: public static final int COMPOSITE_CLEAR = 0;
039: public static final int COMPOSITE_SRC = 1;
040: public static final int COMPOSITE_SRC_OVER = 2;
041:
042: /**
043: * Constant indicating 8/8/8 RGB pixel data stored in an
044: * <code>int</code> array.
045: */
046: public static final int TYPE_INT_RGB = 1;
047:
048: /**
049: * Constant indicating 8/8/8/8 ARGB pixel data stored in an
050: * <code>int</code> array.
051: */
052: public static final int TYPE_INT_ARGB = 2;
053:
054: /**
055: * Constant indicating 8/8/8/8 ARGB alpha-premultiplied pixel data stored
056: * in a <code>int</code> array.
057: */
058: public static final int TYPE_INT_ARGB_PRE = 3;
059:
060: /**
061: * Constant indicating 5/6/5 RGB pixel data stored in an
062: * <code>short</code> array.
063: */
064: public static final int TYPE_USHORT_565_RGB = 8;
065:
066: /**
067: * Constant indicating 8 bit grayscale pixel data stored in a
068: * <code>byte</code> array.
069: */
070: public static final int TYPE_BYTE_GRAY = 10;
071:
072: protected int imageType;
073:
074: public RendererBase(int imageType) {
075: this .imageType = imageType;
076: }
077:
078: public int getImageType() {
079: return imageType;
080: }
081:
082: public abstract void setAntialiasing(int subpixelLgPositionsX,
083: int subpixelLgPositionsY);
084:
085: public abstract int getSubpixelLgPositionsX();
086:
087: public abstract int getSubpixelLgPositionsY();
088:
089: public abstract void setColor(int red, int green, int blue,
090: int alpha);
091:
092: public abstract void setPaint(Paint paint);
093:
094: public abstract void beginRendering(int boundsX, int boundsY,
095: int boundsWidth, int boundsHeight, int windingRule);
096:
097: public abstract void moveTo(int x0, int y0);
098:
099: public void lineJoin() {
100: // Do nothing
101: }
102:
103: public abstract void lineTo(int x1, int y1);
104:
105: public abstract void close();
106:
107: public void end() {
108: // Do nothing
109: }
110:
111: public abstract void endRendering();
112:
113: public abstract void getBoundingBox(int[] bbox);
114:
115: // public abstract void setCache(PiscesCache cache);
116:
117: // public abstract void renderFromCache(PiscesCache cache);
118:
119: // public abstract void drawImage(int imageType, Object data,
120: // int width, int height,
121: // int offset, int stride,
122: // int x, int y);
123:
124: public void getImageData(Object data, int offset, int scanlineStride) {
125: // do nothing
126: }
127:
128: public abstract void clearRect(int x, int y, int w, int h);
129: }
|