Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, April 28, 2008 4:47:56 AM(UTC)

Aniru  
Aniru

Groups: Registered
Posts: 4


I am a newbie. I am trying to use lead tools. I have 2 queries.

I am loading an image (jpg or tiff) using following function,

I]
FILEINFO l_FileInfoObj;
l_FileInfoObj.uStructSize = sizeof(FILEINFO);
l_nRet = L_FileInfo ( rFilePath.GetBuffer(255), &l_FileInfoObj, sizeof(FILEINFO), 0, NULL);
rFilePath.ReleaseBuffer();

I get the following attributes Format, Width, Height, BitsPerPixel etc (all the values of FILEINFO).

How can i know the colorspace of the pixels (GREY, RGB or YCBCR)
FILEINFO has last parameter as ColorSpace but it return 1 for both grey and colored images?

II]
How to get Number of bands of data of an image,
for example, 1 (one) for grayscale, 3 for RGB data. I know that all bands contain the same type of data. An image can have from 1 (one) to 4 (D_MAX_BANDS) bands.


I am using Lead Tools version 15.0, Medical express edition.

Any suggestion is welcome

Regards,
Aniruddha
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, April 28, 2008 8:56:06 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 367

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

The possible values for the ColorSpace property are listed in the documentation which can be found at http://www.leadtools.com...API/Dlldtyp/FILEINFO.htm

You are correct in that 1 can be returned for both grey and colored images. To find out if an image is grey or colored, check out the Order property in FileInfo.

Could you explain what you mean by bands of data?
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Tuesday, April 29, 2008 1:55:49 AM(UTC)

Aniru  
Aniru

Groups: Registered
Posts: 4


Hi Walter,
thanks for the reply but its not helpful :-(
First as stated above the colorspace property is not usefull.
and the Order property in FileInfo doesnt help too. It gives the same value for both color and grey images. I tested this on the test images provided with lead tools software.

Regards,
Aniruddha
 
#4 Posted : Thursday, May 1, 2008 11:53:40 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 367

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

After doing some more digging, it appears that an image has to be either 12- or 16-bits in order for the Order property to come back as ORDER_GRAY. Anything less than 16-bits is palettized and are unordered. I found this in the following help file: http://www.leadtools.com.../Dllref/L_LoadBitmap.htm

Other than that, it is possible to manually check colors in a palette to determine if an image is in grayscale. This process is somewhat complicated though.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.047 seconds.