< prev index next >
src/java.desktop/share/classes/sun/awt/image/IntegerInterleavedRaster.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 213,223 ****
if ((x < this.minX) || (y < this.minY) ||
(x >= this.maxX) || (y >= this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int outData[];
if (obj == null) {
outData = new int[1];
} else {
outData = (int[])obj;
}
--- 213,223 ----
if ((x < this.minX) || (y < this.minY) ||
(x >= this.maxX) || (y >= this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int[] outData;
if (obj == null) {
outData = new int[1];
} else {
outData = (int[])obj;
}
*** 258,268 ****
if ((x < this.minX) || (y < this.minY) ||
(x + w > this.maxX) || (y + h > this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int outData[];
if (obj instanceof int[]) {
outData = (int[])obj;
} else {
outData = new int[w*h];
}
--- 258,268 ----
if ((x < this.minX) || (y < this.minY) ||
(x + w > this.maxX) || (y + h > this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int[] outData;
if (obj instanceof int[]) {
outData = (int[])obj;
} else {
outData = new int[w*h];
}
*** 295,305 ****
if ((x < this.minX) || (y < this.minY) ||
(x >= this.maxX) || (y >= this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int inData[] = (int[])obj;
int off = (y-minY)*scanlineStride + (x-minX) + dataOffsets[0];
data[off] = inData[0];
--- 295,305 ----
if ((x < this.minX) || (y < this.minY) ||
(x >= this.maxX) || (y >= this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int[] inData = (int[])obj;
int off = (y-minY)*scanlineStride + (x-minX) + dataOffsets[0];
data[off] = inData[0];
*** 352,362 ****
// Write inRaster (minX, minY) to (dstX, dstY)
int srcOffX = inRaster.getMinX();
int srcOffY = inRaster.getMinY();
! int tdata[] = null;
if (inRaster instanceof IntegerInterleavedRaster) {
IntegerInterleavedRaster ict = (IntegerInterleavedRaster) inRaster;
// Extract the raster parameters
--- 352,362 ----
// Write inRaster (minX, minY) to (dstX, dstY)
int srcOffX = inRaster.getMinX();
int srcOffY = inRaster.getMinY();
! int[] tdata = null;
if (inRaster instanceof IntegerInterleavedRaster) {
IntegerInterleavedRaster ict = (IntegerInterleavedRaster) inRaster;
// Extract the raster parameters
*** 415,425 ****
if ((x < this.minX) || (y < this.minY) ||
(x + w > this.maxX) || (y + h > this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int inData[] = (int[])obj;
int yoff = (y-minY)*scanlineStride + (x-minX) + dataOffsets[0];
int off = 0;
for (int ystart = 0; ystart < h; ystart++) {
System.arraycopy(inData, off, data, yoff, w);
--- 415,425 ----
if ((x < this.minX) || (y < this.minY) ||
(x + w > this.maxX) || (y + h > this.maxY)) {
throw new ArrayIndexOutOfBoundsException
("Coordinate out of bounds!");
}
! int[] inData = (int[])obj;
int yoff = (y-minY)*scanlineStride + (x-minX) + dataOffsets[0];
int off = 0;
for (int ystart = 0; ystart < h; ystart++) {
System.arraycopy(inData, off, data, yoff, w);
*** 450,460 ****
* if the specified bounding box is outside of the parent raster.
*/
public WritableRaster createWritableChild (int x, int y,
int width, int height,
int x0, int y0,
! int bandList[]) {
if (x < this.minX) {
throw new RasterFormatException("x lies outside raster");
}
if (y < this.minY) {
throw new RasterFormatException("y lies outside raster");
--- 450,460 ----
* if the specified bounding box is outside of the parent raster.
*/
public WritableRaster createWritableChild (int x, int y,
int width, int height,
int x0, int y0,
! int[] bandList) {
if (x < this.minX) {
throw new RasterFormatException("x lies outside raster");
}
if (y < this.minY) {
throw new RasterFormatException("y lies outside raster");
*** 504,514 ****
* if the specified bounding box is outside of the parent raster.
*/
public Raster createChild (int x, int y,
int width, int height,
int x0, int y0,
! int bandList[]) {
return createWritableChild(x, y, width, height, x0, y0, bandList);
}
/**
--- 504,514 ----
* if the specified bounding box is outside of the parent raster.
*/
public Raster createChild (int x, int y,
int width, int height,
int x0, int y0,
! int[] bandList) {
return createWritableChild(x, y, width, height, x0, y0, bandList);
}
/**
< prev index next >