pack_pixels.c revision 420f9d67d828890dcf3c94f96bb4b72885ff48a2
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Copyright (c) 2001, Stanford University
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * All rights reserved
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync * See the file LICENSE.txt for information on redistributing this software.
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncvoid PACK_APIENTRY crPackDrawPixels( GLsizei width, GLsizei height,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync unsigned char *data_ptr;
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync /* WHAT IS THIS FOR? Disabled by Brian on 3 Dec 2003 */
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync packet_length += crImageSize( format, type, width, height );
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync data_ptr = (unsigned char *) crPackAlloc( packet_length );
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync (void *) (data_ptr + 16), format, type, NULL, /* dst */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncvoid PACK_APIENTRY crPackReadPixels( GLint x, GLint y, GLsizei width,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync unsigned char *data_ptr;
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync sprintf(string, "crPackReadPixels(format 0x%x or type 0x%x)", format, type);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync __PackError(__LINE__, __FILE__, GL_INVALID_ENUM, string);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync /* default bytes_per_row so crserver can allocate memory */
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync GLint remainder = bytes_per_row % packstate->alignment;
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync stride = bytes_per_row + (packstate->alignment - remainder);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync GET_BUFFERED_POINTER(pc, 48 + sizeof(CRNetworkPointer) );
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync WRITE_DATA( 24, GLint, stride ); /* XXX not really used! */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync/* Round N up to the next multiple of 8 */
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncvoid PACK_APIENTRY crPackBitmap( GLsizei width, GLsizei height,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync const GLubyte *bitmap, const CRPixelPackState *unpack )
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync unsigned char *data_ptr;
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync data_ptr = (unsigned char *) crPackAlloc( packet_length );
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync crBitmapCopy(width, height, destBitmap, bitmap, unpack);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync crMemcpy(destBitmap, bitmap, data_length);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync data_ptr = (unsigned char *) crPackAlloc( packet_length );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync ZPix - compressed DrawPixels
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsyncvoid PACK_APIENTRY crPackZPixCR( GLsizei width, GLsizei height,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync unsigned char *data_ptr;
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync sizeof( int ) + /* packet size */
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync sizeof( type ) +
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync crDebug("PackZPixCR: fb %d x %d, state %d, zlen = %d, plen = %d",
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsync width, height, ztype, length, packet_length);
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync data_ptr = (unsigned char *) crPackAlloc( packet_length );
e0e0c19eefceaf5d4ec40f9466b58a771f50e799vboxsynccrPackGetTexImage( GLenum target, GLint level, GLenum format, GLenum type,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync GLvoid * pixels, const CRPixelPackState * packstate,
420f9d67d828890dcf3c94f96bb4b72885ff48a2vboxsync unsigned char *data_ptr;