Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Re: ImageData / Image problem

Laurent, if you feel these are genuine bugs, I recommend filing bugzillas too.

Bonus points if you mention 'Klipper' in the bug report ;)

On Thu, Jul 24, 2008 at 9:30 AM, L. Mihalkovic <totolaricot@xxxxxxx> wrote:
L. Mihalkovic wrote:

noticed the following minor issue with Image.java in Carbon (others to?):

Image.getImageData() {
   if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);

   int width = OS.CGImageGetWidth(handle);
   int height = OS.CGImageGetHeight(handle);
   int bpr = OS.CGImageGetBytesPerRow(handle);
   int bpp = OS.CGImageGetBitsPerPixel(handle);      int dataSize = height * bpr;
   byte[] srcData = new byte[dataSize];
   OS.memmove(srcData, data, dataSize);
       PaletteData palette = new PaletteData(0xFF0000, 0xFF00, 0xFF);
   ImageData data = "" ImageData(width, height, bpp, palette);
   data.data = ""> ....
}


new ImageData(width, height, bpp, palette) {
... ImageData(...)
.... setAllFields(
      .....
      data != null ? data : new byte[bytesPerLine * height],
      .....
     );
 }
}

Image buffer gets allocated twice for no reason.



same problem in the gtk & motif code, but not in Win32. don't have time to check the rest. I can't imagine it helps performance when dealing with large numbers or larger images.

--
Laurent Mihalkovic, co-author SWT/JFace in Action (www.manning.com/scarpino)

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



--
Cheers,

~ Chris Aniszczyk

Back to the top