David _ wrote:
Hi

i´ve created an osg::image and i want to call the method allocateImage to allocate memory for the image data

void allocateImage <http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01233.html#a12> (int s, int t, int r, GLenum pixelFormat, GLenum type, int packing=1)

my problem is that i can´t find a list of valid GLenum pixelFormat values and the same for GLenum type

in the osg::image header file i can see this macros declared at the beginning
These are just copies of the ones defined by the OpenGL headers.

#define GL_BGR                          0x80E0
#define GL_BGRA                         0x80E1
#define GL_UNSIGNED_BYTE_3_3_2          0x8032
#define GL_UNSIGNED_BYTE_2_3_3_REV      0x8362
#define GL_UNSIGNED_SHORT_5_6_5         0x8363
#define GL_UNSIGNED_SHORT_5_6_5_REV     0x8364
#define GL_UNSIGNED_SHORT_4_4_4_4       0x8033
#define GL_UNSIGNED_SHORT_4_4_4_4_REV   0x8365
#define GL_UNSIGNED_SHORT_5_5_5_1       0x8034
#define GL_UNSIGNED_SHORT_1_5_5_5_REV   0x8366
#define GL_UNSIGNED_INT_8_8_8_8         0x8035
#define GL_UNSIGNED_INT_8_8_8_8_REV     0x8367
#define GL_UNSIGNED_INT_10_10_10_2      0x8036
#define GL_UNSIGNED_INT_2_10_10_10_REV  0x8368

i want to create RGBA, RGB and Alpha (1byte per pixel) images and don´t know which parameters to use

i guess that the pixel format is GL_BGR and GL_BGRA for the first two ones, but no idea of how to declare a just alpha image

what is the GLenum type parameter???
From my /usr/include/GL/gl.h

/* PixelFormat */
#define GL_COLOR_INDEX                    0x1900
#define GL_STENCIL_INDEX                  0x1901
#define GL_DEPTH_COMPONENT                0x1902
#define GL_RED                            0x1903
#define GL_GREEN                          0x1904
#define GL_BLUE                           0x1905
#define GL_ALPHA                          0x1906
#define GL_RGB                            0x1907
#define GL_RGBA                           0x1908
#define GL_LUMINANCE                      0x1909
#define GL_LUMINANCE_ALPHA                0x190A

/* PixelType */
#define GL_BITMAP                         0x1A00
/*      GL_BYTE */
/*      GL_UNSIGNED_BYTE */
/*      GL_SHORT */
/*      GL_UNSIGNED_SHORT */
/*      GL_INT */
/*      GL_UNSIGNED_INT */
/*      GL_FLOAT */
/*      GL_UNSIGNED_BYTE_3_3_2_EXT */
/*      GL_UNSIGNED_SHORT_4_4_4_4_EXT */
/*      GL_UNSIGNED_SHORT_5_5_5_1_EXT */
/*      GL_UNSIGNED_INT_8_8_8_8_EXT */
/*      GL_UNSIGNED_INT_10_10_10_2_EXT */

At least, I think these are the right ones :)
The defined like GL_BYTE, etc. are commented out because they're already defined earlier (under DataType).

Paul

PS I think you can find the official values through this (http://opengl.org/registry/api) page. The enums are defined in http://opengl.org/registry/api/enum.spec, but it's a bit hard to digest.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to