examples/Qt/ISFEditor/ISFEditor_app/Spout/SpoutGLDXinterop.cpp
//
// Read shared memory to image pixels
// rgba, bgra, rgb, bgr destination buffers supported
// Most efficient if the receiving buffer is rgba
// Invert currently not used
//

Read shared memory to image pixels
rgba, bgra, rgb, bgr destination buffers supported
Most efficient if the receiving buffer is rgba
Invert currently not used
Read shared memory to image pixels rgba bgra rgb bgr destination buffers supported Most efficient if the receiving buffer is rgba Invert currently not used
bool spoutGLDXinterop::ReadMemoryPixels(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(pBuffer, pixels, width, height, GL_RGBA, bInvert);
	}
	else if(glFormat == 0x80E1) { 
		spoutcopy.rgba2bgra((void *)pBuffer, (void *)pixels, width, height, bInvert);
	}
	else if(glFormat == 0x80E0) { 
		spoutcopy.rgba2bgr((void *)pBuffer, (void *)pixels, width, height, bInvert);
	}
	else if(glFormat == GL_RGB) {
		spoutcopy.rgba2rgb((void *)pBuffer, (void *)pixels, width, height, bInvert);
	}
	memoryshare.UnlockSenderMemory();
	return true;
}
bool spoutGLDXinterop :: ReadMemoryPixels ( 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 ( pBuffer , pixels , width , height , GL_RGBA , bInvert ) ; } else if ( glFormat == 0x80E1 ) { spoutcopy . rgba2bgra ( ( void * ) pBuffer , ( void * ) pixels , width , height , bInvert ) ; } else if ( glFormat == 0x80E0 ) { spoutcopy . rgba2bgr ( ( void * ) pBuffer , ( void * ) pixels , width , height , bInvert ) ; } else if ( glFormat == GL_RGB ) { spoutcopy . rgba2rgb ( ( void * ) pBuffer , ( void * ) pixels , width , height , bInvert ) ; } memoryshare . UnlockSenderMemory ( ) ; return true ; }
Read shared memory to image pixels
rgba, bgra, rgb, bgr destination buffers supported
Most efficient if the receiving buffer is rgba
Invert currently not used
Read shared memory to image pixels rgba bgra rgb bgr destination buffers supported Most efficient if the receiving buffer is rgba Invert currently not used
// Read pixels from shared memory
 // GL_BGRA_EXT if supported
 // GL_BGR_EXT if supported
