< prev index next >
src/java.desktop/share/classes/sun/awt/image/IntegerComponentRaster.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 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) 1997, 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
*** 270,280 ****
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[numDataElements];
} else {
outData = (int[])obj;
}
--- 270,280 ----
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[numDataElements];
} else {
outData = (int[])obj;
}
*** 318,328 ****
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[numDataElements*w*h];
}
--- 318,328 ----
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[numDataElements*w*h];
}
*** 362,372 ****
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)*pixelStride;
for (int i = 0; i < numDataElements; i++) {
--- 362,372 ----
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)*pixelStride;
for (int i = 0; i < numDataElements; i++) {
*** 421,431 ****
// Write inRaster (minX, minY) to (dstX, dstY)
int srcOffX = inRaster.getMinX();
int srcOffY = inRaster.getMinY();
! int tdata[] = null;
if (inRaster instanceof IntegerComponentRaster &&
(pixelStride == 1) && (numDataElements == 1)) {
IntegerComponentRaster ict = (IntegerComponentRaster) inRaster;
if (ict.getNumDataElements() != 1) {
--- 421,431 ----
// Write inRaster (minX, minY) to (dstX, dstY)
int srcOffX = inRaster.getMinX();
int srcOffY = inRaster.getMinY();
! int[] tdata = null;
if (inRaster instanceof IntegerComponentRaster &&
(pixelStride == 1) && (numDataElements == 1)) {
IntegerComponentRaster ict = (IntegerComponentRaster) inRaster;
if (ict.getNumDataElements() != 1) {
*** 494,504 ****
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)*pixelStride;
int xoff;
int off = 0;
--- 494,504 ----
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)*pixelStride;
int xoff;
int off = 0;
*** 538,548 ****
* 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");
--- 538,548 ----
* 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");
*** 592,602 ****
* 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);
}
/**
--- 592,602 ----
* 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 >