Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Unknown Source x ConvolveOp
Unknown Source x ConvolveOp [message #122629] Mon, 11 February 2008 13:31 Go to next message
Eclipse User
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
Re: Unknown Source x ConvolveOp [message #123971 is a reply to message #122629] Mon, 25 February 2008 12:06 Go to previous message
Paul Slauenwhite is currently offline Paul Slauenwhite
Messages: 970
Registered: July 2009
Senior Member
I believe you have wrong newsgroup.

PS
"Tommaso" <agostinacchio@gmail.com> wrote in message
news:c304666b7fef642c8e22557ee544ba24$1@www.eclipse.org...
> 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:What is diffirence between TPTP Junit test and Junit test in Eclipse
Next Topic:TPTP 3.3.0 and in later versions
Goto Forum:
  


Current Time: Tue Sep 16 15:36:49 GMT 2014

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

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