From: Gernot Ziegler (gz++at++lysator.liu.se)
Date: 06/02/2001 16:57:53
Hej Marcin !
> Performer textures support any internal/external format that OpenGL
> textures support. Take a look at glTexImage2D; you will be ably to use any
> of the formats listed there and pfTexture accepts them as parameters.
Exactly ...
> Off the top of my head, I do not think OpenGL can accept YUV textures. On
> a machine with the ARB_Imaging extensions, or any sgi hardware, you could
> set up a matrix that will convert your texture colors with a color
> matrix. I think that YUV or YCrCb conversion to RGB can be done with a 3x3
> matrix. I'm sure you will find what the matrix is if you do a search on
> the web.
Right - I have a program available that does that in OpenGL, approx. like
that:
static GLfloat Matrix_YCbCr2RGB[16] = {
1, 1, 1, 0,
0, -0.344136, 1.773, 0,
1.402, -0.714136, 0, 0,
0, 0, 0, 0
};
// Setup YCbCr -> RGB color transform matrix
glMatrixMode(GL_COLOR);
if (convYUV2RGB) {
glLoadMatrixf(Matrix_YCbCr2RGB);
glPixelTransferf(GL_GREEN_BIAS, -0.5);
glPixelTransferf(GL_BLUE_BIAS, -0.5);
}
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,
imgWidth, imgHeight,
GL_RGB, GL_UNSIGNED_BYTE, imgData);
---------------------
But I have no clue how to translate that to Performercode - I saw that it
is possible to load the OpenGL matrix - but can it be used for the texture
upload, too ? Could I load the OpenGL matrix and then issue a
tex->setImage ?
I am not good at that lowlevel-stuff yet, just started for 3 weeks ago :-P
:-)
Servus,
Gernot
/-----------------------------W-E-L-C-O-M-E------------------------------\
T The Austria <=> Sweden connection..... T
| E-Mail: gz++at++lysator.liu.se H
O Homepage: http://www.lysator.liu.se/~gz E
\------------------------------F-U-T-U-R-E-------------------------------/
This archive was generated by hypermail 2b29 : Sat Jun 02 2001 - 16:57:58 PDT