< prev index next >

src/java.desktop/share/classes/java/awt/image/RescaleOp.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
*** 142,152 **** * will be allocated. * @param scaleFactors the array to contain the scale factors of * this {@code RescaleOp} * @return the scale factors of this {@code RescaleOp}. */ ! public final float[] getScaleFactors (float scaleFactors[]) { if (scaleFactors == null) { return this.scaleFactors.clone(); } System.arraycopy (this.scaleFactors, 0, scaleFactors, 0, Math.min(this.scaleFactors.length, --- 142,152 ---- * will be allocated. * @param scaleFactors the array to contain the scale factors of * this {@code RescaleOp} * @return the scale factors of this {@code RescaleOp}. */ ! public final float[] getScaleFactors (float[] scaleFactors) { if (scaleFactors == null) { return this.scaleFactors.clone(); } System.arraycopy (this.scaleFactors, 0, scaleFactors, 0, Math.min(this.scaleFactors.length,
*** 160,170 **** * will be allocated. * @param offsets the array to contain the offsets of * this {@code RescaleOp} * @return the offsets of this {@code RescaleOp}. */ ! public final float[] getOffsets(float offsets[]) { if (offsets == null) { return this.offsets.clone(); } System.arraycopy (this.offsets, 0, offsets, 0, --- 160,170 ---- * will be allocated. * @param offsets the array to contain the offsets of * this {@code RescaleOp} * @return the offsets of this {@code RescaleOp}. */ ! public final float[] getOffsets(float[] offsets) { if (offsets == null) { return this.offsets.clone(); } System.arraycopy (this.offsets, 0, offsets, 0,
*** 188,199 **** * The table may have either a SHORT or BYTE input. * @param nElems Number of elements the table is to have. * This will generally be 256 for byte and * 65536 for short. */ ! private ByteLookupTable createByteLut(float scale[], ! float off[], int nBands, int nElems) { byte[][] lutData = new byte[nBands][nElems]; int band; --- 188,199 ---- * The table may have either a SHORT or BYTE input. * @param nElems Number of elements the table is to have. * This will generally be 256 for byte and * 65536 for short. */ ! private ByteLookupTable createByteLut(float[] scale, ! float[] off, int nBands, int nElems) { byte[][] lutData = new byte[nBands][nElems]; int band;
*** 235,246 **** * The table may have either a SHORT or BYTE input. * @param nElems Number of elements the table is to have. * This will generally be 256 for byte and * 65536 for short. */ ! private ShortLookupTable createShortLut(float scale[], ! float off[], int nBands, int nElems) { short[][] lutData = new short[nBands][nElems]; int band = 0; --- 235,246 ---- * The table may have either a SHORT or BYTE input. * @param nElems Number of elements the table is to have. * This will generally be 256 for byte and * 65536 for short. */ ! private ShortLookupTable createShortLut(float[] scale, ! float[] off, int nBands, int nElems) { short[][] lutData = new short[nBands][nElems]; int band = 0;
*** 560,571 **** // Determine bits per band to determine maxval for clamps. // The min is assumed to be zero. // REMIND: This must change if we ever support signed data types. // int nbits; ! int dstMax[] = new int[numBands]; ! int dstMask[] = new int[numBands]; SampleModel dstSM = dst.getSampleModel(); for (int z=0; z<numBands; z++) { nbits = dstSM.getSampleSize(z); dstMax[z] = (1 << nbits) - 1; dstMask[z] = ~(dstMax[z]); --- 560,571 ---- // Determine bits per band to determine maxval for clamps. // The min is assumed to be zero. // REMIND: This must change if we ever support signed data types. // int nbits; ! int[] dstMax = new int[numBands]; ! int[] dstMask = new int[numBands]; SampleModel dstSM = dst.getSampleModel(); for (int z=0; z<numBands; z++) { nbits = dstSM.getSampleSize(z); dstMax[z] = (1 << nbits) - 1; dstMask[z] = ~(dstMax[z]);
< prev index next >