![]() |
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