Miam-Player  0.8.0
A nice music player
QtAV::VideoShader Class Reference

The VideoShader class Represents a shader for rendering a video frame. More...

#include <VideoShader.h>

Inheritance diagram for QtAV::VideoShader:
QtAV::ConvolutionShader QtAV::VideoShaderObject QtAV::DynamicShaderObject

Public Member Functions

 VideoShader ()
 
virtual ~VideoShader ()
 
virtual char const *const * attributeNames () const
 attributeNames Array must end with null. More...
 
virtual const char * vertexShader () const
 vertexShader mvp uniform: u_Matrix Vertex shader in: a_Position, a_TexCoordsN (see attributeNames()) Vertex shader out: v_TexCoordsN More...
 
virtual const char * fragmentShader () const
 
virtual void initialize (QOpenGLShaderProgram *shaderProgram=0)
 initialize More...
 
int uniformLocation (const char *name) const
 
int textureLocationCount () const
 textureLocationCount number of texture locations is 1: packed RGB number of channels: yuv or plannar RGB More...
 
int textureLocation (int index) const
 
int matrixLocation () const
 
int colorMatrixLocation () const
 
int opacityLocation () const
 
int channelMapLocation () const
 
int texelSizeLocation () const
 
int textureSizeLocation () const
 
VideoFormat videoFormat () const
 
int textureTarget () const
 
QOpenGLShaderProgram * program ()
 
bool update (VideoMaterial *material)
 update Upload textures, setup uniforms before rendering. More...
 

Protected Member Functions

void rebuildLater ()
 rebuild shader program before next rendering. call this if shader code is updated More...
 
 VideoShader (VideoShaderPrivate &d)
 

Friends

class VideoMaterial
 

Detailed Description

The VideoShader class Represents a shader for rendering a video frame.

Low-level api. Used by OpenGLVideo and Scene Graph. You can also create your own shader. Usually only sampling function and rgb post processing are enough. Transforming color to rgb is done internally. TODO: vertex shader (fully controlled by user?). Mesh

Constructor & Destructor Documentation

◆ VideoShader() [1/2]

QtAV::VideoShader::VideoShader ( )

◆ ~VideoShader()

virtual QtAV::VideoShader::~VideoShader ( )
virtual

◆ VideoShader() [2/2]

QtAV::VideoShader::VideoShader ( VideoShaderPrivate d)
protected

Member Function Documentation

◆ attributeNames()

virtual char const* const* QtAV::VideoShader::attributeNames ( ) const
virtual

attributeNames Array must end with null.

{ position, texcoord, ..., 0}, location is bound to 0, 1, ...

Returns

◆ channelMapLocation()

int QtAV::VideoShader::channelMapLocation ( ) const

◆ colorMatrixLocation()

int QtAV::VideoShader::colorMatrixLocation ( ) const

◆ fragmentShader()

virtual const char* QtAV::VideoShader::fragmentShader ( ) const
virtual

◆ initialize()

virtual void QtAV::VideoShader::initialize ( QOpenGLShaderProgram *  shaderProgram = 0)
virtual

initialize

Parameters
shaderProgram0 means create a shader program internally. if not linked, vertex/fragment shader will be added and linked

◆ matrixLocation()

int QtAV::VideoShader::matrixLocation ( ) const

◆ opacityLocation()

int QtAV::VideoShader::opacityLocation ( ) const

◆ program()

QOpenGLShaderProgram* QtAV::VideoShader::program ( )

◆ rebuildLater()

void QtAV::VideoShader::rebuildLater ( )
protected

rebuild shader program before next rendering. call this if shader code is updated

◆ texelSizeLocation()

int QtAV::VideoShader::texelSizeLocation ( ) const

◆ textureLocation()

int QtAV::VideoShader::textureLocation ( int  index) const

◆ textureLocationCount()

int QtAV::VideoShader::textureLocationCount ( ) const

textureLocationCount number of texture locations is 1: packed RGB number of channels: yuv or plannar RGB

◆ textureSizeLocation()

int QtAV::VideoShader::textureSizeLocation ( ) const

◆ textureTarget()

int QtAV::VideoShader::textureTarget ( ) const

◆ uniformLocation()

int QtAV::VideoShader::uniformLocation ( const char *  name) const

◆ update()

bool QtAV::VideoShader::update ( VideoMaterial material)

update Upload textures, setup uniforms before rendering.

If material type changed, build a new shader program.

◆ vertexShader()

virtual const char* QtAV::VideoShader::vertexShader ( ) const
virtual

vertexShader mvp uniform: u_Matrix Vertex shader in: a_Position, a_TexCoordsN (see attributeNames()) Vertex shader out: v_TexCoordsN

◆ videoFormat()

VideoFormat QtAV::VideoShader::videoFormat ( ) const

Friends And Related Function Documentation

◆ VideoMaterial

friend class VideoMaterial
friend

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