< prev index next >

src/java.desktop/share/classes/java/awt/image/MultiPixelPackedSampleModel.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2014, 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
*** 227,237 **** /** * Returns the number of bits per sample for all bands. * @return the number of bits per sample. */ public int[] getSampleSize() { ! int sampleSize[] = {pixelBitStride}; return sampleSize; } /** * Returns the number of bits per sample for the specified band. --- 227,237 ---- /** * Returns the number of bits per sample for all bands. * @return the number of bits per sample. */ public int[] getSampleSize() { ! int[] sampleSize = {pixelBitStride}; return sampleSize; } /** * Returns the number of bits per sample for the specified band.
*** 324,334 **** * @exception RasterFormatException if the number of bands requested * is not one. * @throws IllegalArgumentException if {@code w} or * {@code h} is not greater than 0 */ ! public SampleModel createSubsetSampleModel(int bands[]) { if (bands != null) { if (bands.length != 1) throw new RasterFormatException("MultiPixelPackedSampleModel has " + "only one band."); } --- 324,334 ---- * @exception RasterFormatException if the number of bands requested * is not one. * @throws IllegalArgumentException if {@code w} or * {@code h} is not greater than 0 */ ! public SampleModel createSubsetSampleModel(int[] bands) { if (bands != null) { if (bands.length != 1) throw new RasterFormatException("MultiPixelPackedSampleModel has " + "only one band."); }
*** 528,543 **** * @return an array containing the specified pixel. * @exception ArrayIndexOutOfBoundsException if the coordinates * are not in bounds * @see #setPixel(int, int, int[], DataBuffer) */ ! public int[] getPixel(int x, int y, int iArray[], DataBuffer data) { if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) { throw new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!"); } ! int pixels[]; if (iArray != null) { pixels = iArray; } else { pixels = new int [numBands]; } --- 528,543 ---- * @return an array containing the specified pixel. * @exception ArrayIndexOutOfBoundsException if the coordinates * are not in bounds * @see #setPixel(int, int, int[], DataBuffer) */ ! public int[] getPixel(int x, int y, int[] iArray, DataBuffer data) { if ((x < 0) || (y < 0) || (x >= width) || (y >= height)) { throw new ArrayIndexOutOfBoundsException ("Coordinate out of bounds!"); } ! int[] pixels; if (iArray != null) { pixels = iArray; } else { pixels = new int [numBands]; }
< prev index next >