< prev index next >

src/java.desktop/share/classes/java/awt/image/SampleModel.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
*** 232,244 **** * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the output. */ ! public int[] getPixel(int x, int y, int iArray[], DataBuffer data) { ! int pixels[]; if (iArray != null) pixels = iArray; else pixels = new int[numBands]; --- 232,244 ---- * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the output. */ ! public int[] getPixel(int x, int y, int[] iArray, DataBuffer data) { ! int[] pixels; if (iArray != null) pixels = iArray; else pixels = new int[numBands];
*** 696,709 **** * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the output. */ ! public float[] getPixel(int x, int y, float fArray[], DataBuffer data) { ! float pixels[]; if (fArray != null) pixels = fArray; else pixels = new float[numBands]; --- 696,709 ---- * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the output. */ ! public float[] getPixel(int x, int y, float[] fArray, DataBuffer data) { ! float[] pixels; if (fArray != null) pixels = fArray; else pixels = new float[numBands];
*** 727,740 **** * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the output. */ ! public double[] getPixel(int x, int y, double dArray[], DataBuffer data) { ! double pixels[]; if(dArray != null) pixels = dArray; else pixels = new double[numBands]; --- 727,740 ---- * * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the output. */ ! public double[] getPixel(int x, int y, double[] dArray, DataBuffer data) { ! double[] pixels; if(dArray != null) pixels = dArray; else pixels = new double[numBands];
*** 762,774 **** * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the output. */ public int[] getPixels(int x, int y, int w, int h, ! int iArray[], DataBuffer data) { ! int pixels[]; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 762,774 ---- * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the output. */ public int[] getPixels(int x, int y, int w, int h, ! int[] iArray, DataBuffer data) { ! int[] pixels; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 810,822 **** * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the output. */ public float[] getPixels(int x, int y, int w, int h, ! float fArray[], DataBuffer data) { ! float pixels[]; int Offset = 0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 810,822 ---- * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the output. */ public float[] getPixels(int x, int y, int w, int h, ! float[] fArray, DataBuffer data) { ! float[] pixels; int Offset = 0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 858,869 **** * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the output. */ public double[] getPixels(int x, int y, int w, int h, ! double dArray[], DataBuffer data) { ! double pixels[]; int Offset = 0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 858,869 ---- * @throws NullPointerException if data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the output. */ public double[] getPixels(int x, int y, int w, int h, ! double[] dArray, DataBuffer data) { ! double[] pixels; int Offset = 0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 974,985 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if iArray is too small to * hold the output. */ public int[] getSamples(int x, int y, int w, int h, int b, ! int iArray[], DataBuffer data) { ! int pixels[]; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width || --- 974,985 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if iArray is too small to * hold the output. */ public int[] getSamples(int x, int y, int w, int h, int b, ! int[] iArray, DataBuffer data) { ! int[] pixels; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width ||
*** 1022,1034 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if fArray is too small to * hold the output. */ public float[] getSamples(int x, int y, int w, int h, ! int b, float fArray[], DataBuffer data) { ! float pixels[]; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width || --- 1022,1034 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if fArray is too small to * hold the output. */ public float[] getSamples(int x, int y, int w, int h, ! int b, float[] fArray, DataBuffer data) { ! float[] pixels; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width ||
*** 1071,1083 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if dArray is too small to * hold the output. */ public double[] getSamples(int x, int y, int w, int h, ! int b, double dArray[], DataBuffer data) { ! double pixels[]; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width || --- 1071,1083 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if dArray is too small to * hold the output. */ public double[] getSamples(int x, int y, int w, int h, ! int b, double[] dArray, DataBuffer data) { ! double[] pixels; int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x1 < x || x1 > width ||
*** 1112,1122 **** * * @throws NullPointerException if iArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the input. */ ! public void setPixel(int x, int y, int iArray[], DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, iArray[i], data); } --- 1112,1122 ---- * * @throws NullPointerException if iArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the input. */ ! public void setPixel(int x, int y, int[] iArray, DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, iArray[i], data); }
*** 1132,1142 **** * * @throws NullPointerException if fArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ ! public void setPixel(int x, int y, float fArray[], DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, fArray[i], data); } --- 1132,1142 ---- * * @throws NullPointerException if fArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ ! public void setPixel(int x, int y, float[] fArray, DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, fArray[i], data); }
*** 1151,1161 **** * * @throws NullPointerException if dArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ ! public void setPixel(int x, int y, double dArray[], DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, dArray[i], data); } --- 1151,1161 ---- * * @throws NullPointerException if dArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ ! public void setPixel(int x, int y, double[] dArray, DataBuffer data) { for (int i=0; i<numBands; i++) setSample(x, y, i, dArray[i], data); }
*** 1175,1185 **** * @throws NullPointerException if iArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! int iArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 1175,1185 ---- * @throws NullPointerException if iArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if iArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! int[] iArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 1213,1223 **** * @throws NullPointerException if fArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! float fArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width|| --- 1213,1223 ---- * @throws NullPointerException if fArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if fArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! float[] fArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width||
*** 1251,1261 **** * @throws NullPointerException if dArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! double dArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 1251,1261 ---- * @throws NullPointerException if dArray or data is null. * @throws ArrayIndexOutOfBoundsException if the coordinates are * not in bounds, or if dArray is too small to hold the input. */ public void setPixels(int x, int y, int w, int h, ! double[] dArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 1367,1377 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if iArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! int iArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 1367,1377 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if iArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! int[] iArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 1405,1415 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if fArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! float fArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width || --- 1405,1415 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if fArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! float[] fArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; if (x < 0 || x >= width || w > width || x1 < 0 || x1 > width ||
*** 1443,1453 **** * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if dArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! double dArray[], DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h; --- 1443,1453 ---- * @throws ArrayIndexOutOfBoundsException if the coordinates or * the band index are not in bounds, or if dArray is too small to * hold the input. */ public void setSamples(int x, int y, int w, int h, int b, ! double[] dArray, DataBuffer data) { int Offset=0; int x1 = x + w; int y1 = y + h;
*** 1481,1491 **** * SampleModel. * @param bands the subset of bands of this {@code SampleModel} * @return a {@code SampleModel} with a subset of bands of this * {@code SampleModel}. */ ! public abstract SampleModel createSubsetSampleModel(int bands[]); /** * Creates a DataBuffer that corresponds to this SampleModel. * The DataBuffer's width and height will match this SampleModel's. * @return a {@code DataBuffer} corresponding to this --- 1481,1491 ---- * SampleModel. * @param bands the subset of bands of this {@code SampleModel} * @return a {@code SampleModel} with a subset of bands of this * {@code SampleModel}. */ ! public abstract SampleModel createSubsetSampleModel(int[] bands); /** * Creates a DataBuffer that corresponds to this SampleModel. * The DataBuffer's width and height will match this SampleModel's. * @return a {@code DataBuffer} corresponding to this
< prev index next >