Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Unknown Source x ConvolveOp
Unknown Source x ConvolveOp [message #241416] Mon, 11 February 2008 13:30
Eclipse UserFriend
Originally posted by: agostinacchio.gmail.com

Hi all!

I found and try to adapt this code:

public final float[] BLUR3x3 = {
0.1f, 0.1f, 0.1f, // low-pass filter kernel
0.1f, 0.2f, 0.1f,
0.1f, 0.1f, 0.1f
};
This is a class i write to performe a blur proceccing to the loades image:

public void Blur_actionPerformed(ActionEvent e)
{
float[] data = BLUR3x3;
if (g_rast != null)
{
Graphics2D l_g2 = (Graphics2D) image.getGraphics();
ConvolveOp cop = new ConvolveOp(new Kernel(3, 3, data));
l_g2.drawImage(image.image2, cop, 0, 0);
image.repaint();
}
}

and ImageClass image;
BufferedImage image2;
ImageClass is a file that extends Component and declares BufferedImage
image2;

<b>I have this problem<b>: when I run my program I see these messages:

Exception in thread "AWT-EventQueue-0" java.awt.image.ImagingOpException:
Unable to convolve src image
at java.awt.image.ConvolveOp.filter(Unknown Source)
at sun.java2d.d3d.D3DDrawImage.transformImage(Unknown Source)
at sun.java2d.pipe.ValidatePipe.transformImage(Unknown Source)
at sun.java2d.SunGraphics2D.drawImage(Unknown Source)
at nuovo.Frame1.Blur_actionPerformed(Frame1.java:183)
at nuovo.Frame1_Blur_actionAdapter.actionPerformed(Frame1.java: 413)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unk nown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Can anyone help me, please?

Tom
Previous Topic:[Announce] GEF 3.4.0 I200802062130 is available
Next Topic:[Announce] GEF 3.4.0M5 is available
Goto Forum:
  


Current Time: Sat Dec 21 17:19:29 GMT 2024

Powered by FUDForum. Page generated in 0.02808 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top