Loading...
Searching...
No Matches
cv::v4d::detail::FrameBufferContext Class Reference

#include <opencv2/v4d/detail/framebuffercontext.hpp>

Inheritance diagram for cv::v4d::detail::FrameBufferContext:
cv::v4d::detail::V4DContext

Classes

class  FrameBufferScope
 
class  GLScope
 

Public Member Functions

 FrameBufferContext (V4D &v4d, const cv::Size &frameBufferSize, bool offscreen, const string &title, int major, int minor, int samples, bool debug, GLFWwindow *sharedWindow, const FrameBufferContext *parent)
 
 FrameBufferContext (V4D &v4d, const string &title, const FrameBufferContext &other)
 
virtual ~FrameBufferContext ()
 
void blitFrameBufferToFrameBuffer (const cv::Rect &srcViewport, const cv::Size &targetFbSize, GLuint targetFramebufferID=0, bool stretch=true, bool flipY=false)
 
void close ()
 
void copyFrom (const cv::UMat &src)
 
void copyTo (cv::UMat &dst)
 
virtual void execute (std::function< void()> fn) override
 
void fence ()
 
CLExecContext_tgetCLExecContext ()
 
GLuint getFramebufferID ()
 
cv::Size getNativeFrameBufferSize ()
 
GLuint getTextureID ()
 
cv::Size getWindowSize ()
 
bool isClosed ()
 
bool isFullscreen ()
 
bool isResizable ()
 
bool isShared ()
 
bool isVisible ()
 
void makeCurrent ()
 
void makeNoneCurrent ()
 
float pixelRatioX ()
 
float pixelRatioY ()
 
cv::Vec2f position ()
 
cv::Ptr< FrameBufferContextself ()
 
void setFullscreen (bool f)
 
void setResizable (bool r)
 
void setVisible (bool v)
 
void setWindowSize (const cv::Size &sz)
 
const cv::Sizesize () const
 
bool wait (const uint64_t &timeout=0)
 
- Public Member Functions inherited from cv::v4d::detail::V4DContext
virtual ~V4DContext ()
 
virtual void execute (std::function< void()> fn)=0
 

Protected Member Functions

void doWebGLCopy (cv::Ptr< FrameBufferContext > other)
 
GLFWwindow * getGLFWWindow ()
 
int getIndex ()
 
cv::ogl::Texture2DgetTexture2D ()
 
cv::Ptr< V4DgetV4D ()
 
void initWebGLCopy (const size_t &index)
 
void setup ()
 
void teardown ()
 

Friends

class cv::v4d::V4D
 
class GLContext
 
class ImGuiContextImpl
 
class NanoVGContext
 
class SinkContext
 
class SourceContext
 

Detailed Description

The FrameBufferContext acquires the framebuffer from OpenGL (either by up-/download or by cl-gl sharing)

Constructor & Destructor Documentation

◆ FrameBufferContext() [1/2]

cv::v4d::detail::FrameBufferContext::FrameBufferContext ( V4D v4d,
const cv::Size frameBufferSize,
bool  offscreen,
const string &  title,
int  major,
int  minor,
int  samples,
bool  debug,
GLFWwindow *  sharedWindow,
const FrameBufferContext parent 
)

Create a FrameBufferContext with given size.

Parameters
frameBufferSizeThe frame buffer size.

◆ FrameBufferContext() [2/2]

cv::v4d::detail::FrameBufferContext::FrameBufferContext ( V4D v4d,
const string &  title,
const FrameBufferContext other 
)

◆ ~FrameBufferContext()

virtual cv::v4d::detail::FrameBufferContext::~FrameBufferContext ( )
virtual

Default destructor.

Member Function Documentation

◆ blitFrameBufferToFrameBuffer()

void cv::v4d::detail::FrameBufferContext::blitFrameBufferToFrameBuffer ( const cv::Rect srcViewport,
const cv::Size targetFbSize,
GLuint  targetFramebufferID = 0,
bool  stretch = true,
bool  flipY = false 
)

Blit the framebuffer to the screen

Parameters
viewportROI to blit
windowSizeThe size of the window to blit to
stretchif true stretch the framebuffer to window size

◆ close()

void cv::v4d::detail::FrameBufferContext::close ( )

◆ copyFrom()

void cv::v4d::detail::FrameBufferContext::copyFrom ( const cv::UMat src)

◆ copyTo()

void cv::v4d::detail::FrameBufferContext::copyTo ( cv::UMat dst)

◆ doWebGLCopy()

void cv::v4d::detail::FrameBufferContext::doWebGLCopy ( cv::Ptr< FrameBufferContext other)
protected

◆ execute()

virtual void cv::v4d::detail::FrameBufferContext::execute ( std::function< void()>  fn)
inlineoverridevirtual

Execute function object fn inside a framebuffer context. The context acquires the framebuffer from OpenGL (either by up-/download or by cl-gl sharing) and provides it to the functon object. This is a good place to use OpenCL directly on the framebuffer.

Parameters
fnA function object that is passed the framebuffer to be read/manipulated.

Implements cv::v4d::detail::V4DContext.

◆ fence()

void cv::v4d::detail::FrameBufferContext::fence ( )

◆ getCLExecContext()

CLExecContext_t & cv::v4d::detail::FrameBufferContext::getCLExecContext ( )

Get the current OpenCLExecutionContext

Returns
The current OpenCLExecutionContext

◆ getFramebufferID()

GLuint cv::v4d::detail::FrameBufferContext::getFramebufferID ( )

◆ getGLFWWindow()

GLFWwindow * cv::v4d::detail::FrameBufferContext::getGLFWWindow ( )
protected

◆ getIndex()

int cv::v4d::detail::FrameBufferContext::getIndex ( )
protected

◆ getNativeFrameBufferSize()

cv::Size cv::v4d::detail::FrameBufferContext::getNativeFrameBufferSize ( )

◆ getTexture2D()

cv::ogl::Texture2D & cv::v4d::detail::FrameBufferContext::getTexture2D ( )
protected

The UMat used to copy or bind (depending on cl-gl interop capability) the OpenGL framebuffer.

The internal framebuffer exposed as OpenGL Texture2D.

Returns
The texture object.

◆ getTextureID()

GLuint cv::v4d::detail::FrameBufferContext::getTextureID ( )

◆ getV4D()

cv::Ptr< V4D > cv::v4d::detail::FrameBufferContext::getV4D ( )
protected

◆ getWindowSize()

cv::Size cv::v4d::detail::FrameBufferContext::getWindowSize ( )

◆ initWebGLCopy()

void cv::v4d::detail::FrameBufferContext::initWebGLCopy ( const size_t &  index)
protected

◆ isClosed()

bool cv::v4d::detail::FrameBufferContext::isClosed ( )

◆ isFullscreen()

bool cv::v4d::detail::FrameBufferContext::isFullscreen ( )

◆ isResizable()

bool cv::v4d::detail::FrameBufferContext::isResizable ( )

◆ isShared()

bool cv::v4d::detail::FrameBufferContext::isShared ( )

◆ isVisible()

bool cv::v4d::detail::FrameBufferContext::isVisible ( )

◆ makeCurrent()

void cv::v4d::detail::FrameBufferContext::makeCurrent ( )

◆ makeNoneCurrent()

void cv::v4d::detail::FrameBufferContext::makeNoneCurrent ( )

◆ pixelRatioX()

float cv::v4d::detail::FrameBufferContext::pixelRatioX ( )

◆ pixelRatioY()

float cv::v4d::detail::FrameBufferContext::pixelRatioY ( )

◆ position()

cv::Vec2f cv::v4d::detail::FrameBufferContext::position ( )

◆ self()

cv::Ptr< FrameBufferContext > cv::v4d::detail::FrameBufferContext::self ( )
inline

◆ setFullscreen()

void cv::v4d::detail::FrameBufferContext::setFullscreen ( bool  f)

◆ setResizable()

void cv::v4d::detail::FrameBufferContext::setResizable ( bool  r)

◆ setup()

void cv::v4d::detail::FrameBufferContext::setup ( )
protected

◆ setVisible()

void cv::v4d::detail::FrameBufferContext::setVisible ( bool  v)

◆ setWindowSize()

void cv::v4d::detail::FrameBufferContext::setWindowSize ( const cv::Size sz)

◆ size()

const cv::Size & cv::v4d::detail::FrameBufferContext::size ( ) const

Get the framebuffer size.

Returns
The framebuffer size.

◆ teardown()

void cv::v4d::detail::FrameBufferContext::teardown ( )
protected

◆ wait()

bool cv::v4d::detail::FrameBufferContext::wait ( const uint64_t timeout = 0)

Friends And Related Function Documentation

◆ cv::v4d::V4D

friend class cv::v4d::V4D
friend

◆ GLContext

friend class GLContext
friend

◆ ImGuiContextImpl

friend class ImGuiContextImpl
friend

◆ NanoVGContext

friend class NanoVGContext
friend

◆ SinkContext

friend class SinkContext
friend

◆ SourceContext

friend class SourceContext
friend

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