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

The VideoMaterial class Encapsulates rendering state for a video shader program. More...

#include <VideoShader.h>

Public Member Functions

 VideoMaterial ()
 
virtual ~VideoMaterial ()
 
void setCurrentFrame (const VideoFrame &frame)
 
VideoFormat currentFormat () const
 
VideoShadercreateShader () const
 
void initializeShader (VideoShader *shader) const
 
virtual qint32 type () const
 
bool bind ()
 
void unbind ()
 
int compare (const VideoMaterial *other) const
 
bool hasAlpha () const
 
bool isDirty () const
 isDirty More...
 
void setDirty (bool value)
 setDirty Call it after frame is rendered, i.e. More...
 
const QMatrix4x4 & colorMatrix () const
 
const QMatrix4x4 & channelMap () const
 
int bitsPerComponent () const
 
QVector2D vectorTo8bit () const
 
int planeCount () const
 
qreal validTextureWidth () const
 validTextureWidth Value is (0, 1]. More...
 
QSize frameSize () const
 
QSizeF texelSize (int plane) const
 texelSize The size of texture unit More...
 
QVector< QVector2D > texelSize () const
 texelSize For GLSL. More...
 
QSize textureSize (int plane) const
 textureSize It can be used with a uniform to emulate GLSL textureSize() which exists in new versions. More...
 
QVector< QVector2D > textureSize () const
 textureSize For GLSL. More...
 
QRectF normalizedROI (const QRectF &roi) const
 normalizedROI More...
 
QPointF mapToTexture (int plane, const QPointF &p, int normalize=-1) const
 mapToFrame map a point p or a rect r to video texture in a given plane and scaled to valid width. More...
 
QRectF mapToTexture (int plane, const QRectF &r, int normalize=-1) const
 
qreal brightness () const
 
void setBrightness (qreal value)
 
qreal contrast () const
 
void setContrast (qreal value)
 
qreal hue () const
 
void setHue (qreal value)
 
qreal saturation () const
 
void setSaturation (qreal value)
 

Static Public Member Functions

static QString typeName (qint32 value)
 

Protected Member Functions

void bindPlane (int p, bool updateTexture=true)
 
 VideoMaterial (VideoMaterialPrivate &d)
 

Detailed Description

The VideoMaterial class Encapsulates rendering state for a video shader program.

Low-level api. Used by OpenGLVideo and Scene Graph

Constructor & Destructor Documentation

QtAV::VideoMaterial::VideoMaterial ( )
virtual QtAV::VideoMaterial::~VideoMaterial ( )
inlinevirtual
QtAV::VideoMaterial::VideoMaterial ( VideoMaterialPrivate d)
protected

Member Function Documentation

bool QtAV::VideoMaterial::bind ( )
void QtAV::VideoMaterial::bindPlane ( int  p,
bool  updateTexture = true 
)
protected
int QtAV::VideoMaterial::bitsPerComponent ( ) const
qreal QtAV::VideoMaterial::brightness ( ) const
const QMatrix4x4& QtAV::VideoMaterial::channelMap ( ) const
const QMatrix4x4& QtAV::VideoMaterial::colorMatrix ( ) const
int QtAV::VideoMaterial::compare ( const VideoMaterial other) const
qreal QtAV::VideoMaterial::contrast ( ) const
VideoShader* QtAV::VideoMaterial::createShader ( ) const
VideoFormat QtAV::VideoMaterial::currentFormat ( ) const
QSize QtAV::VideoMaterial::frameSize ( ) const
bool QtAV::VideoMaterial::hasAlpha ( ) const
qreal QtAV::VideoMaterial::hue ( ) const
void QtAV::VideoMaterial::initializeShader ( VideoShader shader) const
bool QtAV::VideoMaterial::isDirty ( ) const

isDirty

Returns
true if material type changed, or other properties changed, e.g. 8bit=>10bit (the same material type) and eq
QPointF QtAV::VideoMaterial::mapToTexture ( int  plane,
const QPointF &  p,
int  normalize = -1 
) const

mapToFrame map a point p or a rect r to video texture in a given plane and scaled to valid width.

p or r is in video frame's rect coordinates, no matter which plane is

Parameters
normalize-1: auto(do not normalize for rectangle texture). 0: no. 1: yes
Returns
point or rect in current texture valid coordinates.
See also
validTextureWidth()
QRectF QtAV::VideoMaterial::mapToTexture ( int  plane,
const QRectF &  r,
int  normalize = -1 
) const
QRectF QtAV::VideoMaterial::normalizedROI ( const QRectF &  roi) const

normalizedROI

Parameters
roilogical roi of a video frame. the same as mapToTexture(roi, 1)
int QtAV::VideoMaterial::planeCount ( ) const
qreal QtAV::VideoMaterial::saturation ( ) const
void QtAV::VideoMaterial::setBrightness ( qreal  value)
void QtAV::VideoMaterial::setContrast ( qreal  value)
void QtAV::VideoMaterial::setCurrentFrame ( const VideoFrame frame)
void QtAV::VideoMaterial::setDirty ( bool  value)

setDirty Call it after frame is rendered, i.e.

after VideoShader::update(VideoMaterial*)

void QtAV::VideoMaterial::setHue ( qreal  value)
void QtAV::VideoMaterial::setSaturation ( qreal  value)
QSizeF QtAV::VideoMaterial::texelSize ( int  plane) const

texelSize The size of texture unit

Returns
(1.0/textureWidth, 1.0/textureHeight)
QVector<QVector2D> QtAV::VideoMaterial::texelSize ( ) const

texelSize For GLSL.

1 for rectangle texture, 1/(width, height) for 2d texture

QSize QtAV::VideoMaterial::textureSize ( int  plane) const

textureSize It can be used with a uniform to emulate GLSL textureSize() which exists in new versions.

QVector<QVector2D> QtAV::VideoMaterial::textureSize ( ) const

textureSize For GLSL.

Not normalized

virtual qint32 QtAV::VideoMaterial::type ( ) const
virtual
static QString QtAV::VideoMaterial::typeName ( qint32  value)
static
void QtAV::VideoMaterial::unbind ( )
qreal QtAV::VideoMaterial::validTextureWidth ( ) const

validTextureWidth Value is (0, 1].

Normalized valid width of a plane. A plane may has padding invalid data at the end for aligment.

Use this value to reduce texture coordinate computation.

| | | | valid width | |

| | |

| <- aligned width ->|

Returns
valid width ratio
QVector2D QtAV::VideoMaterial::vectorTo8bit ( ) const

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