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

SampleModel.setPixel(int,int,int,int,double[]) sets all pixels to same value.

    XMLWordPrintable

Details

    • 2d
    • 1.2fcs
    • sparc
    • solaris_2.6
    • Not verified

    Description



      Name: diC59631 Date: 08/14/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.
      (Review ID: 37017)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              jehung Jeannette Hung
              dindrigo Daniel Indrigo (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: