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