Need help for functionalities like Brightness and Contrast

Which package to use for getting image transformation functionalities like Brightness and Contrast?

Description:

Currently I am using 揝un Java?Wireless Toolkit 2.5 for CLDC, Beta 2 ?toolkit for developing J2ME applications. I need to add effects like Brightness and Contrast to an image(JPEG ,PNG, etc). For this I am using the 搄avax.microedition.amms.control.imageeffect?package (JSR 234). In this package I found that I need to use the ImageTonalityControl to set various image settings such as brightness, contrast and gamma. But if I use this control using the following code fragment,

private MediaProcessor mp;

mp = GlobalManager.createMediaProcessor("image/jpeg");

mp.addMediaProcessorListener(this);

outputStream = new ByteArrayOutputStream();

inputStream = getClass().getResourceAsStream("/images/lenna.jpg");

mp.setInput(inputStream, MediaProcessor.UNKNOWN);

mp.setOutput(outputStream);

itc = (ImageTonalityControl)mp.getControl ("javax.microedition.amms.control.imageeffect.ImageTonalityControl");

I get a Null Pointer Exception. Using the above code snippet I am not able to create the ImageTonalityControl object. If I proceed further with that itc reference I get a Null Pointer Exception. I think ImageTonalityControl is not supported by this toolkit. Is it so? Are there any other toolkits with full JSR 234 support. Are there anyother API for obtaining this functionality?

[1462 byte] By [perisen2ka] at [2007-11-14]