Community
Participate
Working Groups
Currently ImageData equals comparison is based Object's reference based. We need to implement equals method, which should perform actual state comparison of ImageData. Expected API: ImageData.equals() implementation.
New Gerrit change created: https://git.eclipse.org/r/63259
(In reply to Eclipse Genie from comment #1) > New Gerrit change created: https://git.eclipse.org/r/63259 Above ImageData#equals() logic leverages PaletteData meta-data information, to cover below compare scenario: e.g. For PNG Image format, the ImageData#data information is sometimes stored as RGB or BGR color byte order. Consider a 2px width by 2px height PNG image, which can have below color order R(1x1)G(1x1)B(1x1) R(1x2)G(1x2)B(1x2) A(1x1)A(1x2) R(2x1)G(2x1)B(2x1) R(2x2)G(2x2)B(2x2) A(2x1)A(2x2) or B(1x1)G(1x1)R(1x1) B(1x2)G(1x2)R(1x2) A(1x1)A(1x2) B(2x1)G(2x1)R(2x1) B(2x2)G(2x2)R(2x2) A(2x1)A(2x2) Now whether it's a RGB or BGR order, this meta information is present in ImageData#PaletteData's RGB's mask/shift fields. So using this information we can adjust the comparison of ImageData#data field and proceed with ImageData compare. Also note ImageData#type information specified the image format(png/bmp/jpg/gif) and sometimes it's UN-specified, hence it is ignored in ImageData equals compare.
(In reply to Niraj Modi from comment #2) > (In reply to Eclipse Genie from comment #1) > > New Gerrit change created: https://git.eclipse.org/r/63259 Above patch works for Windows only. On Linux the behavior varies for GTK2 and GTK3. But for .gif format (IIRC as it was tested sometime back) the internal ImageData/PaletteData representation varies and PaletteData.isDirect true vs false cannot be compared. Right now we don't have an immediate use-case for this.
(In reply to Niraj Modi from comment #3) > (In reply to Niraj Modi from comment #2) > > (In reply to Eclipse Genie from comment #1) > > > New Gerrit change created: https://git.eclipse.org/r/63259 > > Above patch works for Windows only. > On Linux the behavior varies for GTK2 and GTK3. > But for .gif format (IIRC as it was tested sometime back) the internal > ImageData/PaletteData representation varies and PaletteData.isDirect true vs > false cannot be compared. > > Right now we don't have an immediate use-case for this. I think it would be ok for this to work only on Gtk3. We don't care about adding new features on Gtk2. If this works well on gtk3, we should consider merging. I would be happy to test on Gtk3. CCing Eric, as he's been working on Colors.