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


此類文件是從以下檔案生成的