Anyone knows how many colour does osg support?  I would like to generate 65536 
colour map by using the code below.  The size of the object colorMap is 65535.  
Is it possible?  I am sure osg can support 8 bit colour, how about 32bit?  
Thanks.

        osg::TransferFunction1D::ColorMap colorMap;

        double fcr = 255.0;
        int ri, gi, bi, ai, cc;
        int step = 16;
        int rgb_step = fcr /(step-1);
        int a_step = (fcr +1) / step;

        cc = 0;
        colorMap[0] = osg::Vec4(0.0f, 0.0f, 0.0f, 0.0f);
        for (int r=0; r<step; r++) {
                ri = r*rgb_step;
                for (int g=0; g<step; g++) {
                        gi = g*rgb_step;
                        for (int b=0; b<step; b++) {
                                bi = b*rgb_step;
                                for (int a=1; a<=step; a++) {
                                        ai = min(a*a_step, fcr );
                                        cc++;
                                        colorMap[cc] = osg::Vec4(ri/fcr, 
gi/fcr, bi/fcr, ai/fcr);
                                }
                        }
                }
        }
        tf->assign(colorMap);


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

Reply via email to