I don't know that much in Java3D but in the point of view of image processing i would suggest that, if you don't need to keep the images after but need to get it one by one, you should create 1 (Buffered)image once for all.
Each time you collect the canvas3D in the case you showed, you create a new image and this is really time consuming. You should re-use the same one after having done what you needed (recording it to a stream or displaying it...)
Auguste
tiagoscalheiros wrote:
Hi,
I have rewrited the postswap() of a canvas 3d to collect a bufferedImage of the scenario and then sent it to another aplication.
The program is working but im having a problem with the performance: I discovered that the method readRaster(Raster r) from graphicsContext3d takes 200ms in Suse Linux 1,8Ghz to retrieve the raster image and that is to slow for the application.
I would like to know if someone knows why these method is so slow, if i cann make it faster or if someone knows a better and fast way to get a bufferedImage of one canvas 3d?
public void postSwap() { GraphicsContext3D ctx = getGraphicsContext3D();
Rectangle rect = this.getBounds();
BufferedImage img = new BufferedImage (rect.width,rect.height,
BufferedImage.TYPE_INT_RGB);
ImageComponent2D comp = new ImageComponent2D(ImageComponent.FORMAT_RGB, img, true, false);
Raster ras = new Raster(new Point3f(-1.0f,-1.0f,- 1.0f), Raster.RASTER_COLOR, 0, 0, rect.width, rect.height, comp, null);
ctx.readRaster(ras);
// Now strip out the image info
BufferedImage output_img = ras.getImage().getImage();
SendImage(output_img);
}
--- Acabe com aquelas janelinhas que pulam na sua tela. AntiPop-up UOL - É grátis! http://antipopup.uol.com.br
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
-- A. Genovesio Quantitative Image Analysis Group Institut Pasteur 25, rue du Docteur Roux 75724 Paris Cedex 15
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".