Last active
August 29, 2015 14:05
-
-
Save Neill3d/1fa04b0b0c4171dcf7de to your computer and use it in GitHub Desktop.
Convert OR SDK image clip format to opengl format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FBVideoFormat clipFormat = (pVideoClip) ? (pVideoClip->Format) : kFBVideoFormat_RGB_24; | |
GLint internalFormat = (compressed) ? GL_COMPRESSED_RGB : GL_RGB; | |
GLint format = GL_RGB; | |
switch (clipFormat) | |
{ | |
case kFBVideoFormat_Any: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; | |
case kFBVideoFormat_Other: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; | |
case kFBVideoFormat_RGBA_32: | |
internalFormat = (compressed) ? GL_COMPRESSED_RGBA : GL_RGBA8; | |
format = GL_RGBA; | |
break; | |
case kFBVideoFormat_RGB_24: | |
internalFormat = (compressed) ? GL_COMPRESSED_RGB : GL_RGB8; | |
format = GL_RGB; | |
break; | |
case kFBVideoFormat_BGRA_32: | |
internalFormat = (compressed) ? GL_COMPRESSED_RGBA : GL_BGRA; | |
format = GL_RGBA; | |
break; | |
case kFBVideoFormat_BGR_24: | |
internalFormat = (compressed) ? GL_COMPRESSED_RGB : GL_BGR; | |
format = GL_RGB; | |
break; | |
case kFBVideoFormat_BGR_16: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; | |
case kFBVideoFormat_ABGR_32: | |
internalFormat = (compressed) ? GL_COMPRESSED_RGBA : GL_ABGR_EXT; | |
format = GL_RGBA; | |
break; | |
case kFBVideoFormat_ARGB_32: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; | |
case kFBVideoFormat_422: | |
printf( "%s - unsupported video format\n", pVideoClip->Name ); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment