![]() |
OpenCV 4.13.0
开源计算机视觉库 (Open Source Computer Vision)
|
带引用计数的 OpenGL 2D 纹理内存的智能指针。更多...
#include <opencv2/core/opengl.hpp>
公开类型 | |
| enum | 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 | 行数, |
| int | 列数, | ||
| Format | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。它与上述函数的区别仅在于所接受的参数不同。
| cv::ogl::Texture2D::Texture2D | ( | Size | 大小, |
| Format | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。它与上述函数的区别仅在于所接受的参数不同。
| cv::ogl::Texture2D::Texture2D | ( | int | 行数, |
| int | 列数, | ||
| Format | aformat, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。它与上述函数的区别仅在于所接受的参数不同。
| 行数 | 行数。 |
| 列数 | 列数。 |
| aformat | 图像格式。请参阅 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,将在对象析构函数中调用 release)。 |
这是一个重载的成员函数,为方便起见而提供。它与上述函数的区别仅在于所接受的参数不同。
| 大小 | 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 | 行数, |
| int | 列数, | ||
| Format | aformat, | ||
| bool | autoRelease = false ) |
为 ogl::Texture2D 对象分配内存。
| 行数 | 行数。 |
| 列数 | 列数。 |
| aformat | 图像格式。请参阅 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,将在对象析构函数中调用 release)。 |
这是一个重载的成员函数,为方便起见而提供。它与上述函数的区别仅在于所接受的参数不同。
| 大小 | 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 | 标志 | ) |
设置自动释放模式。
| 标志 | 自动释放模式(如果为 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