Hi,

Akilan Thangamani wrote:
Thanks.

Yes. I m using osg::Image to set my pixel buffer.   I set GL_LUMINANCE as 
internal pixel format. But I m getting only black image. My code looks like 
this,


..
unsigned char* data;
int width, height;
width=4200; //source_image width
height=4710;//source_image height long size = width * height; data = new unsigned char[size];

Hmm, does your card support >4K textures? Maybe start with something smaller with known/generated data just to see if it works.


//Reading Image of width * height into buffer

....

for(i=0;i<(width * height); i++)

        data[i]=source_image[i]);



....

....



//Setting image osg::ref_ptr<osg::Image> image = new osg::Image; image->allocateImage(width, height, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE);

you don't need allocateImage, you are allocating data yourself.


image->setOrigin(osg::Image::BOTTOM_LEFT);

not sure why you want this, just flip the texture coordinates later.


image->setImage(width, height, 1, GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE,data, osg::Image::NO_DELETE); texture->setImage(image);
....

My another question is, could it possible to display image without scaling 
down/up?

What scaling are you talking about? Maybe do texture->setResizeNonPowerOfTwoHint(false);

How are you applying the texture?

jp



Thanks

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=25509#25509





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to