3909N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. 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 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 * 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. 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 2956N/A // perhaps we should be using weak references here, but right now 2956N/A // that's not necessary. The way the renderer is, this map will 2956N/A // never contain more than one element - the one with key 64, since 2956N/A // we only do 8x8 supersampling. 2956N/A // The alpha map used by this object (taken out of our map cache) to convert 2956N/A // pixel coverage counts gotten from PiscesCache (which are in the range 2956N/A // [0, maxalpha]) into alpha values, which are in [0,256). 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 2956N/A // Note: if we have a filled rectangle that doesn't end on a tile 2956N/A // border, we could still return 0xff, even though al!=maxTileAlphaSum 2956N/A // This is because if we return 0xff, our users will fill a rectangle 2956N/A // starting at x,y that has width = Math.min(TILE_SIZE, bboxX1-x), 2956N/A // and height min(TILE_SIZE,bboxY1-y), which is what should happen. 2956N/A // However, to support this, we would have to use 2 Math.min's 2956N/A // and 2 multiplications per tile, instead of just 2 multiplications 2956N/A // to compute maxTileAlphaSum. The savings offered would probably 2956N/A // not be worth it, considering how rare this case is. 2956N/A // Note: I have not tested this, so in the future if it is determined 2956N/A // that it is worth it, it should be implemented. Perhaps this method's 2956N/A // interface should be changed to take arguments the width and height 2956N/A // of the current tile. This would eliminate the 2 Math.min calls that 2956N/A // would be needed here, since our caller needs to compute these 2 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("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.