/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: The application programming interfaces
** established by SGI in conjunction with the Original Code are The
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
** Window System(R) (Version 1.3), released October 19, 1998. This software
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
** $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
** $Header: /cvsroot/mesa3d/Mesa/si-glu/libutil/mipmap.c,v 1.2 2001/08/07 17:34:11 brianp Exp $
*/
#include "gluos.h"
#include <assert.h>
#include <GL/glu.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h> /* UINT_MAX */
#include <math.h>
#include "gluint.h"
typedef union {
unsigned char ub[4];
unsigned short us[2];
unsigned int ui;
char b[4];
short s[2];
int i;
float f;
} Type_Widget;
/* Pixel storage modes */
typedef struct {
GLint pack_alignment;
GLint pack_row_length;
GLint pack_skip_rows;
GLint pack_skip_pixels;
GLint pack_lsb_first;
GLint pack_swap_bytes;
GLint pack_skip_images;
GLint pack_image_height;
GLint unpack_alignment;
GLint unpack_row_length;
GLint unpack_skip_rows;
GLint unpack_skip_pixels;
GLint unpack_lsb_first;
GLint unpack_swap_bytes;
GLint unpack_skip_images;
GLint unpack_image_height;
} PixelStorageModes;
static int gluBuild1DMipmapLevelsCore(GLenum, GLint,
GLsizei,
GLsizei,
GLenum, GLenum, GLint, GLint, GLint,
const void *);
static int gluBuild2DMipmapLevelsCore(GLenum, GLint,
GLsizei, GLsizei,
GLsizei, GLsizei,
GLenum, GLenum, GLint, GLint, GLint,
const void *);
static int gluBuild3DMipmapLevelsCore(GLenum, GLint,
GLsizei, GLsizei, GLsizei,
GLsizei, GLsizei, GLsizei,
GLenum, GLenum, GLint, GLint, GLint,
const void *);
/*
* internal function declarations
*/
static GLfloat bytes_per_element(GLenum type);
static GLint elements_per_group(GLenum format, GLenum type);
static GLint is_index(GLenum format);
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type);
static void fill_image(const PixelStorageModes *,
GLint width, GLint height, GLenum format,
GLenum type, GLboolean index_format,
const void *userdata, GLushort *newimage);
static void empty_image(const PixelStorageModes *,
GLint width, GLint height, GLenum format,
GLenum type, GLboolean index_format,
const GLushort *oldimage, void *userdata);
static void scale_internal(GLint components, GLint widthin, GLint heightin,
const GLushort *datain,
GLint widthout, GLint heightout,
GLushort *dataout);
static void scale_internal_ubyte(GLint components, GLint widthin,
GLint heightin, const GLubyte *datain,
GLint widthout, GLint heightout,
GLubyte *dataout, GLint element_size,
GLint ysize, GLint group_size);
static void scale_internal_byte(GLint components, GLint widthin,
GLint heightin, const GLbyte *datain,
GLint widthout, GLint heightout,
GLbyte *dataout, GLint element_size,
GLint ysize, GLint group_size);
static void scale_internal_ushort(GLint components, GLint widthin,
GLint heightin, const GLushort *datain,
GLint widthout, GLint heightout,
GLushort *dataout, GLint element_size,
GLint ysize, GLint group_size,
GLint myswap_bytes);
static void scale_internal_short(GLint components, GLint widthin,
GLint heightin, const GLshort *datain,
GLint widthout, GLint heightout,
GLshort *dataout, GLint element_size,
GLint ysize, GLint group_size,
GLint myswap_bytes);
static void scale_internal_uint(GLint components, GLint widthin,
GLint heightin, const GLuint *datain,
GLint widthout, GLint heightout,
GLuint *dataout, GLint element_size,
GLint ysize, GLint group_size,
GLint myswap_bytes);
static void scale_internal_int(GLint components, GLint widthin,
GLint heightin, const GLint *datain,
GLint widthout, GLint heightout,
GLint *dataout, GLint element_size,
GLint ysize, GLint group_size,
GLint myswap_bytes);
static void scale_internal_float(GLint components, GLint widthin,
GLint heightin, const GLfloat *datain,
GLint widthout, GLint heightout,
GLfloat *dataout, GLint element_size,
GLint ysize, GLint group_size,
GLint myswap_bytes);
static int checkMipmapArgs(GLenum, GLenum, GLenum);
static GLboolean legalFormat(GLenum);
static GLboolean legalType(GLenum);
static GLboolean isTypePackedPixel(GLenum);
static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum);
static GLboolean isLegalLevels(GLint, GLint, GLint, GLint);
static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum,
GLint *, GLint *);
/* all extract/shove routines must return double to handle unsigned ints */
static GLdouble extractUbyte(int, const void *);
static void shoveUbyte(GLdouble, int, void *);
static GLdouble extractSbyte(int, const void *);
static void shoveSbyte(GLdouble, int, void *);
static GLdouble extractUshort(int, const void *);
static void shoveUshort(GLdouble, int, void *);
static GLdouble extractSshort(int, const void *);
static void shoveSshort(GLdouble, int, void *);
static GLdouble extractUint(int, const void *);
static void shoveUint(GLdouble, int, void *);
static GLdouble extractSint(int, const void *);
static void shoveSint(GLdouble, int, void *);
static GLdouble extractFloat(int, const void *);
static void shoveFloat(GLdouble, int, void *);
static void halveImageSlice(int, GLdouble (*)(int, const void *),
void (*)(GLdouble, int, void *),
GLint, GLint, GLint,
const void *, void *,
GLint, GLint, GLint, GLint, GLint);
static void halveImage3D(int, GLdouble
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Mesa 4.0 for vxworks (1333个子文件)
RELNOTES-4.0 4KB
RELNOTES-3.1 4KB
RELNOTES-3.2.1 861B
RELNOTES-3.4.1 643B
RELNOTES-3.4.2 643B
RELNOTES-3.2 370B
RELNOTES-3.3 8KB
uglMesaCreateNewContextExt.3 2KB
uglMesaMakeCurrentContext.3 2KB
uglMesaCreateNewContext.3 2KB
uglMesaGetIntegerv.3 1KB
uglMesaPixelStore.3 900B
uglMesaSetColor.3 847B
uglMesaGetDepthBuffer.3 836B
uglMesaGetColorBuffer.3 785B
uglMesaResizeToWindow.3 703B
uglMesaSwapBuffers.3 632B
uglMesaMoveToWindow.3 605B
uglMesaResizeWindow.3 589B
uglMesaMoveWindow.3 575B
uglMesaDestroyContext.3 516B
uglMesaGetCurrentContext.3 506B
README.3DFX 20KB
GLwDrawingArea.3x 29KB
MesaWorkstation.3x 8KB
MesaDrawingArea.3x 6KB
GLwCreateMDrawingArea.3x 4KB
GLwDrawingAreaMakeCurrent.3x 4KB
GLwDrawingAreaSwapBuffers.3x 4KB
RELNOTES-3.5 7KB
mklib.aix 3KB
alg-outline 10KB
Makefile.am 2KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 1KB
Makefile.am 984B
Makefile.am 925B
Makefile.am 751B
Makefile.am 704B
Makefile.am 574B
Makefile.am 548B
Makefile.am 548B
Makefile.am 531B
Makefile.am 531B
Makefile.am 522B
Makefile.am 512B
Makefile.am 507B
Makefile.am 499B
Makefile.am 470B
Makefile.am 446B
Makefile.am 419B
Makefile.am 410B
Makefile.am 397B
Makefile.am 376B
Makefile.am 369B
Makefile.am 347B
Makefile.am 308B
Makefile.am 298B
Makefile.am 277B
Makefile.am 265B
Makefile.am 264B
Makefile.am 250B
Makefile.am 242B
Makefile.am 137B
Makefile.am 123B
Makefile.am 114B
Makefile.am 113B
Makefile.am 112B
mklib.amiga 523B
README.AMIWIN 7KB
mklib.amiwin 555B
mklib.ar-rcv 680B
mklib.ar-ruv 680B
tube.asc 11KB
torus.asc 7KB
cone.asc 6KB
sphere.asc 3KB
box.asc 1KB
README.BEOS 3KB
Makefile.BeOS 2KB
Makefile.BeOS 2KB
mklib.beos 1KB
mklib.beos-ppc 1KB
Makefile.BeOS-R4 3KB
Makefile.BeOS-R4 2KB
Makefile.BeOS-R4 2KB
Makefile.BeOS-R4 1KB
Makefile.BeOS-R4 1KB
mklib.beos-r4 700B
mklib.beos-x86 1KB
blah 26B
blat 54B
wrs_logo.bmp 192KB
mklib.bsdos4 843B
mipmap.c 286KB
tr_wrapper.c 235KB
共 1333 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
menger1216
- 粉丝: 2
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页