![]() |
OpenCV 4.10.0
开源计算机视觉
|
用于 OpenGL 2D 纹理内存的智能指针,具有引用计数。 更多...
#include <opencv2/core/opengl.hpp>
公共类型 | |
| 枚举 | Format { NONE = 0 , DEPTH_COMPONENT = 0x1902 , RGB = 0x1907 , RGBA = 0x1908 } |
| 图像格式描述了纹理中的图像存储数据的方式。 更多... | |
公共成员函数 | |
| Texture2D () | |
| 构造函数。 | |
| Texture2D (InputArray arr, bool autoRelease=false) | |
| Texture2D (int arows, int acols, Format aformat, bool autoRelease=false) | |
| Texture2D (int arows, int acols, Format aformat, unsigned int atexId, bool autoRelease=false) | |
| Texture2D (Size asize, Format aformat, bool autoRelease=false) | |
| Texture2D (Size asize, Format aformat, unsigned int atexId, bool autoRelease=false) | |
| void | bind () const |
| 将纹理绑定到当前活动的纹理单元,用于 GL_TEXTURE_2D 目标。 | |
| int | cols () const |
| void | copyFrom (InputArray arr, bool autoRelease=false) |
| 从主机/设备内存复制到 OpenGL 纹理。 | |
| void | copyTo (OutputArray arr, int ddepth=CV_32F, bool autoRelease=false) const |
| 从 OpenGL 纹理复制到主机/设备内存或另一个 OpenGL 纹理对象。 | |
| void | create (int arows, int acols, Format aformat, bool autoRelease=false) |
| 为 ogl::Texture2D 对象分配内存。 | |
| void | create (Size asize, Format aformat, bool autoRelease=false) |
| bool | empty () const |
| Format | format () const |
| void | release () |
| 递减引用计数,如果需要则销毁纹理对象。 | |
| int | rows () const |
| void | setAutoRelease (bool flag) |
| 设置自动释放模式。 | |
| Size | size () const |
| unsigned int | texId () const |
| 获取 OpenGL 对象 ID | |
用于 OpenGL 2D 纹理内存的智能指针,具有引用计数。
| cv::ogl::Texture2D::Texture2D | ( | ) |
构造函数。
创建空的 ogl::Texture2D 对象,为 ogl::Texture2D 对象分配内存,或从主机/设备内存复制。
| cv::ogl::Texture2D::Texture2D | ( | int | arows, |
| int | acols, | ||
| Format | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false |
||
| ) |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| cv::ogl::Texture2D::Texture2D | ( | Size | asize, |
| Format | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false |
||
| ) |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| cv::ogl::Texture2D::Texture2D | ( | int | arows, |
| int | acols, | ||
| Format | aformat, | ||
| bool | autoRelease = false |
||
| ) |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| arows | 行数。 |
| acols | 列数。 |
| aformat | 图像格式。参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| asize | 2D 数组大小。 |
| aformat | 图像格式。参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
|
explicit |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| arr | 输入数组(主机或设备内存,可以是 Mat 、cuda::GpuMat 或 ogl::Buffer)。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
| void cv::ogl::Texture2D::bind | ( | ) | const |
将纹理绑定到当前活动的纹理单元,用于 GL_TEXTURE_2D 目标。
| int cv::ogl::Texture2D::cols | ( | ) | const |
| void cv::ogl::Texture2D::copyFrom | ( | InputArray | arr, |
| bool | autoRelease = false |
||
| ) |
从主机/设备内存复制到 OpenGL 纹理。
| arr | 输入数组(主机或设备内存,可以是 Mat 、cuda::GpuMat 或 ogl::Buffer)。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
| void cv::ogl::Texture2D::copyTo | ( | OutputArray | arr, |
| int | ddepth = CV_32F, |
||
| bool | autoRelease = false |
||
| ) | const |
从 OpenGL 纹理复制到主机/设备内存或另一个 OpenGL 纹理对象。
| arr | 目标数组(主机或设备内存,可以是 Mat 、cuda::GpuMat 、ogl::Buffer 或 ogl::Texture2D)。 |
| ddepth | 目标深度。 |
| autoRelease | 目标缓冲区的自动释放模式(如果 arr 是 OpenGL 缓冲区或纹理)。 |
| void cv::ogl::Texture2D::create | ( | int | arows, |
| int | acols, | ||
| Format | aformat, | ||
| bool | autoRelease = false |
||
| ) |
为 ogl::Texture2D 对象分配内存。
| arows | 行数。 |
| acols | 列数。 |
| aformat | 图像格式。参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
这是一个重载的成员函数,为了方便提供。它与上面的函数的不同之处仅在于它接受的参数。
| asize | 2D 数组大小。 |
| aformat | 图像格式。参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
| bool cv::ogl::Texture2D::empty | ( | ) | const |
| Format cv::ogl::Texture2D::format | ( | ) | const |
| void cv::ogl::Texture2D::release | ( | ) |
递减引用计数,如果需要则销毁纹理对象。
该函数将调用 setAutoRelease(true) 。
| int cv::ogl::Texture2D::rows | ( | ) | const |
| void cv::ogl::Texture2D::setAutoRelease | ( | bool | flag | ) |
设置自动释放模式。
| flag | 自动释放模式(如果为 true,则在对象的析构函数中将调用 release)。 |
OpenGL 对象的生命周期与上下文的生命周期绑定在一起。如果 OpenGL 上下文绑定到窗口,则它可以随时被释放(用户可以关闭窗口)。如果在上下文销毁后调用对象的析构函数,则会导致错误。因此,默认情况下,ogl::Texture2D 在析构函数中不会销毁 OpenGL 对象(所有 OpenGL 资源将在 OpenGL 上下文释放时释放)。此函数可以强制 ogl::Texture2D 析构函数销毁 OpenGL 对象。
| Size cv::ogl::Texture2D::size | ( | ) | const |
| unsigned int cv::ogl::Texture2D::texId | ( | ) | const |
获取 OpenGL 对象 ID
1.9.8 生成