Hi Rick,

The OSG adopts OpenGL conventions, for better or for worse.  In texturing
OpenGL goes s,t,r for the axis of a texture. For a 512x256 2D texture s=512,
t=256, r = 1, for a 256x256x256 3D texture, s=256, t=256, r=256.

On 5/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hello All,

I am really weak in the area of osg::Images.  I have looked at the code
quite a bit, but it is still confusing to me.  I imagine that osg::Image is
wrapping up some underlying bitmap or OpenGL image functionality.  Is there
some reference someone could point me to that could educate me on the
subject?

What I am trying to do is create a new image that has the color values
from one image and give it the alpha value from another image, I figured the
best way to do that was create a new bgra (rgba?) image to hold the new
value.  So specifically, I am wondering about:

a) How to access the pixel values of grey-scale and indexed images if my
source images are such

b) What is the r(), depth value for?  Is it the number of bits per pixel?
e.g. Should the r value for a bgra image be 4?  I was thinking that, but
if it were that simple, why would it be a parameter at all, since
allocateImage could determine that from the GL_BGRA part.  is this correct?:


osg::ref_ptr<osg::Image> newImage =
new osg::Image();

newImage->allocateImage(s, t, 4, GL_BGRA, GL_UNSIGNED_BYTE);

c) What is the packing for (the sixth [default] parameter)?  Should I
allocate my new image with packing or is that going to make it harder to
work with?

d) Am I just going about this all the wrong way?  Perhaps it would be
better to reformat the image somehow to give it an alpha channel if it is
not already there?



Thank you so much for the great community

-- Rick



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to