![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <opengl_utils.hpp>

Public Member Functions | |
| Texture ()=default | |
| Texture (const Texture &)=delete | |
| Texture (Texture &&o) | |
| ~Texture () | |
| void | allocate () |
| void | allocate (int w, int h, GLint internal_fmt) |
| GLuint | get () const |
| void | load_frame (int w, int h, GLint internal_format, GLenum src_format, GLenum type, video_frame *f, bool pbo_frame) |
| Texture & | operator= (const Texture &)=delete |
| Texture & | operator= (Texture &&o) |
| void | swap (Texture &o) |
Private Attributes | |
| int | height = 0 |
| GLint | internal_format = 0 |
| GLuint | pbo = 0 |
| GLuint | tex_id = 0 |
| int | width = 0 |
RAII wrapper for OpenGL texture object
Definition at line 147 of file opengl_utils.hpp.
|
default |
Constructs an instance containing a new OpenGL texture object
| Texture::~Texture | ( | ) |
Definition at line 234 of file opengl_utils.cpp.
|
delete |
|
inline |
Definition at line 181 of file opengl_utils.hpp.
References swap().

| void Texture::allocate | ( | ) |
Definition at line 291 of file opengl_utils.cpp.
References pbo, pixels, and tex_id.
Referenced by allocate(), and load_frame().
| void Texture::allocate | ( | int | w, |
| int | h, | ||
| GLint | internal_fmt ) |
Allocates the the storage for the texture according to requested resolution and format
| w | width of the image |
| h | height of the image |
| internal_fmt | same as internalformat parameter of glTexImage2D() |
Definition at line 242 of file opengl_utils.cpp.
References allocate(), height, internal_format, tex_id, and width.
Referenced by TripleBufferTexture::allocateTextures(), FlatVideoScene::init(), and FrameUploader::put_frame().

|
inline |
Returns the underlying OpenGL texture id. The texture needs to be allocated first with the allocate member function.
Definition at line 159 of file opengl_utils.hpp.
References tex_id.
Referenced by Framebuffer::attach_texture(), FlatVideoScene::get_texture(), FrameUploader::put_frame(), PanoramaScene::put_frame(), FlatVideoScene::render(), and PanoramaScene::render().
| void Texture::load_frame | ( | int | w, |
| int | h, | ||
| GLint | internal_format, | ||
| GLenum | src_format, | ||
| GLenum | type, | ||
| video_frame * | f, | ||
| bool | pbo_frame ) |
Definition at line 261 of file opengl_utils.cpp.
References allocate(), video_frame::callbacks, tile::data, video_frame_callbacks::dispose_udata, internal_format, pbo, tex_id, video_frame::tiles, and type.

Definition at line 183 of file opengl_utils.hpp.
References swap().

|
inline |
Swaps the contents of two Texture objects
Definition at line 189 of file opengl_utils.hpp.
References height, internal_format, pbo, tex_id, and width.
Referenced by Texture(), operator=(), TripleBufferTexture::swap_back(), and TripleBufferTexture::swap_front().
|
private |
Definition at line 199 of file opengl_utils.hpp.
Referenced by allocate(), and swap().
|
private |
Definition at line 200 of file opengl_utils.hpp.
Referenced by allocate(), load_frame(), and swap().
|
private |
Definition at line 202 of file opengl_utils.hpp.
Referenced by ~Texture(), allocate(), load_frame(), and swap().
|
private |
Definition at line 197 of file opengl_utils.hpp.
Referenced by ~Texture(), allocate(), allocate(), get(), load_frame(), and swap().
|
private |
Definition at line 198 of file opengl_utils.hpp.
Referenced by allocate(), and swap().