Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Unknown Source x ConvolveOp
Unknown Source x ConvolveOp [message #104951] Mon, 11 February 2008 13:28
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:zipFile.getEntry(path) returns null
Next Topic:Declarative Services - where to get an implementation
Goto Forum:
  


Current Time: Tue Nov 25 22:24:52 GMT 2014

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

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