PiscesTileGenerator.java revision 0
0N/A * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 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 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 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 * 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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A //System.out.println("bbox["+bbox[0]+", "+bbox[1]+" => "+bbox[2]+", "+bbox[3]+"]"); 0N/A * Gets the width of the tiles that the generator batches output into. 0N/A * @return the width of the standard alpha tile 0N/A * Gets the height of the tiles that the generator batches output into. 0N/A * @return the height of the standard alpha tile 0N/A * Gets the typical alpha value that will characterize the current 0N/A * The answer may be 0x00 to indicate that the current tile has 0N/A * no coverage in any of its pixels, or it may be 0xff to indicate 0N/A * that the current tile is completely covered by the path, or any 0N/A * other value to indicate non-trivial coverage cases. 0N/A * @return 0x00 for no coverage, 0xff for total coverage, or any other 0N/A * value for partial coverage of the tile 0N/A if (
true)
return 0x80;
0N/A // Decode run-length encoded alpha mask data 0N/A // The data for row j begins at cache.rowOffsetsRLE[j] 0N/A // and is encoded as a set of 2-byte pairs (val, runLen) 0N/A // terminated by a (0, 0) pair. 0N/A * Skips the current tile and moves on to the next tile. 0N/A * Either this method, or the getAlpha() method should be called 0N/A * once per tile, but not both. 0N/A * Gets the alpha coverage values for the current tile. 0N/A * Either this method, or the nextTile() method should be called 0N/A * once per tile, but not both. 0N/A // Decode run-length encoded alpha mask data 0N/A // The data for row j begins at cache.rowOffsetsRLE[j] 0N/A // and is encoded as a set of 2-byte pairs (val, runLen) 0N/A // terminated by a (0, 0) pair. 0N/A //System.out.println("L["+(cx-x0)+"]"); 0N/A //System.out.println("M["+runLen+"]"); 0N/A for (int i = idx - (x1-x0); i < idx; i++) { 0N/A System.out.print(hex(tile[i], 2)); 0N/A System.out.println(); 0N/A * Disposes this tile generator. 0N/A * No further calls will be made on this instance.