11 messages in net.java.dev.jna.usersRe: [jna-users] Re: shaped windows us...
FromSent OnAttachments
Timothy WallMay 24, 2007 7:12 am 
Christopher DeckersMay 29, 2007 2:21 am 
Christopher DeckersMay 29, 2007 3:29 am 
Wayne MeissnerMay 29, 2007 3:53 am 
Christopher DeckersMay 29, 2007 7:10 am 
Wayne MeissnerMay 29, 2007 7:43 am 
Timothy WallMay 29, 2007 11:04 am 
Olivier ChafikMay 29, 2007 6:19 pm 
Christopher DeckersMay 29, 2007 11:56 pm 
Timothy WallMay 30, 2007 5:19 am 
Christopher DeckersMay 30, 2007 6:10 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: shaped windows using images - performanceActions...
From:Olivier Chafik (ocha@free.fr)
Date:May 29, 2007 6:19:38 pm
List:net.java.dev.jna.users

Hi Christopher,

Thanks a lot for your feedback, I'm glad to see this code helps...

I looked at what Oliver provided to improve the speed, and it did not work. I investigated and I found that I had to tweak the image I used as a mask for it to work.

Oops... I had tested images with only transparent black & solid white in them... Felt like the code worked, but it was by chance : the only pixels considered transparent were those with zero ARGB pixel value (zero alpha AND pure black color). Thanks for pointing this out...

It would be good (...) that it takes care internally of this color issue, so that user code would not have to fiddle with it.

I changed RasterRangesUtils a bit : it now has an outputOccupiedRanges method that outputs occupied pixels : - in an image with alpha layer, occupied means "alpha not null". - in an image without alpha layer, occupied means "not completely black".

I also took a little more care in reusing the raster's backing array. The updated code is still at the same location :

http://ochafik.free.fr/Java/src/jna/

It would be good to have this fast algorithm to be in the official version

This matter has been mentioned once and Timothy pointed out that it was better to keep the examples clean and simple. I proposed to create a package com.sun.jna.awt for windowing-related stuff, but I am unsure whether this is a good idea... Maybe it would be better to create a separate jar jna-extras.jar with code samples that are expected to be more complete and performant than simple examples.

Please tell me if this new code works for you (I did very little testing), and... have fun !

Cheers