#include <rendervideocomponent.h>
Public Member Functions | |
RenderVideoComponentInstance (EntityInstance &entity, Component &resource) | |
virtual bool | init (utility::ErrorState &errorState) override |
virtual bool | isSupported (nap::CameraComponentInstance &camera) const override |
Texture2D & | getOutputTexture () |
void | draw () |
![]() | |
RenderableComponentInstance (EntityInstance &entity, Component &resource) | |
void | draw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix) |
void | setVisible (bool visible) |
bool | isVisible () const |
const std::vector< ResourcePtr< RenderTag > > & | getTags () const |
RenderMask | getMask () const |
bool | includesMask (RenderMask otherMask) |
int | getRank () const |
const RenderLayer * | getLayer () const |
![]() | |
ComponentInstance (EntityInstance &entity, Component &resource) | |
virtual void | update (double deltaTime) |
nap::EntityInstance * | getEntityInstance () const |
nap::Component * | getComponent () const |
template<typename T > | |
T * | getComponent () const |
virtual bool | init (utility::ErrorState &errorState) |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Protected Member Functions | |
virtual void | onDraw (IRenderTarget &renderTarget, VkCommandBuffer commandBuffer, const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix) override |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
![]() | |
RenderService * | mRenderService = nullptr |
Renders the output of a nap::VideoPlayer directly to texture without having to define a render target, shader or mesh. This components converts the YUV textures, generated by the nap::VideoPlayer, into an RGB texture. Call draw() in your application render() call, in between nap::RenderService::beginHeadlessRecording() and nap::RenderService::endHeadlessRecording(). The video frame is scaled to fit the dimensions of the given output texture. It is still possible to render this component using the render service, although only orthographic cameras are supported.
RenderVideoComponentInstance | ( | EntityInstance & | entity, |
Component & | resource | ||
) |
void draw | ( | ) |
Renders the output of a nap::VideoPlayer directly to texture. This components converts the YUV textures, generated by the nap::VideoPlayer, into an RGB texture. Call this in your application render() call, in between nap::RenderService::beginHeadlessRecording() and nap::RenderService::endHeadlessRecording(). Do not call this function outside of a headless recording pass, ie: when rendering to a window. Alternatively, you can use the render service to render this component, see onDraw()
Texture2D& getOutputTexture | ( | ) |
Returns the rendered RGB video texture.
|
overridevirtual |
Initializes the component based on resource.
errorState | contains the error if initialization fails. |
Reimplemented from RenderableComponentInstance.
|
overridevirtual |
Called by the Render Service. Only orthographic cameras are supported.
Reimplemented from RenderableComponentInstance.
|
overrideprotectedvirtual |
Draws the video frame full screen to the currently active render target, when the view matrix = identity.
renderTarget | the target to render to. |
commandBuffer | the currently active command buffer. |
viewMatrix | often the camera world space location |
projectionMatrix | often the camera projection matrix |
Implements RenderableComponentInstance.