当前位置:首页 科普知识 glColor

glColor

发布时间:2023-09-06 07:46:16

glColor3b,glColor4b glColor3s glColor4s,glColor3i,glColor4i需要3个或4个无符号字节,或长或短的整数作为参数。当v附加到该名称,颜色命令可以采取这种数值的数组的指针。

glColor详细介绍

glColor3b,glColor4b glColor3s glColor4s,glColor3i,glColor4i需要3个或4个无符号字节,或长或短的整数作为参数。当v附加到该名称,颜色命令可以采取这种数值的数组的指针。

当前颜色值被存储在浮点格式,与未指定的尾数和指数大小。无符号整数的颜色分量,指定时,线性映射等浮点值表示的最大值映射到1.0(全强度),和零映射到0.0(零点强度)。带符号整数的颜色分量,指定时,线性映射等浮点值的最积极的表示值映射到1.0,最消极的表示值映射到-1.0。浮点值直接映射。

glColor详细介绍

glColor

NAME

glColor3b, glColor3d, glColor3f, glColor3i, glColor3s, glColor3ub, glColor3ui, glColor3us, glColor4b, glColor4d, glColor4f, glColor4i, glColor4s, glColor4ub, glColor4ui, glColor4us, glColor3bv, glColor3dv, glColor3fv, glColor3iv, glColor3sv, glColor3ubv, glColor3uiv, glColor3usv, glColor4bv, glColor4dv, glColor4fv, glColor4iv, glColor4sv, glColor4ubv, glColor4uiv, glColor4usv, -- set the current color

C SPECIFICATION

void glColor3b(GLbyte red,

GLbyte green,

GLbyte blue)

void glColor3d(GLdouble red,

GLdouble green,

GLdouble blue)

void glColor3f(GLfloat red,

GLfloat green,

GLfloat blue)

void glColor3i(GLint red,

GLint green,

GLint blue)

void glColor3s(GLshort red,

GLshort green,

GLshort blue)

void glColor3ub(GLubyte red,

GLubyte green,

GLubyte blue)

void glColor3ui(GLuint red,

GLuint green,

GLuint blue)

void glColor3us(GLushort red,

GLushort green,

GLushort blue)

void glColor4b(GLbyte red,

GLbyte green,

GLbyte blue,

GLbyte alpha)

void glColor4d(GLdouble red,

GLdouble green,

GLdouble blue,

GLdouble alpha)

void glColor4f(GLfloat red,

GLfloat green,

GLfloat blue,

GLfloat alpha)

void glColor4i(GLint red,

GLint green,

GLint blue,

GLint alpha)

void glColor4s(GLshort red,

GLshort green,

GLshort blue,

GLshort alpha)

void glColor4ub(GLubyte red,

GLubyte green,

GLubyte blue,

GLubyte alpha)

void glColor4ui(GLuint red,

GLuint green,

GLuint blue,

GLuint alpha)

void glColor4us(GLushort red,

GLushort green,

GLushort blue,

GLushort alpha)

PARAMETERS

red, green, blue

Specify new red, green, and blue values for the current color.

alpha

Specifies a new alpha value for the current color. Included only in the four-argument glColor4 command.

C SPECIFICATION

void glColor3bv(const GLbyte *v)

void glColor3dv(const GLdouble *v)

void glColor3fv(const GLfloat *v)

void glColor3iv(const GLint *v)

void glColor3sv(const GLshort *v)

void glColor3ubv(const GLubyte *v)

void glColor3uiv(const GLuint *v)

void glColor3usv(const GLushort *v)

void glColor4bv(const GLbyte *v)

void glColor4dv(const GLdouble *v)

void glColor4fv(const GLfloat *v)

void glColor4iv(const GLint *v)

void glColor4sv(const GLshort *v)

void glColor4ubv(const GLubyte *v)

void glColor4uiv(const GLuint *v)

void glColor4usv(const GLushort *v)

PARAMETERS

v

Specifies a pointer to an array that contains red, green, blue, and (sometimes) alpha values.

DEscriptION

The GL stores both a current single-valued color index and a current four-valued RGBA color. glColor sets a new four-valued RGBA color. glColor has two major variants: glColor3 and glColor4. glColor3 variants specify new red, green, and blue values explicitly, and set the current alpha value to 1.0 implicitly. glColor4 variants specify all four color components explicitly.

glColor3b, glColor4b, glColor3s, glColor4s, glColor3i, and glColor4i take three or four unsigned byte, short or long integers as arguments. When v is appended to the name, the color commands can take a pointer to an array of such values.

Current color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and zero maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to -1.0. Floating-point values are mapped directly.

Neither floating-point nor signed integer values are clamped to the range before updating the current color. However, color components are clamped to this range before they are interpolated or written into a color buffer.

NOTES

The current color can be updated at any time. In particular, glColor can be called between a call to glBegin and the corresponding call to glEnd.

指定一个指针,指向一个数组,包含红色,绿色,蓝色,和(有时)的alpha值。

glColor说明

GL店既是当前的单值的显色指数和当前四值RGBA颜色。glColor设置一个新的四值RGBA颜色。glColor有两大变种:glColor3 glColor4。glColor3变种新红,绿,蓝值明确指定,并隐式地设置当前的Alpha值1.0。glColor4变种明确指定所有四色组件。

glColor3b,glColor4b glColor3s glColor4s,glColor3i,glColor4i需要3个或4个无符号字节,或长或短的整数作为参数。当在函数名后加上v后缀,颜色命令可以采取这种数值的数组的指针作参数传递。

当前颜色值被存储为浮点格式,包含未指定的尾数和指数大小。在赋值时,无符号整数的颜色分量,会被线性映射到浮点值,即最大值映射到1.0(全强度),零映射到0.0(零点强度)。在赋值时,带符号整数的颜色分量,被线性映射到浮点值,即最大正可表示值映射到1.0,最小负可表示值映射到-1.0。浮点值直接映射。

浮点数与带符号整数的值在更新当前颜色前都不会被限制到范围。然而,颜色分量将被锁定到该范围内,才进行插值或写入颜色缓冲区。

glColor附注

当前颜色可以随时更新。特别的,glColor可以在glBegin调用和对应的glEnd调用之间被调用。

(谷歌翻译)

温馨提示:
本文【glColor】由作者 爱百科 转载提供。 该文观点仅代表作者本人, 自学教育网 信息发布平台,仅提供信息存储空间服务, 若存在侵权问题,请及时联系管理员或作者进行删除。
(c)2008-2025 自学教育网 All Rights Reserved 汕头市灵创科技有限公司
粤ICP备2024240640号-6