opengl application buffer More...
#include <opengl_application_buffer.h>
Public Member Functions | |
Opengl_application_buffer () | |
default constructor More... | |
virtual | ~Opengl_application_buffer () |
destructor More... | |
virtual mi::math::Vector_struct< mi::Uint32, 2 > | get_resolution () const |
get the buffer resolution. More... | |
virtual mi::Uint32 * | get_z_buffer_ptr () |
get the pointer of Z-buffer. More... | |
void | set_use_color_buffer (bool is_use) |
Set use color buffer (for debug) More... | |
bool | is_use_color_buffer () const |
Is use color buffer (for debug) More... | |
mi::math::Color * | get_color_buffer_ptr () |
Get Color buffer. More... | |
void | set_z_buffer_precision (mi::Uint32 precision) |
Set Z-buffer precision (bits) More... | |
mi::Uint32 | get_z_buffer_precision () const |
Get Z-buffer precision (bits) More... | |
void | resize_buffer (mi::math::Vector_struct< mi::Uint32, 2 > const &new_resolution) |
resize the buffer. More... | |
void | clear_buffer () |
clear buffer More... | |
bool | is_buffer_allocated () const |
is buffer allocated More... | |
bool | debug_write_buffer_to_file (nv::index::app::IApplication_layer *app_layer, std::string const &fname) |
debug: dump RGBA and Z to ppm image (no alpha) More... | |
Static Public Member Functions | |
static mi::Sint32 | get_pixel_index (mi::Sint32 width, mi::Sint32 height, mi::Sint32 x, mi::Sint32 y) |
get pixel index. Assume buffer size is less than 2G. More... | |
opengl application buffer
This implementation has no dependency to OpenGL.
Definition at line 21 of file opengl_application_buffer.h.
Opengl_application_buffer::Opengl_application_buffer | ( | ) |
default constructor
Definition at line 16 of file opengl_application_buffer.cpp.
|
virtual |
destructor
Definition at line 28 of file opengl_application_buffer.cpp.
void Opengl_application_buffer::clear_buffer | ( | ) |
clear buffer
Definition at line 100 of file opengl_application_buffer.cpp.
bool Opengl_application_buffer::debug_write_buffer_to_file | ( | nv::index::app::IApplication_layer * | app_layer, |
std::string const & | fname | ||
) |
debug: dump RGBA and Z to ppm image (no alpha)
[in] | app_layer | application layer interface to use image component |
[in] | fname | output file basename. {fname}.rgba.ppm, and {fname}.z.ppm file will be created. |
Definition at line 135 of file opengl_application_buffer.cpp.
mi::math::Color * Opengl_application_buffer::get_color_buffer_ptr | ( | ) |
Get Color buffer.
Definition at line 59 of file opengl_application_buffer.cpp.
|
inlinestatic |
get pixel index. Assume buffer size is less than 2G.
Definition at line 82 of file opengl_application_buffer.h.
mi::Uint32 Opengl_application_buffer::get_z_buffer_precision | ( | ) | const |
Get Z-buffer precision (bits)
Definition at line 81 of file opengl_application_buffer.cpp.
bool Opengl_application_buffer::is_buffer_allocated | ( | ) | const |
is buffer allocated
Definition at line 124 of file opengl_application_buffer.cpp.
bool Opengl_application_buffer::is_use_color_buffer | ( | ) | const |
Is use color buffer (for debug)
Definition at line 47 of file opengl_application_buffer.cpp.
void Opengl_application_buffer::resize_buffer | ( | mi::math::Vector_struct< mi::Uint32, 2 > const & | new_resolution | ) |
resize the buffer.
usually causing memory allocation.
[in] | new_resolution | new resolution of this buffer. |
Definition at line 87 of file opengl_application_buffer.cpp.
void Opengl_application_buffer::set_use_color_buffer | ( | bool | is_use | ) |
Set use color buffer (for debug)
Definition at line 53 of file opengl_application_buffer.cpp.
void Opengl_application_buffer::set_z_buffer_precision | ( | mi::Uint32 | precision | ) |
Set Z-buffer precision (bits)
[in] | precision | of z-buffer in bits |
Definition at line 65 of file opengl_application_buffer.cpp.