examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// Write image pixels to shared memory
// rgba, bgra, rgb, bgr source buffers supported
//

Write image pixels to shared memory
rgba, bgra, rgb, bgr source buffers supported
Write image pixels to shared memory rgba bgra rgb bgr source buffers supported
bool spoutGLDXinterop::WriteMemoryPixels(const unsigned char *pixels, unsigned int width, unsigned int height, GLenum glFormat, bool bInvert)
{
	unsigned char *pBuffer = memoryshare.LockSenderMemory();
	if(!pBuffer)
		return false;
	if(glFormat == GL_RGBA) {
		spoutcopy.CopyPixels(pixels, pBuffer, width, height, GL_RGBA, bInvert);
	}
	else if(glFormat == 0x80E1) { 
		spoutcopy.bgra2rgba((void *)pixels, (void *)pBuffer, width, height, bInvert);
	}
	else if(glFormat == 0x80E0) { 
		spoutcopy.bgr2rgba((void *)pixels, (void *)pBuffer, width, height, bInvert);
	}
	else if(glFormat == GL_RGB) {
		spoutcopy.rgb2rgba((void *)pixels, (void *)pBuffer, width, height, bInvert);
	}
	memoryshare.UnlockSenderMemory();
	return true;
}
bool spoutGLDXinterop :: WriteMemoryPixels ( const unsigned char * pixels , unsigned int width , unsigned int height , GLenum glFormat , bool bInvert ) { unsigned char * pBuffer = memoryshare . LockSenderMemory ( ) ; if ( ! pBuffer ) return false ; if ( glFormat == GL_RGBA ) { spoutcopy . CopyPixels ( pixels , pBuffer , width , height , GL_RGBA , bInvert ) ; } else if ( glFormat == 0x80E1 ) { spoutcopy . bgra2rgba ( ( void * ) pixels , ( void * ) pBuffer , width , height , bInvert ) ; } else if ( glFormat == 0x80E0 ) { spoutcopy . bgr2rgba ( ( void * ) pixels , ( void * ) pBuffer , width , height , bInvert ) ; } else if ( glFormat == GL_RGB ) { spoutcopy . rgb2rgba ( ( void * ) pixels , ( void * ) pBuffer , width , height , bInvert ) ; } memoryshare . UnlockSenderMemory ( ) ; return true ; }
Write image pixels to shared memory
rgba, bgra, rgb, bgr source buffers supported
Write image pixels to shared memory rgba bgra rgb bgr source buffers supported
// Write pixels to shared memory
 // GL_BGRA_EXT if supported
 // GL_BGR_EXT if supported
