awt_parseImage.c revision 2362
2362N/A * Copyright (c) 1997, 2006, 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 0N/A/* Parse the buffered image. All of the raster information is returned in the 0N/A * imagePP structure. 0N/A * The handleCustom parameter specifies whether or not the caller 0N/A * can use custom channels. If it is false and a custom channel 0N/A * is encountered, the returned value will be 0 and all structures 0N/A * will be deallocated. 0N/A /* Make sure the image exists */ 0N/A /* Retrieve the raster */ 0N/A /* Retrieve the image type */ 0N/A /* Parse the raster */ 0N/A /* Retrieve the color model */ 0N/A /* Parse the color model */ 0N/A/* Parse the raster. All of the raster information is returned in the 0N/A * rasterP structure. 0N/A * 0: Can't do it (Custom channel) 0N/A * we can't handle such kind of rasters due to limitations 0N/A /* Figure out if this is the default CM */ 0N/A "Unable to find default CM");
0N/A /* Find out what type of colol model */ 0N/A /* Need to find the transparent index */ 0N/A if ((
rgb[i]&
0xff000000) == 0) {
0N/A /* Now what? No transparent pixel... */ 0N/A /* Free the raster */ 0N/A /* These hints are #bytes */ 0N/A /* Figure out if it is interleaved */ 0N/A /* Overlapping samples */ 0N/A /* Could just copy */ 0N/A /* Ignore the case if bands are overlapping */ 0N/A /* Don't handle any other case */ 0N/A /* REMIND: Not necessarily correct */ 0N/A /* Don't know what it is */ 0N/A /* REMIND: Need to handle more cases */ 0N/A * This routine will fill in a buffer of data for either 1 band or all 0N/A * bands (if band == -1). 0N/A /* Here is the generic code */ 0N/A for (y=0; y < h; ) {
0N/A for (y=0; y < h; ) {
0N/A /* Here is the generic code */ 0N/A /* Here is the generic code */ 0N/A /* Here is the generic code */