11#include<opencv2/opencv.hpp>
42 bool open(
const std::string &filename);
50 bool open(
int id,
int mode=0);
85 void draw(
int x,
int y,
int width,
int height);
92 void draw(
int x,
int y);
100 bool reload(
const std::string &vert,
const std::string &frag);
120 void set(
unsigned int option,
double value);
127 double get(
unsigned int option);
130 std::unique_ptr<gl::ShaderProgram>
shader;
A textured screen-space quad drawn with an OpenGL shader.
SDL2 + OpenGL/ES window with event loop and console support.
void close()
Close the video source.
MXCapture()=default
Default constructor.
MXCapture & operator=(const MXCapture &)=delete
double get(unsigned int option)
Query a VideoCapture property.
void set(unsigned int option, double value)
Set a VideoCapture property.
bool reload(const std::string &vert, const std::string &frag)
Replace the shader pair without reopening the source.
MXCapture & operator=(MXCapture &&)=delete
MXCapture(const MXCapture &)=delete
~MXCapture()=default
Destructor.
bool open(const std::string &filename)
Open a video file for capture.
gl::GLSprite * getSprite()
Access the internal sprite.
MXCapture(MXCapture &&)=delete
cv::Mat frame
Most recent decoded frame.
gl::GLWindow * window
Parent GL window.
void draw(int x, int y, int width, int height)
Draw the most recently captured frame.
cv::VideoCapture cap
OpenCV capture device.
gl::GLSprite sprite
Rendering sprite.
std::unique_ptr< gl::ShaderProgram > shader
Active shader program.
bool read()
Grab and decode the next frame from the source.
bool createImage(gl::GLWindow *window, size_t width, size_t height, const std::string &vert, const std::string &frag)
Create the backing sprite/texture for displaying frames.
bool is_open() const
Check whether the capture source is open.
OpenGL window, shader program, sprite, and text rendering classes.