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

SWTFXUtils#fromFXImage() broken

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 7u6
    • Component/s: javafx
    • Labels:

      Description

      SWTFXUtils#fromFXImage() no longer works

      This is due to a change in PixelReader#getPixels() when the pixel format is getByteBgraInstance() (maybe others)

      In the pixel byte array written by getPixels the color information used to be in this order:
      offset + 0 = alpha = 0xFF000000
      offset + 1 = red = 0x00FF0000
      offset + 2 = green = 0x0000FF00
      offset + 3 = blue = 0x000000FF

      SWT Palette = 0xFF0000, 0xFF00, 0xFF = redMask, greenMask, blueMask

      Now:

      offset + 0 = blue = 0xFF000000
      offset + 1 = green = 0x00FF0000
      offset + 2 = red = 0x0000FF00
      offset + 3 = alpha = 0x000000FF

      SWT Palette = 0xFF00, 0xFF0000, 0xFF000000

      I see that PixelReader#getPixels() and PixelWriter#setPixels() are consistent (the output of the first can be used as input for the second).
      Thus, I suppose getPixel() had a bug in the past, which I "worked around" in the converter by using the wrong palette, and now that the bug is fixed the converter is broken.



       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                fheidric Felipe Heidrich (Inactive)
                Reporter:
                fheidric Felipe Heidrich (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: