Hi Carsten,
thanks for the hint.
But could not manage to identify which is greyscale or not.
I read an greyscale image and then checkig with the following condition if
it is a grey-scale image or not.
if(tga->getPixelFormat() != Image::OSG_L_PF)
{
cout << "not a geryscale image......conversion necessary" << endl;
}
Even after i am reading a greyscale image the condition becomes true.
What am i missing?
Cheers
Sajjad
On Sat, Aug 9, 2008 at 12:00 AM, Carsten Neumann <[EMAIL PROTECTED]>wrote:
> Hello Sajjadul,
>
> Sajjadul Islam wrote:
> > Hello,
> >
> > I am trying to generate height map terrain by reading a tga file.
>
> you might want to take a look at the code in Source/Contrib/Terrain (by
> default it is not compiled into the library though - see
> Source/Contrib/README).
>
> > Is there any function within Image class to detect if the image read
> > is RGB image or greyscale
>
> Image::getPixelformat() returns the format of the data stored in the
> image (see Source/System/Image/OSGImage.h for possible values). For a
> greyscale image it would be OSG_L_PF, for RGB OSG_RGB_PF and for RGBA
> OSG_RGBA_PF.
>
> > and if it is an RGB is there any functionality
> > to convert that to greyscale image?
>
> You can use Image::reformat to convert to a different pixel format; it
> will do a pretty simple conversion, nothing fancy.
>
> Hope it helps,
> Carsten
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users