OpenCV 4.12.0
开源计算机视觉
加载中...
搜索中...
无匹配项
cv::ogl::Texture2D 类参考

用于具有引用计数的 OpenGL 2D 纹理内存的智能指针。 更多...

#include <opencv2/core/opengl.hpp>

cv::ogl::Texture2D 的协作图

公共类型

枚举  格式 {
  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 纹理内存的智能指针。

成员枚举文档

◆ Format

图像格式描述了纹理中图像存储数据的方式。

枚举器
NONE 
DEPTH_COMPONENT 

深度。

RGB 

红、绿、蓝。

RGBA 

红、绿、蓝、Alpha。

构造函数 & 析构函数文档

◆ Texture2D() [1/6]

cv::ogl::Texture2D::Texture2D ( )

构造函数。

创建空的 ogl::Texture2D 对象,为 ogl::Texture2D 对象分配内存,或从主机/设备内存复制。

◆ Texture2D() [2/6]

cv::ogl::Texture2D::Texture2D ( int arows,
int acols,
格式 aformat,
unsigned int atexId,
bool autoRelease = false )

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

◆ Texture2D() [3/6]

cv::ogl::Texture2D::Texture2D ( Size asize,
格式 aformat,
unsigned int atexId,
bool autoRelease = false )

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

◆ Texture2D() [4/6]

cv::ogl::Texture2D::Texture2D ( int arows,
int acols,
格式 aformat,
bool autoRelease = false )

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

参数
arows行数。
acols列数。
aformat图像格式。 请参见 cv::ogl::Texture2D::Format
autoRelease自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

◆ Texture2D() [5/6]

cv::ogl::Texture2D::Texture2D ( Size asize,
格式 aformat,
bool autoRelease = false )

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

参数
asize2D 数组大小。
aformat图像格式。 请参见 cv::ogl::Texture2D::Format
autoRelease自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

◆ Texture2D() [6/6]

cv::ogl::Texture2D::Texture2D ( InputArray arr,
bool autoRelease = false )
显式

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

参数
arr输入数组(主机或设备内存,可以是 Matcuda::GpuMatogl::Buffer )。
autoRelease自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

成员函数文档

◆ bind()

void cv::ogl::Texture2D::bind ( ) const

将纹理绑定到当前活动纹理单元以用于 GL_TEXTURE_2D 目标。

◆ cols()

int cv::ogl::Texture2D::cols ( ) const

◆ copyFrom()

void cv::ogl::Texture2D::copyFrom ( InputArray arr,
bool autoRelease = false )

从主机/设备内存复制到 OpenGL 纹理。

参数
arr输入数组(主机或设备内存,可以是 Matcuda::GpuMatogl::Buffer )。
autoRelease自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

◆ copyTo()

void cv::ogl::Texture2D::copyTo ( OutputArray arr,
int ddepth = CV_32F,
bool autoRelease = false ) const

从 OpenGL 纹理复制到主机/设备内存或另一个 OpenGL 纹理对象。

参数
arr目标数组(主机或设备内存,可以是 Matcuda::GpuMatogl::Bufferogl::Texture2D )。
ddepth目标深度。
autoRelease目标缓冲区的自动释放模式(如果 arr 是 OpenGL 缓冲区或纹理)。

◆ create() [1/2]

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)。

◆ create() [2/2]

void cv::ogl::Texture2D::create ( Size asize,
格式 aformat,
bool autoRelease = false )

这是一个重载的成员函数,为方便起见而提供。 它与上面的函数不同之处仅在于它接受的参数。

参数
asize2D 数组大小。
aformat图像格式。 请参见 cv::ogl::Texture2D::Format
autoRelease自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

◆ empty()

bool cv::ogl::Texture2D::empty ( ) const

◆ format()

Format cv::ogl::Texture2D::format ( ) const

◆ release()

void cv::ogl::Texture2D::release ( )

减少引用计数器,并在需要时销毁纹理对象。

该函数将调用 setAutoRelease(true) 。

◆ rows()

int cv::ogl::Texture2D::rows ( ) const

◆ setAutoRelease()

void cv::ogl::Texture2D::setAutoRelease ( bool flag)

设置自动释放模式。

参数
flag自动释放模式(如果为 true,则将在对象的析构函数中调用 release)。

OpenGL 对象的生命周期与上下文的生命周期相关联。 如果 OpenGL 上下文绑定到窗口,则可以在任何时候释放(用户可以关闭窗口)。 如果在上下文销毁后调用对象的析构函数,将会导致错误。 因此,默认情况下, ogl::Texture2D 不会在析构函数中销毁 OpenGL 对象(所有 OpenGL 资源将与 OpenGL 上下文一起释放)。 此函数可以强制 ogl::Texture2D 析构函数销毁 OpenGL 对象。

◆ size()

Size cv::ogl::Texture2D::size ( ) const

◆ texId()

unsigned int cv::ogl::Texture2D::texId ( ) const

获取 OpenGL 对象 ID


此类文档是从以下文件生成的