社区
机器视觉
帖子详情
OpenGL中glRasterPos和glCopyPixels中参数的单位问题
wangjian05
2006-04-20 04:39:00
象素拷贝函数glCopyPixels(GLint x,GLint y,GLsizesi width,GLsizei height,GLenum type)中x,y,width,height的单位是什么?
当前光栅位置函数glRasterPos{234}{SIFD}[V](TYPE x,TYPE y,TYPE z,TYPE w)中x,y,z的单位是什么?
这两个函数中的参数其单位之间有什么联系?
谢谢!
...全文
156
1
打赏
收藏
OpenGL中glRasterPos和glCopyPixels中参数的单位问题
象素拷贝函数glCopyPixels(GLint x,GLint y,GLsizesi width,GLsizei height,GLenum type)中x,y,width,height的单位是什么? 当前光栅位置函数glRasterPos{234}{SIFD}[V](TYPE x,TYPE y,TYPE z,TYPE w)中x,y,z的单位是什么? 这两个函数中的参数其单位之间有什么联系? 谢谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
syy64
2006-04-23
打赏
举报
回复
按Opengl的窗口坐标,跟Windows的窗口差不多,只是原点在坐下角.
Open
GL
库函数汇总(
中
文分类)CHM
首先感谢各位的下载,这个文档是我自己整理的,由于函数太多,没办法一一详细的添加用法的
中
文翻译,还望大家见谅,里面写明了是
中
文分类。 如哪位朋友有
中
文的用法介绍可以提供给我,让你我一起完善这个
中
文的翻译工作! 有些朋友说给我骗了,你要知道整理这个文档我花了大量时间。已经非常的不容易了,我找了好多CHM文档都没有一个是我自己想要的。非常痛苦弄出来的!希望大家多多支持!!
中
文分类
Open
GL
库函数汇总 ================================= 目前
Open
GL
的函数主要包含在3个库
中
1.
GL
函数库 2.
GL
U 函数库 3.
GL
UT 函数库 1.
GL
库函数 =================================== 颜色编辑 -------------------
gl
ShadeModel 选择平面明暗模式或光滑明暗模式 void
gl
ShadeModel(
GL
enum mode)
参数
:mode 指定表示明暗模式的符号值,可选
GL
_FLAT 和
GL
_SMOOTH ,缺省值为
GL
_SMOOTH
gl
Color 设置当前颜色 这是一个家族性质的函数集合,并没有
gl
Color()这个函数。其包含的函数如下: void
gl
Color3b(
GL
byte red ,
GL
byte green ,
GL
byte blue) void
gl
Color3d(
GL
double red ,
GL
double green ,
GL
double blue) void
gl
Color3f(
GL
float red ,
GL
float green ,
GL
float blue) void
gl
Color3i(
GL
int red ,
GL
int green ,
GL
int blue) void
gl
Color3s(
GL
short red ,
GL
short green ,
GL
short blue) void
gl
Color3ub(
GL
ubyte red ,
GL
ubyte green ,
GL
ubyte blue) void
gl
Color3ui(
GL
uint red ,
GL
uint green ,
GL
uint blue) void
gl
Color3us(
GL
ushort red ,
GL
ushort green ,
GL
ushort blue) void
gl
Color4b(
GL
byte red ,
GL
byte green ,
GL
byte blue ,
GL
byte alpha) void
gl
Color4d(
GL
double red ,
GL
double green ,
GL
double blue ,
GL
double alpha) void
gl
Color4f(
GL
float red ,
GL
float green ,
GL
float blue ,
GL
float alpha) void
gl
Color4i(
GL
int red ,
GL
int green ,
GL
int blue ,
GL
int alpha) void
gl
Color4s(
GL
short red ,
GL
short green ,
GL
short blue ,
GL
short alpha) void
gl
Color4ub(
GL
ubyte red ,
GL
ubyte green ,
GL
ubyte blue ,
GL
ubyte alpha) void
gl
Color4ui(
GL
uint red ,
GL
uint green ,
GL
uint blue ,
GL
uint alpha) void
gl
Color4us(
GL
ushort red ,
GL
ushort green ,
GL
ushort blue ,
GL
byte alpha)
参数
:red , green , blue 指定当前新的红、绿、蓝的颜色值 alpha 透明度,指明当前新的 alpha 颜色值 ,只有在
gl
Color4 函数
中
带4个变量时才会指定此
参数
。 此外还包括: void
gl
Color3bv(const
GL
byte * v) void
gl
Color3dv(const
GL
doble * v) void
gl
Color3fv(const
GL
float * v) void
gl
Color3iv(const
GL
int * v) void
gl
Color3sv(const
GL
short * v) void
gl
Color3ubv(const
GL
ubyte * v) void
gl
Color3uiv(const
GL
uint * v) void
gl
Color3usv(const
GL
ushort * v) void
gl
Color4bv(const
GL
byte * v) void
gl
Color4dv(const
GL
doble * v) void
gl
Color4fv(const
GL
float * v) void
gl
Color4iv(const
GL
int * v) void
gl
Color4sv(const
GL
short * v) void
gl
Color4ubv(const
GL
ubyte * v) void
gl
Color4uiv(const
GL
uint * v) void
gl
Color4usv(const
GL
ushort * v)
参数
:v 指定一个值向包含红、绿、蓝和 alpha 值的数组指针。
gl
ColorPointer 定义颜色数组 void
gl
ColorPointer(
GL
int size ,
GL
enum type ,
GL
sizei stride ,
GL
sizei count , const
GL
void * pointer)
参数
:size 每个颜色的分量数目 ,该值必须是3或4 type 在颜色数组
中
每个颜色分量的数据类型,可选的数据类型为:
GL
_BYTE
GL
_UNSIGNED_BYTE
GL
_SHORT
GL
_UNSIGNED_SHORT
GL
_INT
GL
_UNSIGNED_INT
GL
_FLOAT
GL
_UNSIGNED_FLOAT stride 相邻两个颜色的字节偏移量。当stride为零时 ,颜色值在数组
中
是一个接一个排列的。 count 静态颜色的数目 ,从第一个颜色开始计数。 pointer 指向颜色数组
中
第一个颜色元素
中
第一个分量的指针。
gl
Index 设置当前颜色索引 void
gl
Indexd(
GL
double c) void
gl
Indexf(
GL
float c) void
gl
Indexi(
GL
int c) void
gl
Indexs(
GL
short c)
参数
: c 新的当前颜色索引值 void
gl
Indexdv(
GL
double * c) void
gl
Indexfv(
GL
float * c) void
gl
Indexiv(
GL
int * c) void
gl
Indexsv(
GL
short * c)
参数
: c 指向一个由单个元素组成的数组指针 ,该数组
中
包含新的当前颜色索引值。
gl
IndexPointer 定义颜色索引数组 void
gl
IndexPointer(
GL
enum type ,
GL
sizei stride ,
GL
sizei count ,const
GL
void *pointer)
参数
:type 数组
中
每个颜色索引的数据类型 ,可以选择的符号常数为:
GL
_SHORT
GL
_INT
GL
_FLOAT
GL
_DOUBLE stride 相邻的两个颜色索引的字节偏移量。当stride为零时 ,颜色索引值在数组
中
是一个接一个排列的。 count 颜色索引的数目,从第一个颜色开始计数 ,它们是静态的。 pointer 指向颜色数组
中
第一个颜色索引的指针。
gl
ColorTableEXT 为目标调色板纹理指定调色板的格式和大小 void
gl
ColorTableEXT(
GL
enum target ,
GL
enum internalFormat ,
GL
sizei width ,
GL
enum format ,
GL
enum type ,const
GL
void *data)
参数
:target 需要更改调色板的目标纹理 ,必须为 TEXTURE_1D TEXTURE_2D PROXY_TEXTURE_1D PROXY_TEXTURE_2D intenalFormat (等待编辑) width 调色板的大小 ,对于某些 n ,必须满足 2n>=1 . format (等待编辑) type data的数据类型 ,可选以下符号常量:
GL
_UNSIGNED_BYTE
GL
_BYTE
GL
_UNSIGNED_SHORT
GL
_SHORT
GL
_UNSIGNED_INT
GL
_INT
GL
_UNSIGNED_FLOAT
GL
_FLOAT data 指向调色板纹理数据的指针。对于调色板项目 ,数据作为一维纹理调色板项目
中
的单个像素进行处理。
gl
ColorSubTableEXT 指定需要替代的目标纹理调色板的一部分 void
gl
ColorSubTableEXT(
GL
enum target ,
GL
sizei start ,
GL
sizei count ,
GL
enum format ,
GL
enum type ,const
GL
void * data)
参数
:target 需要更改调色板的目标纹理 ,必须为 TEXTURE_1D TEXTURE_2D PROXY_TEXTURE_1D PROXY_TEXTURE_2D start 被改变的调色板的起始调色板索引项目。 count 被改变的调色板
中
从 start 开始的调色板索引项目的数目。count
参数
确定了被改变的调色板
中
调色板索引项目的范围。 format (等待编辑) type data的数据类型 ,可选以下符号常量:
GL
_UNSIGNED_BYTE
GL
_BYTE
GL
_UNSIGNED_SHORT
GL
_SHORT
GL
_UNSIGNED_INT
GL
_INT
GL
_UNSIGNED_FLOAT
GL
_FLOAT data 指向调色板纹理数据的指针。对于调色板项目 ,数据作为一维纹理调色板项目
中
的单个像素进行处理。 绘制几何图形 -----------------------------
gl
Vertex
gl
VertexPointer
gl
ArrayElement
gl
Begin ,
gl
End
gl
EdgeFlag ,
gl
EdgeFlagv
gl
PointSize
gl
LineWidth
gl
LineStipple
gl
PolygonMode
gl
FrontFace
gl
PolygonStipple
gl
DrawElements
gl
Rect 坐标转换 -----------------------------
gl
Translate
gl
Rotate
gl
Scale
gl
ViewPoint
gl
Frustum
gl
Ortho
gl
ClipPlane 堆栈操作 ------------------------------
gl
LoadMatrix
gl
MultMatrix
gl
MatrixMode
gl
PushMatrix ,
gl
PopMatrix
gl
PushAttrib ,
gl
PopAttrib
gl
PushName ,
gl
PopName
gl
InitName
gl
LoadName 1.
GL
函数库(续) =============================== 显示列表 -----------------------------
gl
NewList ,
gl
EndList
gl
CallList
gl
CallLists
gl
GenLists
gl
DeleteLists
gl
IsList 使用光照和材质 -----------------------------
gl
Normal
gl
NormalPointer
gl
Light
gl
LightModel
gl
Material
gl
ColorMaterial 像素操作 ------------------------------
gl
Raster
Pos
gl
Bitmap
gl
Read
Pixels
gl
Draw
Pixels
gl
Copy
Pixels
gl
Copy
TexImage1D
gl
Copy
TexImage2D
gl
Copy
TexSubImage1D
gl
Copy
TexSubImage2D
gl
PixelZoom
gl
PixelS
tore
gl
PixelTransfer
gl
PixelMap 纹理映射 -----------------------------
gl
TexImage1D
gl
TexImage2D
gl
TexParameter
gl
TexSubImage1D
gl
TexSubImage2D
gl
TexEnv
gl
TexCoord
gl
TexGen
gl
TexCoordPointer
gl
DeleteTextures 特效操作 ----------------------------
gl
BlendFunc
gl
Hint
gl
Fog 1.
GL
库函数(续2) ============================= 帧缓存操作 -----------------------------
gl
Clear
gl
ClearAccum
gl
ClearColor
gl
ClearDepth
gl
ClearIndex
gl
ClearStencil
gl
DrawBuffer
gl
IndexMask
gl
ColorMask
gl
DepthMask
gl
StencilMask
gl
AlphaFunc
gl
StencilFunc
gl
StencilOp
gl
DepthFunc
gl
DepthRange
gl
LogicOp
gl
Accum 曲线或曲面绘制 ------------------------------
gl
EvalCoord
gl
Map1
gl
Map2
gl
MapGrid
gl
EvalMesh
gl
EvalPoint 查询函数 -----------------------------
gl
Get
gl
GetClipPlane
gl
GetColorTableEXT
gl
GetColorTableParameterfvEXT ,
gl
GetColorTableParameterivEXT
gl
GetError
gl
GetLight
gl
GetMap
gl
GetMaterial
gl
GetPixelMap
gl
GetPointerv
gl
GetPolygonStipple
gl
GetString
gl
GetTexEnv
gl
GetTexImage
gl
GetTexLevelParameter
gl
GetTexParameter 2.
GL
U 库函数 ============================ 绘制 NURBS 曲线和曲面 ------------------------------
gl
uNewNurbsRenderer
gl
uNurbsProperty
gl
uNurbsCallback
gl
uBeginCurve ,
gl
uEndCurve
gl
uNurbsCurve
gl
uDeleteNurbsRenderer
gl
uBeginSurface ,
gl
uEndSurface
gl
uNurbsSurface
gl
uBeginTrim ,
gl
uEndTrim
gl
uPwlCurve
gl
uBeginPolygon ,
gl
uEndPolygon
gl
uPickMatrix 绘制二次几何物体 ---------------------------------
gl
uNewQuadric
gl
uQuadricDrawStyle
gl
uQuadricNormals
gl
uQuadricOrientation
gl
uCylinder
gl
uSphere
gl
uDisk
gl
uPartialDisk
gl
uDeleteQuadric
gl
uQuadricTexture
gl
uQuadricCallback 网格化 ------------------------------
gl
uNewTess
gl
uTessVertex
gl
uTessCallback
gl
uTessBeginPolygon ,
gl
uTessEndPolygon
gl
uTessBeginContour ,
gl
uTessBeginContour
gl
uTessProperty
gl
uNextContour
gl
uTessNormal
gl
uDeleteTess 坐标转换 ------------------------------
gl
uOrtho2D
gl
uPerspective
gl
uLookAt
gl
uProject
gl
uUnProject 多重映射 ------------------------------
gl
uBuild1DMipmaps
gl
uBuild2DMipmaps
gl
uScaleImage 查询函数 -----------------------------
gl
uErrorString
gl
uGetNurbsProperty
gl
uGetString
gl
uGetTessProperty 3.
GL
UT 库函数 ============================= 初始化和启动事件处理 -------------------------
gl
utInit
gl
utInitWindow
Pos
ition
gl
utInitWindowSize
gl
utInitDisplayMode
gl
utMainLoop 窗口管理 -------------------------
gl
utCreateWindow
gl
utCreateSubWindow
gl
utHideWindow
gl
utShowWindow
gl
utSetWindowTitle
gl
ut
Pos
tRedisplay
gl
utSwapBuffers
gl
utFullScreen
gl
ut
Pos
itionWindow
gl
utReshapeWindow
gl
utSetWindow
gl
utGetWindow
gl
utPopWindow
gl
utPushWindow
gl
utDestroyWindow
gl
utIconifyWindow
gl
utSetCursor 重叠层管理 -------------------------
gl
utEstablishOverlay
gl
utUseLayer
gl
utRemoveOverlay
gl
ut
Pos
tOverlayRedisplay
gl
utShowOverlay
gl
utHideOverlay 菜单管理 -------------------------
gl
utCreateMenu
gl
utAddMenuEntry
gl
utAddSubMenu
gl
utAttachMenu
gl
utGetMenu
gl
utSetMenu
gl
utDestroyMenu
gl
utChangeToMenuEntry
gl
utChangeToSubMenu
gl
utRemoveMenuItem
gl
utDetachMenu 3.
GL
UT 库函数(续) =============================== 注册回调函数 -------------------------------
gl
utDisplayFunc
gl
utReshapeFunc
gl
utMouseFunc
gl
utMotionFunc
gl
utIdleFunc
gl
utVisibilityFunc
gl
utKeyboardFunc
gl
utSpecialFunc
gl
utOverlayDisplayFunc
gl
utPassiveMotionFunc
gl
utEntryFunc
gl
utSpaceballMotionFunc
gl
utSpaceballRotateFunc
gl
utSpaceballButtonFunc
gl
utButtonBoxFunc
gl
utDialsFunc
gl
utTableMotionFunc
gl
utTableButtonFunc
gl
utMenuStatusFunc
gl
utTimerFunc 颜色索引映射表管理 -------------------------------
gl
utSetColor
gl
utGetColor
gl
ut
Copy
Colormap 状态检索 -------------------------------
gl
utGet
gl
utLayerGet
gl
utDeviceGet
gl
utGetModifiers
gl
utExtensionSupported 字体绘制 -------------------------------
gl
utBitmapCharacter
gl
utBitmapWidth
gl
utStrokeCharacter
gl
utStrokeWidth 几何图形绘制 -------------------------------
gl
utSolidSphere ,
gl
utWireSphere
gl
utSolidCube ,
gl
utWireCube
gl
utSolidCone ,
gl
utWireCone
gl
utSolidTorus ,
gl
utWireTorus
gl
utSolidDodecahedron ,
gl
utWireDodecahedron
gl
utSolidOctahedron ,
gl
utWireOctahedron
gl
utSolidTetrahedron ,
gl
utWireTetrahedron
gl
utSolieIcosahedron ,
gl
utWireIcosahedron
gl
utSolidTeapot ,
gl
utWireTeapot
Open
GL
中
位图的操作(
gl
Read
Pixels
,
gl
Draw
Pixels
和
gl
Copy
Pixels
应用举例)
gl
Read
Pixels
,
gl
Draw
Pixels
和
gl
Copy
Pixels
Open
GL
如何利用
gl
Copy
Pixels
复制图像
void displayShape() {
gl
Clear(
GL
_COLOR_BUFFER_BIT);
gl
Color3f(0.0f, 1.0f, 0.0f);
GL
int iSize = sizeof(point) / sizeof(point[0]);
gl
Begin(
GL
_TRIAN
GL
ES); for(
GL
int i = 0; i < iSize;
Open
GL
FrameBuffer
Copy
相关Api比较(
gl
Copy
Pixels
,
gl
Read
Pixels
,
gl
Copy
TexImage2D,
gl
FramebufferTexture2D)
Open
GL
FrameBuffer
Copy
相关Api比较
gl
Copy
Pixels
,
gl
Read
Pixels
,
gl
Copy
TexImage2D,
gl
FramebufferTexture2D标题所述的
open
GL
api都是与提取frame buffer
中
的像素有关,那么它们有何区别呢? 1.void
gl
Copy
Pixels
(
GL
int x,
GL
int y,
GL
sizei width, G
Open
GL
中
的函数
open
GL
函数 收集
gl
Viewport()函数 在
Open
GL
初始化完成之后,我们应该进行一些视图设置。首先是设定视见区域,即告诉
Open
GL
应把渲染之后的图形绘制在窗体的哪个部位。当视见区域是整个窗体时,
Open
GL
将把渲染结果绘制到整个窗口。我们调用
gl
ViewPort函数来决定视见区域: procedure
gl
ViewPort(x:
GL
Int;y:
GL
Int;Width:
机器视觉
4,445
社区成员
15,335
社区内容
发帖
与我相关
我的任务
机器视觉
图形图像/机器视觉
复制链接
扫一扫
分享
社区描述
图形图像/机器视觉
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章