Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 9ee5ef51dbf4a00567f58cff4d0e160c > files > 85

qtmultimedia5-doc-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qabstractvideofilter.cpp -->
  <title>QAbstractVideoFilter Class | Qt Multimedia 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtmultimedia-index.html">Qt Multimedia</a></td><td ><a href="qtmultimedia-modules.html">C++ Classes</a></td><td >QAbstractVideoFilter</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QAbstractVideoFilter Class</h1>
<!-- $$$QAbstractVideoFilter-brief -->
<p>The <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> class represents a filter that is applied to the video frames received by a <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> type. <a href="#details">More...</a></p>
<!-- @@@QAbstractVideoFilter -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QAbstractVideoFilter&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += multimedia</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.5</td></tr></table></div><ul>
<li><a href="qabstractvideofilter-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><a href="qabstractvideofilter.html#active-prop">active</a></b> : bool</li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideofilter.html#QAbstractVideoFilter">QAbstractVideoFilter</a></b>(QObject *<i>parent</i> = Q_NULLPTR)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QVideoFilterRunnable *</td><td class="memItemRight bottomAlign"><b><a href="qabstractvideofilter.html#createFilterRunnable">createFilterRunnable</a></b>() = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideofilter.html#active-prop">isActive</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideofilter.html#active-prop">setActive</a></b>(bool <i>v</i>)</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qabstractvideofilter.html#active-prop">activeChanged</a></b>()</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QAbstractVideoFilter-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> class represents a filter that is applied to the video frames received by a <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> type.</p>
<p><a href="qabstractvideofilter.html">QAbstractVideoFilter</a> provides a convenient way for applications to run image processing, computer vision algorithms or any generic transformation or calculation on the output of a <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> type, regardless of the source (video or camera). By providing a simple interface it allows applications and third parties to easily develop QML types that provide image processing algorithms using popular frameworks like <a href="http://opencv.org">OpenCV</a>. Due to the close integration with the final stages of the Qt Multimedia video pipeline, accelerated and possibly zero-copy solutions are feasible too: for instance, a plugin providing OpenCL-based algorithms can use OpenCL's OpenGL interop to use the OpenGL textures created by a hardware accelerated video decoder, without additional readbacks and copies.</p>
<p><b>Note: </b><a href="qabstractvideofilter.html">QAbstractVideoFilter</a> is not always the best choice. To apply effects or transformations using OpenGL shaders to the image shown on screen, the standard Qt Quick approach of using ShaderEffect items in combination with <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> should be used. VideoFilter is not a replacement for this. It is rather targeted for performing computations (that do not necessarily change the image shown on screen) and computer vision algorithms provided by external frameworks.</p><p><a href="qabstractvideofilter.html">QAbstractVideoFilter</a> is meant to be subclassed. The subclasses are then registered to the QML engine, so they can be used as a QML type. The list of filters are assigned to a <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> type via its <a href="qml-qtmultimedia-videooutput.html#filters-prop">filters</a> property.</p>
<p>A single filter represents one transformation or processing step on a video frame. The output is a modified video frame, some arbitrary data or both. For example, image transformations will result in a different image, whereas an algorithm for detecting objects on an image will likely provide a list of rectangles.</p>
<p>Arbitrary data can be represented as properties on the <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> subclass and on the QObject or QJSValue instances passed to its signals. What exactly these properties and signals are, is up to the individual video filters. Completion of the operations can be indicated by signals. Computations that do not result in a modified image will pass the input image through so that subsequent filters can be placed after them.</p>
<p>Properties set on <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> serve as input to the computation, similarly to how uniform values are specified in ShaderEffect types. The changed property values are taken into use when the next video frame is processed.</p>
<p>The typical usage is to subclass <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> and <a href="qvideofilterrunnable.html">QVideoFilterRunnable</a>:</p>
<pre class="cpp plain">

  class MyFilterRunnable : public QVideoFilterRunnable {
  public:
      QVideoFrame run(QVideoFrame *input, const QVideoSurfaceFormat &amp;surfaceFormat, RunFlags flags) { ..&#x2e; }
  };

  class MyFilter : public QAbstractVideoFilter {
  public:
      QVideoFilterRunnable *createFilterRunnable() { return new MyFilterRunnable; }
  signals:
      void finished(QObject *result);
  };

  int main(int argc, char **argv) {
      ..&#x2e;
      qmlRegisterType&lt;MyFilter&gt;(&quot;my.uri&quot;, 1, 0, &quot;MyFilter&quot;);
      ..&#x2e;
  }

</pre>
<p>MyFilter is thus accessible from QML:</p>
<pre class="cpp plain">

  import my.uri 1.0

  Camera {
      id: camera
  }
  MyFilter {
      id: filter
      // set properties, they can also be animated
      onFinished: console.log(&quot;results of the computation: &quot; + result)
  }
  VideoOutput {
      source: camera
      filters: [ filter ]
      anchors.fill: parent
  }

</pre>
<p>This also allows providing filters in QML plugins, separately from the application.</p>
</div>
<p><b>See also </b><a href="qml-qtmultimedia-videooutput.html">VideoOutput</a>, <a href="qml-multimedia.html#camera">Camera</a>, <a href="qml-qtmultimedia-mediaplayer.html">MediaPlayer</a>, and <a href="qvideofilterrunnable.html">QVideoFilterRunnable</a>.</p>
<!-- @@@QAbstractVideoFilter -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$active-prop$$$isActive$$$setActivebool$$$activeChanged -->
<h3 class="fn" id="active-prop"><a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></h3>
<p>This property holds the active status of the filter.</p>
<p>This is true if the filter is active, false otherwise.</p>
<p>By default filters are active. When set to <code>false</code>, the filter will be ignored by the <a href="qml-qtmultimedia-videooutput.html">VideoOutput</a> type.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isActive</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setActive</b></span>(bool <i>v</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>activeChanged</b></span>()</td></tr>
</table></div>
<!-- @@@active -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QAbstractVideoFilter[overload1]$$$QAbstractVideoFilterQObject* -->
<h3 class="fn" id="QAbstractVideoFilter"><a name="QAbstractVideoFilter"></a>QAbstractVideoFilter::<span class="name">QAbstractVideoFilter</span>(<span class="type">QObject</span> *<i>parent</i> = Q_NULLPTR)</h3>
<p>Constructs a new <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> instance with parent object <i>parent</i>.</p>
<!-- @@@QAbstractVideoFilter -->
<!-- $$$createFilterRunnable[overload1]$$$createFilterRunnable -->
<h3 class="fn" id="createFilterRunnable"><a name="createFilterRunnable"></a><code>[pure virtual] </code><span class="type"><a href="qvideofilterrunnable.html">QVideoFilterRunnable</a></span> *QAbstractVideoFilter::<span class="name">createFilterRunnable</span>()</h3>
<p>Factory function to create a new instance of a <a href="qvideofilterrunnable.html">QVideoFilterRunnable</a> subclass corresponding to this filter.</p>
<p>This function is called on the thread on which the Qt Quick scene graph performs rendering, with the OpenGL context bound. Ownership of the returned instance is transferred: the returned instance will live on the render thread and will be destroyed automatically when necessary.</p>
<p>Typically, implementations of the function will simply construct a new <a href="qvideofilterrunnable.html">QVideoFilterRunnable</a> instance, passing <code>this</code> to the constructor as the filter runnables must know their associated <a href="qabstractvideofilter.html">QAbstractVideoFilter</a> instance to access dynamic properties and optionally emit signals.</p>
<!-- @@@createFilterRunnable -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>