请输入您要查询的百科知识:

 

词条 gluScaleImage
释义

gluScaleImage

NAME (函数名称)

gluScaleImage -- scale an image to an arbitrary size (把一个图像任意缩放到一个大小)

C SPECIFICATION(C语言实现示例)

int gluScaleImage(GLenum format,

GLint widthin,

GLint heightin,

GLenum typein,

const void *datain,

GLint widthout,

GLint heightout,

GLenum typeout,

void *dataout)

PARAMETERS(各参数含义):

format:

Specifies the format of the pixel data. The following symbolic values are valid: GL_COLOR_INDEX, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA.

(指定像素数据的格式类型,下面是其可选的有效参数:

GL_STENCIL_INDEX, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB,

GL_RGBA, GL_LUMINANCE, and GL_LUMINANCE_ALPHA.

widthin, heightin:

Specify the width and height, respectively, of the source image that is scaled.

(指定宽度和高度,各自为要缩放的源图像的高度和宽度)

typein:

Specifies the data type for datain. Must be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.

(指定要输入的数据的类型,必须是这些参数:GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.)

datain:

Specifies a pointer to the source image.

(指定了一个指向源程序的指针)

widthout, heightout:

Specify the width and height, respectively, of the destination image.

(这个根据参数名字可以看出,是你想要变化后的图像的高度和宽度的大小)

typeout:

Specifies the data type for dataout. Must be one of GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.

(指定要输出的数据类型,必须是以下可选参数:GL_UNSIGNED_BYTE, GL_BYTE, GL_BITMAP, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_INT, GL_INT, or GL_FLOAT.)

dataout:

Specifies a pointer to the destination image.

(指定目的图像指针)

DESCRIPTION(说明):

gluScaleImage scales a pixel image using the appropriate pixel store modes to unpack data from the source image and pack data into the destination image.

(gluScaleImage这个函数用适当的像素存储模式改变一个像素图像的大小来读取源图像的像素数据然后把像素写入新的目标图像)

When shrinking an image, gluScaleImage uses a box filter to sample the source image and create pixels for the destination image. When magnifying an image, the pixels from the source image are linearly interpolated to create the destination image.

(当缩小一个图像时,gluScaleImage这个函数用一个叫box filter(不知到怎么翻译,暂译作过滤器)的东东来取样源图像的数据然后为新目的图像创建新的像素。当放大一个图像的时候,来自源图像的像素以线性插值的方式补充像素来为新目的图像创建像素)

A return value of zero indicates success, otherwise a GLU error code is returned indicating what the problem was (see gluErrorString).

(函数返回0值表示像素缩放成功,若失败则返回一个GLU 错误的字符串,通过这个字符串可以知道错误原因,可以看gluErrorString)

Please refer to the glReadPixels reference page for a description of the acceptable values for the format, typein, and typeout parameters.

(请参考glReadPixels函数的相关参考来查看关于参数tyepin和typeout这两个参数的可接受的类型的描述,或可理解为,如果你想了解更过关于typein和typeout的详情,请参考glReadPixels函数的参考页数,(估计这段英文是来自一本书,初次词条可能只是把原文粘贴过来的))

备注:

本人初次翻译,且是大二学生,如有错误,请指正并自己加以理解。---fairzy

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/1/4 2:43:04