/*
* Mesa 3-D graphics library
- * Version: 7.1
*
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
*/
#include "glheader.h"
#include "bufferobj.h"
-#include "colormac.h"
#include "context.h"
#include "macros.h"
-#include "mfeatures.h"
#include "pixel.h"
#include "pbo.h"
#include "mtypes.h"
#include "main/dispatch.h"
-#if FEATURE_pixel_transfer
-
-
/**********************************************************************/
/***** glPixelZoom *****/
/**********************************************************************/
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
if (ctx->Pixel.ZoomX == xfactor &&
ctx->Pixel.ZoomY == yfactor)
return;
for (i = 0; i < mapsize; i++) {
GLfloat val = CLAMP(values[i], 0.0F, 1.0F);
pm->Map[i] = val;
- pm->Map8[i] = (GLint) (val * 255.0F);
}
}
}
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
/* XXX someday, test against ctx->Const.MaxPixelMapTableSize */
if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values )
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapuiv(mapsize)" );
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values )
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
if (mapsize < 1 || mapsize > MAX_PIXEL_MAP_TABLE) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelMapusv(mapsize)" );
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values )
{
GET_CURRENT_CONTEXT(ctx);
GLint mapsize, i;
const struct gl_pixelmap *pm;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
pm = get_pixelmap(ctx, map);
if (!pm) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapfv(map)");
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetPixelMapfv( GLenum map, GLfloat *values )
{
_mesa_GetnPixelMapfvARB(map, INT_MAX, values);
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values )
{
GET_CURRENT_CONTEXT(ctx);
GLint mapsize, i;
const struct gl_pixelmap *pm;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
pm = get_pixelmap(ctx, map);
if (!pm) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapuiv(map)");
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetPixelMapuiv( GLenum map, GLuint *values )
{
_mesa_GetnPixelMapuivARB(map, INT_MAX, values);
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values )
{
GET_CURRENT_CONTEXT(ctx);
GLint mapsize, i;
const struct gl_pixelmap *pm;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
pm = get_pixelmap(ctx, map);
if (!pm) {
_mesa_error(ctx, GL_INVALID_ENUM, "glGetPixelMapusv(map)");
/* special cases */
case GL_PIXEL_MAP_I_TO_I:
for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0, 65535.);
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.ItoI.Map[i], 0.0F, 65535.0F);
}
break;
case GL_PIXEL_MAP_S_TO_S:
for (i = 0; i < mapsize; i++) {
- values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0, 65535.);
+ values[i] = (GLushort) CLAMP(ctx->PixelMaps.StoS.Map[i], 0.0F, 65535.0F);
}
break;
default:
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_GetPixelMapusv( GLenum map, GLushort *values )
{
_mesa_GetnPixelMapusvARB(map, INT_MAX, values);
* Implements glPixelTransfer[fi] whether called immediately or from a
* display list.
*/
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelTransferf( GLenum pname, GLfloat param )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (pname) {
case GL_MAP_COLOR:
}
-static void GLAPIENTRY
+void GLAPIENTRY
_mesa_PixelTransferi( GLenum pname, GLint param )
{
_mesa_PixelTransferf( pname, (GLfloat) param );
}
-void
-_mesa_init_pixel_dispatch(struct _glapi_table *disp)
-{
- SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv);
- SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv);
- SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv);
- SET_PixelMapfv(disp, _mesa_PixelMapfv);
- SET_PixelMapuiv(disp, _mesa_PixelMapuiv);
- SET_PixelMapusv(disp, _mesa_PixelMapusv);
- SET_PixelTransferf(disp, _mesa_PixelTransferf);
- SET_PixelTransferi(disp, _mesa_PixelTransferi);
- SET_PixelZoom(disp, _mesa_PixelZoom);
-
- /* GL_ARB_robustness */
- SET_GetnPixelMapfvARB(disp, _mesa_GetnPixelMapfvARB);
- SET_GetnPixelMapuivARB(disp, _mesa_GetnPixelMapuivARB);
- SET_GetnPixelMapusvARB(disp, _mesa_GetnPixelMapusvARB);
-}
-
-
-#endif /* FEATURE_pixel_transfer */
-
-
/**********************************************************************/
/***** Initialization *****/
/**********************************************************************/
{
map->Size = 1;
map->Map[0] = 0.0;
- map->Map8[0] = 0;
}