Also kleiner Benchmark mit der Darstellung bei mir:
128x128 Pixel von der GBCam, mit Faktor 2 in x- und y- Richtung skalieren.
Damit ich vernünftige Messwerte bekomme habe ich das Bild 100 mal zeichnen lassen. Ergebnis: 3.8ms/Bild, macht 263 Bilder/sek, auf einem Centrino 1.2GHz Laptop mit Mobility Radeon 9000. Auf dem alten Athlon muss ich den Benchmark erst noch machen, kommt dann als edit...
Also mir reicht das eigentlich an Geschwindigkeit und wenn mich meine mathematischen Kenntnisse nicht verlassen haben ist 263>18=true!
Hier ist noch der Auszug aus dem Code mit dem ich den Benchmark gemacht habe:
Code:
public static final int rows = 128;
public static final int columns = 128;
public static final float stretch = 2.0;
public int[][] image = new int[rows][columns];
protected void paintComponent( Graphics g )
{
Graphics2D g2 = (Graphics2D) g;
g.setColor( new Color( 0, 0, 0) );
g.fillRect(0, 0, getWidth(), getHeight()); // just to delete old stuff
g2.scale(stretch, stretch); //attach scaling transform to renderer
long start = System.currentTimeMillis();
// draw the image 100 times in order to get useful values for timing
for (int i = 0; i<100; i++)
{
for (int y = 0; y < _rows; y++)
{
for (int x = 0; x < _columns; x++)
{
// get the RGB value from the image array (where the data
// from the serial port has been written to.
img.setRGB(y, x, image[y][x]);
}
}
// render the image using only predefined affine transforms
// (no additional tranform or filtering required
g2.drawImage(img, null, 0, 0);
}
double used = System.currentTimeMillis() - start;
System.out.println("used " + used + " ms");
}
Um es also mal zusammen zu fassen:
1. Aussage: "javacomm geht nicht, macht fehler, ..." Das haben wir ja mittlerweile widerlegt
2. Aussage: "java ist zu langsam in der Bilddarstellung und schafft keine 18 fps - Nun ja für 128x128 Pixel die noch dazu in x und y Richtung skaliert werden, stimmt das schon mal nicht.
Vielleicht bekomme ich ja jetzt einen pluspunkt. Ich bebe vor freudiger Erwartung 
BTW, Atmel bringt mit dem AVR32 einen Kern, der direkt Java Bytecode ausführen kann.
Lesezeichen