views:

83

answers:

3

I was wondering if there are any implementations of java.awt.Image out there other than the ones provided by the Java standard edition. Any third party classes maybe that provide any useful features overlooked by Sun?

A: 

I know that for a project I was working on, I implemented image to paint a specific set of icons dynamically based on other information that was going on. However, I have never had any other reason to look outside of the standard sun image implementations for other implementations. The only thing I could think of would be to support a format that Sun does not support, and I have not needed to do that.

aperkins
A: 

I found one used by JHotDraw

org.jhotdraw.contrib.zoom.DoubleBufferImage

Savvas Dalkitsis
+1  A: 

The Java Advanced Imaging (JAI) library subclasses Image to allow for filter-chain processing of images, tile-by-tile image processing, and some other fancy features. JAI is not part of the standard library, but it IS a Sun product.

I believe that some of the media-playing libraries subclass the Image class.

From what I've seen, most libraries use the standard BufferedImage and Java2D interfaces/classes, but define their own way to read/write/generate/process an image. They'll pass around image data as primitive arrays often.

The reason: The Image class isn't a great candidate for extension. It's got a lot of random methods and fields that don't make sense for most things (acceleration priority, getScaledInstance method, ImageCapabilities... the list goes on). It makes much more sense to write an ImageProducer/ImageConsumer for things that convert to images. For an editable slab of pixels, it makes sense to work with Graphics/Graphics2D implementations.

BobMcGee