Java 2D Graphics Bilinear Transform Image type Frame
Java 2D Graphics Bilinear Transform Image type Frame Rate (fps) TYPE_INT_RGB 80 TYPE_INT_ARGB 72 TYPE_INT_ARGB_PRE 72 TYPE_3BYTE_BGR 82 TYPE_BYTE_GRAY 80 TYPE_USHORT_GRAY 80 TYPE_USHORT_555_RGB 79 TYPE_USHORT_565_RGB 79 x x TYPE_INT_RGB 37 x x TYPE_INT_ARGB 38 x x TYPE_INT_ARGB_PRE 26 x x TYPE_3BYTE_BGR 24 x x TYPE_BYTE_GRAY 10 x x TYPE_USHORT_GRAY 10 x x TYPE_USHORT_555_RGB 36 x x TYPE_USHORT_565_RGB 36 When you run ImageBouncer, you’ll probably notice the following: It’s expensive to transform the image. Animating the transformed image using bilinear interpolation runs at about 50% of the untransformed image frame rate. Bilinear interpolation yields nicer-looking transformed images, but it takes longer than the “nearest neighbor” algorithm. In this respect, it’s a lot like antialiasing for shapes and text: a trade-off of quality for speed. The rendering engine is optimized for some operations and not for others. For example, the TYPE_3BYTE_BGR image type performs best when the image is not transformed. But when the image is transformed, it’s a terrible performer. Subsequent releases of Java 2 should contain more optimizations. 14.3 Memory One aspect of performance tuning is making your application handle memory nicely. It’s very awkward for your support staff if the only answer they have for some problems is “buy more memory.” An ideal application doesn’t use much memory and doesn’t crash if it can’t get enough memory. In 2D applications, images are the biggest area of concern for memory usage. If your application does any image handling, including double-buffered drawing, you should probably be thinking about memory. 14.3.1 Images Any image in your application uses some memory. The formula is pretty simple: memoryUsed = width height bytesPerPixel This formula gives you a minimum size for the image. Of course, there’s some additional memory for the Image or BufferedImage object itself, but this is small compared to the raw image data. The actual memory used also depends on how the image data is stored. Suppose you had an image with a 16-color palette. Each pixel can be represented with four bits. An inefficient way to store this page 270
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Java Web Hosting services