-/* $Id: pixel.c,v 1.3 1999/10/30 08:20:57 brianp Exp $ */
+/* $Id: pixel.c,v 1.5 1999/11/11 01:22:27 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.1
+ * Version: 3.3
*
* Copyright (C) 1999 Brian Paul All Rights Reserved.
*
*/
-
-
-
/*
* glPixelStore, glPixelTransfer, glPixelMap, glPixelZoom, etc.
*/
#ifdef PC_HEADER
#include "all.h"
#else
-#ifndef XFree86Server
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include "GL/xf86glx.h"
-#endif
+#include "glheader.h"
#include "context.h"
#include "macros.h"
+#include "mem.h"
#include "pixel.h"
#include "types.h"
-#ifdef XFree86Server
-#include "GL/xf86glx.h"
-#endif
#endif
-void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor )
+void
+_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelZoom");
ctx->Pixel.ZoomX = xfactor;
/**********************************************************************/
-void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param )
+void
+_mesa_PixelStorei( GLenum pname, GLint param )
{
/* NOTE: this call can't be compiled into the display list */
-
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelStore");
-
switch (pname) {
case GL_PACK_SWAP_BYTES:
ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE;
}
+void
+_mesa_PixelStoref( GLenum pname, GLfloat param )
+{
+ _mesa_PixelStorei( pname, (GLint) param );
+}
-void gl_PixelMapfv( GLcontext *ctx,
- GLenum map, GLint mapsize, const GLfloat *values )
+void
+_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values )
{
GLint i;
-
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelMapfv");
+void
+_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values )
+{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = UINT_TO_FLOAT( values[i] );
+ }
+ }
+ _mesa_PixelMapfv(map, mapsize, fvalues);
+}
+
-void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values )
+void
+_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values )
{
+ GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
+ GLint i;
+ if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = (GLfloat) values[i];
+ }
+ }
+ else {
+ for (i=0;i<mapsize;i++) {
+ fvalues[i] = USHORT_TO_FLOAT( values[i] );
+ }
+ }
+ _mesa_PixelMapfv(map, mapsize, fvalues);
+}
+
+
+
+void
+_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
+{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
}
-void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values )
+void
+_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
}
-void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values )
+void
+_mesa_GetPixelMapusv( GLenum map, GLushort *values )
{
+ GET_CURRENT_CONTEXT(ctx);
GLint i;
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv");
* Implements glPixelTransfer[fi] whether called immediately or from a
* display list.
*/
-void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param )
+void
+_mesa_PixelTransferf( GLenum pname, GLfloat param )
{
+ GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelTransfer");
}
+void
+_mesa_PixelTransferi( GLenum pname, GLint param )
+{
+ _mesa_PixelTransferf( pname, (GLfloat) param );
+}
+
+
/*