OpenCV453
|
Smart pointer for OpenGL 2D texture memory with reference counting. [詳解]
#include <opengl.hpp>
公開型 | |
enum | Format { NONE = 0 , DEPTH_COMPONENT = 0x1902 , RGB = 0x1907 , RGBA = 0x1908 } |
An Image Format describes the way that the images in Textures store their data. [詳解] | |
公開メンバ関数 | |
Texture2D () | |
The constructors. [詳解] | |
Texture2D (int arows, int acols, Format aformat, unsigned int atexId, bool autoRelease=false) | |
Texture2D (Size asize, Format aformat, unsigned int atexId, bool autoRelease=false) | |
Texture2D (int arows, int acols, Format aformat, bool autoRelease=false) | |
Texture2D (Size asize, Format aformat, bool autoRelease=false) | |
Texture2D (InputArray arr, bool autoRelease=false) | |
void | create (int arows, int acols, Format aformat, bool autoRelease=false) |
Allocates memory for ogl::Texture2D object. [詳解] | |
void | create (Size asize, Format aformat, bool autoRelease=false) |
void | release () |
Decrements the reference counter and destroys the texture object if needed. [詳解] | |
void | setAutoRelease (bool flag) |
Sets auto release mode. [詳解] | |
void | copyFrom (InputArray arr, bool autoRelease=false) |
Copies from host/device memory to OpenGL texture. [詳解] | |
void | copyTo (OutputArray arr, int ddepth=CV_32F, bool autoRelease=false) const |
Copies from OpenGL texture to host/device memory or another OpenGL texture object. [詳解] | |
void | bind () const |
Binds texture to current active texture unit for GL_TEXTURE_2D target. | |
int | rows () const |
int | cols () const |
Size | size () const |
bool | empty () const |
Format | format () const |
unsigned int | texId () const |
get OpenGL opject id | |
Smart pointer for OpenGL 2D texture memory with reference counting.
cv::ogl::Texture2D::Texture2D | ( | ) |
The constructors.
Creates empty ogl::Texture2D object, allocates memory for ogl::Texture2D object or copies from host/device memory.
cv::ogl::Texture2D::Texture2D | ( | int | arows, |
int | acols, | ||
Format | aformat, | ||
unsigned int | atexId, | ||
bool | autoRelease = false |
||
) |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
cv::ogl::Texture2D::Texture2D | ( | Size | asize, |
Format | aformat, | ||
unsigned int | atexId, | ||
bool | autoRelease = false |
||
) |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
cv::ogl::Texture2D::Texture2D | ( | int | arows, |
int | acols, | ||
Format | aformat, | ||
bool | autoRelease = false |
||
) |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
arows | Number of rows. |
acols | Number of columns. |
aformat | Image format. See cv::ogl::Texture2D::Format . |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
asize | 2D array size. |
aformat | Image format. See cv::ogl::Texture2D::Format . |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
|
explicit |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
arr | Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ). |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
void cv::ogl::Texture2D::copyFrom | ( | InputArray | arr, |
bool | autoRelease = false |
||
) |
Copies from host/device memory to OpenGL texture.
arr | Input array (host or device memory, it can be Mat , cuda::GpuMat or ogl::Buffer ). |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
void cv::ogl::Texture2D::copyTo | ( | OutputArray | arr, |
int | ddepth = CV_32F , |
||
bool | autoRelease = false |
||
) | const |
Copies from OpenGL texture to host/device memory or another OpenGL texture object.
arr | Destination array (host or device memory, can be Mat , cuda::GpuMat , ogl::Buffer or ogl::Texture2D ). |
ddepth | Destination depth. |
autoRelease | Auto release mode for destination buffer (if arr is OpenGL buffer or texture). |
void cv::ogl::Texture2D::create | ( | int | arows, |
int | acols, | ||
Format | aformat, | ||
bool | autoRelease = false |
||
) |
Allocates memory for ogl::Texture2D object.
arows | Number of rows. |
acols | Number of columns. |
aformat | Image format. See cv::ogl::Texture2D::Format . |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
asize | 2D array size. |
aformat | Image format. See cv::ogl::Texture2D::Format . |
autoRelease | Auto release mode (if true, release will be called in object's destructor). |
void cv::ogl::Texture2D::release | ( | ) |
Decrements the reference counter and destroys the texture object if needed.
The function will call setAutoRelease(true) .
void cv::ogl::Texture2D::setAutoRelease | ( | bool | flag | ) |
Sets auto release mode.
flag | Auto release mode (if true, release will be called in object's destructor). |
The lifetime of the OpenGL object is tied to the lifetime of the context. If OpenGL context was bound to a window it could be released at any time (user can close a window). If object's destructor is called after destruction of the context it will cause an error. Thus ogl::Texture2D doesn't destroy OpenGL object in destructor by default (all OpenGL resources will be released with OpenGL context). This function can force ogl::Texture2D destructor to destroy OpenGL object.