Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4169437

WritableRaster.setPixel(int,int,int,int,double[]) sets all

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • None
    • 2d
    • 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.


      ======================================================================

            jehung Jeannette Hung
            rramsunw Ranganathan Ram (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: