OpenCV  2.4.13
Open Source Computer Vision
cv::ogl::Texture2D Class Reference

Smart pointer for OpenGL 2D texture memory with reference counting. More...

#include <opengl_interop.hpp>

Public Types

enum  Format { NONE = 0, DEPTH_COMPONENT = 0x1902, RGB = 0x1907, RGBA = 0x1908 }
 

Public Member Functions

 Texture2D ()
 create empty texture More...
 
 Texture2D (int arows, int acols, Format aformat, unsigned int atexId, bool autoRelease=false)
 create texture from existed texture id More...
 
 Texture2D (Size asize, Format aformat, unsigned int atexId, bool autoRelease=false)
 
 Texture2D (int arows, int acols, Format aformat, bool autoRelease=false)
 create texture More...
 
 Texture2D (Size asize, Format aformat, bool autoRelease=false)
 
 Texture2D (InputArray arr, bool autoRelease=false)
 copy from host/device memory More...
 
void create (int arows, int acols, Format aformat, bool autoRelease=false)
 create texture More...
 
void create (Size asize, Format aformat, bool autoRelease=false)
 
void release ()
 release memory and delete texture object More...
 
void setAutoRelease (bool flag)
 set auto release mode (if true, release will be called in object's destructor) More...
 
void copyFrom (InputArray arr, bool autoRelease=false)
 copy from host/device memory More...
 
void copyTo (OutputArray arr, int ddepth=CV_32F, bool autoRelease=false) const
 copy to host/device memory More...
 
void bind () const
 bind texture to current active texture unit for GL_TEXTURE_2D target More...
 
int rows () const
 
int cols () const
 
Size size () const
 
bool empty () const
 
Format format () const
 
unsigned int texId () const
 

Detailed Description

Smart pointer for OpenGL 2D texture memory with reference counting.

Member Enumeration Documentation

Enumerator
NONE 
DEPTH_COMPONENT 

Depth.

RGB 

Red, Green, Blue.

RGBA 

Red, Green, Blue, Alpha.

Constructor & Destructor Documentation

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

create empty texture

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

create texture from existed texture id

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 
)

create texture

cv::ogl::Texture2D::Texture2D ( Size  asize,
Format  aformat,
bool  autoRelease = false 
)
cv::ogl::Texture2D::Texture2D ( InputArray  arr,
bool  autoRelease = false 
)
explicit

copy from host/device memory

Member Function Documentation

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

bind texture to current active texture unit for GL_TEXTURE_2D target

int cv::ogl::Texture2D::cols ( ) const
inline
void cv::ogl::Texture2D::copyFrom ( InputArray  arr,
bool  autoRelease = false 
)

copy from host/device memory

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

copy to host/device memory

void cv::ogl::Texture2D::create ( int  arows,
int  acols,
Format  aformat,
bool  autoRelease = false 
)

create texture

void cv::ogl::Texture2D::create ( Size  asize,
Format  aformat,
bool  autoRelease = false 
)
inline
bool cv::ogl::Texture2D::empty ( ) const
inline
Format cv::ogl::Texture2D::format ( ) const
inline
void cv::ogl::Texture2D::release ( )

release memory and delete texture object

int cv::ogl::Texture2D::rows ( ) const
inline
void cv::ogl::Texture2D::setAutoRelease ( bool  flag)

set auto release mode (if true, release will be called in object's destructor)

Size cv::ogl::Texture2D::size ( ) const
inline
unsigned int cv::ogl::Texture2D::texId ( ) const

The documentation for this class was generated from the following file: