Re: [JAVA2D] Area's "constructive area geometry"

2006-11-29 Thread Jim Graham

Currently the only mechanism to get access to these sources is via the
Peabody project:

   http://java.sun.com/developer/technicalArticles/J2SE/peabody/

You will have to sign a contributor agreement to see the source code as
is described on that page.

The code was developed completely in house based on standard principles
of dealing with curve and line geometry (i.e. curve subdivision, bezier
bounding boxes and convex hulls, etc.).  You can google for "bezier
curve intersection" to find a number of academic papers on algorithms...

   ...jim

Brien Colwell wrote:

hi All,

Does anyone know how to obtain the sources to the AreaOp classes? I'm
curious to see how its "Constructive Area Geometry" is implemented -- I
guess just seeing the add op will illuminate a lot. Also, does anyone
know if this is a proprietary Sun technology or based on some known
comp. geom. work? I find it very cool!

Brien


===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


Re: [JAVA2D] Simple Alphablending of 2 Images

2006-11-29 Thread java2d
@Chris Campbell

Hi Chris,

thanks for your quick reply. This technique works great! I will test if the 
performance is adequate.

K4simir
[Message sent by forum member 'k4simir' (k4simir)]

http://forums.java.net/jive/thread.jspa?messageID=180427

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


Re: [JAVA2D] Simple Alphablending of 2 Images

2006-11-29 Thread java2d
Hi alex,

Thanks for your reply. I just tried to your TabbedPaneAnimationDemo... but 
unfortunately i wasn't able to start it. I got an 
"java.lang.UnsupportedClassVersionError: Bad version number in .class file" 
Error. What version of the java compiler did you use to compile the classes? I 
have JRE v1.5.0_3 installed.

But ... your blog and Project JXLayer sounds really interesting :)
[Message sent by forum member 'k4simir' (k4simir)]

http://forums.java.net/jive/thread.jspa?messageID=180422

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


Re: [JAVA2D] Simple Alphablending of 2 Images

2006-11-29 Thread Chris Campbell

Hello,

Are you trying to blend the images in a Swing window, for example?
Either way, AlphaComposite is your friend.  The basic approach looks
like this:

float alpha = 0f;

public void paintComponent(Graphics g) {
Graphics2D g2 = (Graphics2D)g;
Composite oldcomp = g2.getComposite();
   // draw first image fully opaque
g2.drawImage(img1, 0, 0, null);
// change opacity of second image after each call to repaint()
g2.setComposite(AlphaComposite.getInstance(SRC_OVER, alpha));
g2.drawImage(img2, 0, 0, null);
g2.setComposite(oldcomp);
}

while (!done) {
alpha += 0.1;
repaint();
...
}

Chris

On Nov 29, 2006, at 3:54 AM, [EMAIL PROTECTED] wrote:

Hi all,

I've searched the web for 3 hours now, without a result. Is there a
simple and PERFORMANT way to blend two images (BufferedImages) in/
over each other? I want to build up an alphablending-animation,
which smoothly blends the old image out (alpha from 255 to 0) while
the new is blended in (alpha from 0 to 255) ...

i found several alphablending algorithms but nowhere a simple
example in java.

1. my first idea is to create dynamically a kind of result image.
each pixel (color) of the result image is calculated via a simple
equation. the problem is: i need the color palette as byte array ...

2. another idea is to render both images separately with an
AlphaComposite. then the 2 resulting images have to be merged into
one result images (addition).

could anybody help me with a link or an example in java? are any
other solutions for this common problem?

thanks a lot.
K4simir
[Message sent by forum member 'k4simir' (k4simir)]

http://forums.java.net/jive/thread.jspa?messageID=180212

==
=
To unsubscribe, send email to [EMAIL PROTECTED] and include in
the body
of the message "signoff JAVA2D-INTEREST".  For general help, send
email to
[EMAIL PROTECTED] and include in the body of the message "help".


===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


Re: [JAVA2D] Simple Alphablending of 2 Images

2006-11-29 Thread java2d
Hello K4simir

There is something you might be interested in on Swing side
Please check the JXLayer from https://swinghelper.dev.java.net/

Download and extract layer-bin.zip
and run
java -cp layer.jar;layer-demo.jar 
org.jdesktop.swinghelper.layer.demo.TabbedPaneAnimationDemo

Switch tabs back and forth, is it something you are looking for ?

I am currently blogging about JXLayer
http://weblogs.java.net/blog/alexfromsun/

my next blog will describe TabbedPaneAnimationDemo as well

Thanks
alexp
[Message sent by forum member 'alexfromsun' (alexfromsun)]

http://forums.java.net/jive/thread.jspa?messageID=180325

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".


[JAVA2D] Simple Alphablending of 2 Images

2006-11-29 Thread java2d
Hi all,

I've searched the web for 3 hours now, without a result. Is there a simple and 
PERFORMANT way to blend two images (BufferedImages) in/over each other? I want 
to build up an alphablending-animation, which smoothly blends the old image out 
(alpha from 255 to 0) while the new is blended in (alpha from 0 to 255) ...

i found several alphablending algorithms but nowhere a simple example in java.

1. my first idea is to create dynamically a kind of result image. each pixel 
(color) of the result image is calculated via a simple equation. the problem 
is: i need the color palette as byte array ...

2. another idea is to render both images separately with an AlphaComposite. 
then the 2 resulting images have to be merged into one result images (addition).

could anybody help me with a link or an example in java? are any other 
solutions for this common problem?

thanks a lot.
K4simir
[Message sent by forum member 'k4simir' (k4simir)]

http://forums.java.net/jive/thread.jspa?messageID=180212

===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".