-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.0
-
None
-
sparc
-
solaris_2.6
Name: rrT76497 Date: 08/27/98
WritableRaster r1 = WritableRaster.createWritableRaster(
new BandedSampleModel(DataBuffer.TYPE_INT,7,8,3),
new DataBufferShort(500,3),
new Point());
r1.setPixels(0,0,2,1,new int[] {3,3,3,2,2,2});
int[] pixGot = r1.getPixels(0,0,2,1,(int[])null);
for (int i=0;i<pixGot.length;i++){
System.out.println("pix="+pixGot[i]);
}
r1.setPixels(0,0,2,1,new double[] {3,3,3,2,2,2});
double[] pixGot = r1.getPixels(0,0,2,1,(double[])null);
for (int i=0;i<pixGot.length;i++){
System.out.println("pix="+pixGot[i]);
}
In the first loop where the pixel values are set as an int array, the
pixels got will be the same as the pixels set.
However when the pixel values are passed as a double array, all the
pixels are set to the first value in the double array.
======================================================================
- duplicates
-
JDK-4166532 SampleModel.setPixel(int,int,int,int,double[]) sets all pixels to same value.
-
- Closed
-