Unknown Source x ConvolveOp [message #122629] |
Mon, 11 February 2008 13:31 |
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 |
Paul Slauenwhite Messages: 975 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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05153 seconds