![]() |
OpenCV 4.12.0
开源计算机视觉
|
用于具有引用计数的 OpenGL 2D 纹理内存的智能指针。 更多...
#include <opencv2/core/opengl.hpp>
公共类型 | |
| 枚举 | 格式 { 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, | ||
| 格式 | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。
| cv::ogl::Texture2D::Texture2D | ( | Size | asize, |
| 格式 | aformat, | ||
| unsigned int | atexId, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。
| cv::ogl::Texture2D::Texture2D | ( | int | arows, |
| int | acols, | ||
| 格式 | aformat, | ||
| bool | autoRelease = false ) |
这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。
| arows | 行数。 |
| acols | 列数。 |
| aformat | 图像格式。 请参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。 |
这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。
| asize | 2D 数组大小。 |
| aformat | 图像格式。 请参见 cv::ogl::Texture2D::Format 。 |
| autoRelease | 自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。 |
|
显式 |
这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。
| 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, | ||
| 格式 | 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