3261N/A * Copyright (c) 1995, 2010, 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 0N/A long pData;
// used by windows native code only -- internal state REMIND ATTN @@ 0N/A /* ensure that the necessary native libraries are loaded */ 0N/A * Create an ImageRepresentation for the given Image. The 0N/A * width and height are unknown at this point. The color 0N/A * model is a hint as to the color model to use when creating 0N/A * the buffered image. If null, the src color model will 0N/A /* REMIND: Only used for Frame.setIcon - should use ImageWatcher instead */ 0N/A if (w <=
0 || h <=
0) {
0N/A // dimension mismatch => trigger recreation of the buffer 0N/A * Returns the BufferedImage that will be used as the representation of 0N/A * the pixel data. Subclasses can override this method to return 0N/A * platform specific subclasses of BufferedImage that may or may not be 0N/A * It is subclass' responsibility to propagate acceleration priority 0N/A * to the newly created image. 0N/A // Check to see if model is INT_RGB 0N/A // Probably need to composite anyway so force ARGB 0N/A // If it is INT_RGB or INT_ARGB, use the model 0N/A // REMIND: Be careful! Is this called everytime there is a 0N/A // startProduction? We only want to call it if it is new or 0N/A // there is an error 0N/A // Create a default image 0N/A // Note that stealData() requires a markDirty() afterwards 0N/A // since we modify the data in it. 0N/A for (
int y=
0; y < h; y++) {
0N/A for (
int x=
0; x < w; x++) {
0N/A // We modified the data array directly above so mark it as dirty now... 0N/A // REMIND: What if the model doesn't fit in default color model? 0N/A synchronized (
this) {
2267N/A int x1 = x+w;
// Overflow protection below 2267N/A int y1 = y+h;
// Overflow protection below 2267N/A // x,y,x1,y1 are all >= 0, so w,h must be >= 0 2267N/A // off is first pixel read so it must be in bounds 2267N/A // They overflowed their own array 2267N/A // pix.length and off are >= 0 so remainder >= 0 2267N/A // They overflowed their own array 2267N/A // They overflowed their own array. 0N/A // Note that setDiffICM modified the raster directly 0N/A // so we must mark it as changed 0N/A // Fill in the new lut 0N/A // Note that setICMpixels modifies the raster directly 0N/A // so we must mark it as changed afterwards 0N/A // It is an IndexColorModel 0N/A for (
int i=
0; i < w; i++) {
0N/A for (
int i=
0; i < w; i++) {
0N/A // REMIND: What if the model doesn't fit in default color model? 0N/A synchronized (
this) {
0N/A // REMIND: Right now we don't support writing back into ICM 0N/A // Need to pack the data 0N/A // Note: manual modification of pixels, mark the 0N/A // raster as changed 0N/A for (
int i=
0; i < w; i++) {
0N/A // Note that we steal the data array here, but only for reading... 0N/A synchronized (
this) {
0N/A // Some producers deliver image data synchronously 0N/A // Some producers deliver image data synchronously 0N/A int x,
int y,
int w,
int h,
0N/A // Some producers deliver image data synchronously 0N/A // Some producers deliver image data synchronously 0N/A // Some producers deliver image data synchronously