Hi, all:
I'm wondering how I can obtain the number of channels for a loaded image, using SWT technology.
Let's have a look at the following website first.
By using
[code]
ImageData ideaImageData = new ImageData(
getClass().getResourceAsStream("Idea.jpg"));[/code]
we loaded an image and stored in [code]ImageData ideaImageDat[/code]
In Eclipse' documentation at
[url="" href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/overview-summary.html">http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/overview-summary.html]
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/reference/api/overview-summary.html[/url]
Nothing can be found to tell "number of image channels", in the class "ImageData".
What I would like to find is something like a function getNbOfChannels();
If the loaded image "idea.jpg" is a color image, then, the function returns 3
If it is a gray image, then, the function returns 1.
Can anybody help to give me a hand ?
Cheers
JIA Pei