<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qvideoframe.cpp --> <title>Qt 4.8: QVideoFrame Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtmultimedia.html">QtMultimedia</a></li> <li>QVideoFrame</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QVideoFrame Class Reference</h1> <!-- $$$QVideoFrame-brief --> <p>The QVideoFrame class provides a representation of a frame of video data. <a href="#details">More...</a></p> <!-- @@@QVideoFrame --> <pre class="cpp"> <span class="preprocessor">#include <QVideoFrame></span></pre><p>This class was introduced in Qt 4.6.</p> <ul> <li><a href="qvideoframe-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#FieldType-enum">FieldType</a></b> { ProgressiveFrame, TopField, BottomField, InterlacedFrame }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></b> { Format_Invalid, Format_ARGB32, Format_ARGB32_Premultiplied, Format_RGB32, ..., Format_User }</td></tr> </table> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#QVideoFrame">QVideoFrame</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#QVideoFrame-2">QVideoFrame</a></b> ( QAbstractVideoBuffer * <i>buffer</i>, const QSize & <i>size</i>, PixelFormat <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#QVideoFrame-3">QVideoFrame</a></b> ( int <i>bytes</i>, const QSize & <i>size</i>, int <i>bytesPerLine</i>, PixelFormat <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#QVideoFrame-4">QVideoFrame</a></b> ( const QImage & <i>image</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#QVideoFrame-5">QVideoFrame</a></b> ( const QVideoFrame & <i>other</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#dtor.QVideoFrame">~QVideoFrame</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> uchar * </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#bits">bits</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const uchar * </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#bits-2">bits</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#bytesPerLine">bytesPerLine</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#endTime">endTime</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> FieldType </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#fieldType">fieldType</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#handle">handle</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QAbstractVideoBuffer::HandleType </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#handleType">handleType</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#height">height</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#isMapped">isMapped</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#isReadable">isReadable</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#isValid">isValid</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#isWritable">isWritable</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#map">map</a></b> ( QAbstractVideoBuffer::MapMode <i>mode</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QAbstractVideoBuffer::MapMode </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#mapMode">mapMode</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#mappedBytes">mappedBytes</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> PixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#pixelFormat">pixelFormat</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#setEndTime">setEndTime</a></b> ( qint64 <i>time</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#setFieldType">setFieldType</a></b> ( FieldType <i>field</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#setStartTime">setStartTime</a></b> ( qint64 <i>time</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#size">size</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#startTime">startTime</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#unmap">unmap</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#width">width</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVideoFrame & </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#operator-eq">operator=</a></b> ( const QVideoFrame & <i>other</i> )</td></tr> </table> <a name="static-public-members"></a> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QImage::Format </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#imageFormatFromPixelFormat">imageFormatFromPixelFormat</a></b> ( PixelFormat <i>format</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> PixelFormat </td><td class="memItemRight bottomAlign"><b><a href="qvideoframe.html#pixelFormatFromImageFormat">pixelFormatFromImageFormat</a></b> ( QImage::Format <i>format</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QVideoFrame-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QVideoFrame class provides a representation of a frame of video data.</p> <p>A QVideoFrame encapsulates the data of a video frame, and information about the frame.</p> <p>The contents of a video frame can be mapped to memory using the <a href="qvideoframe.html#map">map</a>() function. While mapped the video data can accessed using the <a href="qvideoframe.html#bits">bits</a>() function which returns a pointer to a buffer, the total size of which is given by the <a href="qvideoframe.html#mappedBytes">mappedBytes</a>(), and the size of each line is given by <a href="qvideoframe.html#bytesPerLine">bytesPerLine</a>(). The return value of the <a href="qvideoframe.html#handle">handle</a>() function may be used to access frame data using the internal buffer's native APIs.</p> <p>The video data in a QVideoFrame is encapsulated in a <a href="qabstractvideobuffer.html">QAbstractVideoBuffer</a>. A QVideoFrame may be constructed from any buffer type by subclassing the <a href="qabstractvideobuffer.html">QAbstractVideoBuffer</a> class.</p> <p><b>Note:</b> QVideoFrame is explicitly shared, any change made to video frame will also apply to any copies.</p> </div> <!-- @@@QVideoFrame --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$FieldType$$$ProgressiveFrame$$$TopField$$$BottomField$$$InterlacedFrame --> <h3 class="fn"><a name="FieldType-enum"></a>enum QVideoFrame::<span class="name">FieldType</span></h3> <p>Specifies the field an interlaced video frame belongs to.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QVideoFrame::ProgressiveFrame</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The frame is not interlaced.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::TopField</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The frame contains a top field.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::BottomField</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The frame contains a bottom field.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::InterlacedFrame</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The frame contains a merged top and bottom field.</td></tr> </table> <!-- @@@FieldType --> <!-- $$$PixelFormat$$$Format_Invalid$$$Format_ARGB32$$$Format_ARGB32_Premultiplied$$$Format_RGB32$$$Format_RGB24$$$Format_RGB565$$$Format_RGB555$$$Format_ARGB8565_Premultiplied$$$Format_BGRA32$$$Format_BGRA32_Premultiplied$$$Format_BGR32$$$Format_BGR24$$$Format_BGR565$$$Format_BGR555$$$Format_BGRA5658_Premultiplied$$$Format_AYUV444$$$Format_AYUV444_Premultiplied$$$Format_YUV444$$$Format_YUV420P$$$Format_YV12$$$Format_UYVY$$$Format_YUYV$$$Format_NV12$$$Format_NV21$$$Format_IMC1$$$Format_IMC2$$$Format_IMC3$$$Format_IMC4$$$Format_Y8$$$Format_Y16$$$Format_User --> <h3 class="fn"><a name="PixelFormat-enum"></a>enum QVideoFrame::<span class="name">PixelFormat</span></h3> <p>Enumerates video data types.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_Invalid</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The frame is invalid.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_ARGB32</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The frame is stored using a 32-bit ARGB format (0xAARRGGBB). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_ARGB32</a>.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_ARGB32_Premultiplied</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">The frame stored using a premultiplied 32-bit ARGB format (0xAARRGGBB). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_ARGB32_Premultiplied</a>.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_RGB32</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">The frame stored using a 32-bit RGB format (0xffRRGGBB). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_RGB32</a></td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_RGB24</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">The frame is stored using a 24-bit RGB format (8-8-8). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_RGB888</a></td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_RGB565</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">The frame is stored using a 16-bit RGB format (5-6-5). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_RGB16</a>.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_RGB555</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">The frame is stored using a 16-bit RGB format (5-5-5). This is equivalent to <a href="qimage.html#Format-enum">QImage::Format_RGB555</a>.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_ARGB8565_Premultiplied</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">The frame is stored using a 24-bit premultiplied ARGB format (8-6-6-5).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGRA32</tt></td><td class="topAlign"><tt>8</tt></td><td class="topAlign">The frame is stored using a 32-bit ARGB format (0xBBGGRRAA).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGRA32_Premultiplied</tt></td><td class="topAlign"><tt>9</tt></td><td class="topAlign">The frame is stored using a premultiplied 32bit BGRA format.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGR32</tt></td><td class="topAlign"><tt>10</tt></td><td class="topAlign">The frame is stored using a 32-bit BGR format (0xBBGGRRff).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGR24</tt></td><td class="topAlign"><tt>11</tt></td><td class="topAlign">The frame is stored using a 24-bit BGR format (0xBBGGRR).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGR565</tt></td><td class="topAlign"><tt>12</tt></td><td class="topAlign">The frame is stored using a 16-bit BGR format (5-6-5).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGR555</tt></td><td class="topAlign"><tt>13</tt></td><td class="topAlign">The frame is stored using a 16-bit BGR format (5-5-5).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_BGRA5658_Premultiplied</tt></td><td class="topAlign"><tt>14</tt></td><td class="topAlign">The frame is stored using a 24-bit premultiplied BGRA format (5-6-5-8).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_AYUV444</tt></td><td class="topAlign"><tt>15</tt></td><td class="topAlign">The frame is stored using a packed 32-bit AYUV format (0xAAYYUUVV).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_AYUV444_Premultiplied</tt></td><td class="topAlign"><tt>16</tt></td><td class="topAlign">The frame is stored using a packed premultiplied 32-bit AYUV format (0xAAYYUUVV).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_YUV444</tt></td><td class="topAlign"><tt>17</tt></td><td class="topAlign">The frame is stored using a 24-bit packed YUV format (8-8-8).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_YUV420P</tt></td><td class="topAlign"><tt>18</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YUV format with the U and V planes horizontally and vertically sub-sampled, i.e. the height and width of the U and V planes are half that of the Y plane.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_YV12</tt></td><td class="topAlign"><tt>19</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YVU format with the V and U planes horizontally and vertically sub-sampled, i.e. the height and width of the V and U planes are half that of the Y plane.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_UYVY</tt></td><td class="topAlign"><tt>20</tt></td><td class="topAlign">The frame is stored using an 8-bit per component packed YUV format with the U and V planes horizontally sub-sampled (U-Y-V-Y), i.e. two horizontally adjacent pixels are stored as a 32-bit macropixel which has a Y value for each pixel and common U and V values.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_YUYV</tt></td><td class="topAlign"><tt>21</tt></td><td class="topAlign">The frame is stored using an 8-bit per component packed YUV format with the U and V planes horizontally sub-sampled (Y-U-Y-V), i.e. two horizontally adjacent pixels are stored as a 32-bit macropixel which has a Y value for each pixel and common U and V values.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_NV12</tt></td><td class="topAlign"><tt>22</tt></td><td class="topAlign">The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) followed by a horizontally and vertically sub-sampled, packed UV plane (U-V).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_NV21</tt></td><td class="topAlign"><tt>23</tt></td><td class="topAlign">The frame is stored using an 8-bit per component semi-planar YUV format with a Y plane (Y) followed by a horizontally and vertically sub-sampled, packed VU plane (V-U).</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_IMC1</tt></td><td class="topAlign"><tt>24</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YUV format with the U and V planes horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except that the bytes per line of the U and V planes are padded out to the same stride as the Y plane.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_IMC2</tt></td><td class="topAlign"><tt>25</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YUV format with the U and V planes horizontally and vertically sub-sampled. This is similar to the Format_YUV420P type, except that the lines of the U and V planes are interleaved, i.e. each line of U data is followed by a line of V data creating a single line of the same stride as the Y data.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_IMC3</tt></td><td class="topAlign"><tt>26</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YVU format with the V and U planes horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that the bytes per line of the V and U planes are padded out to the same stride as the Y plane.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_IMC4</tt></td><td class="topAlign"><tt>27</tt></td><td class="topAlign">The frame is stored using an 8-bit per component planar YVU format with the V and U planes horizontally and vertically sub-sampled. This is similar to the Format_YV12 type, except that the lines of the V and U planes are interleaved, i.e. each line of V data is followed by a line of U data creating a single line of the same stride as the Y data.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_Y8</tt></td><td class="topAlign"><tt>28</tt></td><td class="topAlign">The frame is stored using an 8-bit greyscale format.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_Y16</tt></td><td class="topAlign"><tt>29</tt></td><td class="topAlign">The frame is stored using a 16-bit linear greyscale format. Little endian.</td></tr> <tr><td class="topAlign"><tt>QVideoFrame::Format_User</tt></td><td class="topAlign"><tt>1000</tt></td><td class="topAlign">Start value for user defined pixel formats.</td></tr> </table> <!-- @@@PixelFormat --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QVideoFrame[overload1]$$$QVideoFrame --> <h3 class="fn"><a name="QVideoFrame"></a>QVideoFrame::<span class="name">QVideoFrame</span> ()</h3> <p>Constructs a null video frame.</p> <!-- @@@QVideoFrame --> <!-- $$$QVideoFrame$$$QVideoFrameQAbstractVideoBuffer*constQSize&PixelFormat --> <h3 class="fn"><a name="QVideoFrame-2"></a>QVideoFrame::<span class="name">QVideoFrame</span> ( <span class="type"><a href="qabstractvideobuffer.html">QAbstractVideoBuffer</a></span> * <i>buffer</i>, const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, <span class="type"><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></span> <i>format</i> )</h3> <p>Constructs a video frame from a <i>buffer</i> of the given pixel <i>format</i> and <i>size</i> in pixels.</p> <p><b>Note:</b> This doesn't increment the reference count of the video buffer.</p> <!-- @@@QVideoFrame --> <!-- $$$QVideoFrame$$$QVideoFrameintconstQSize&intPixelFormat --> <h3 class="fn"><a name="QVideoFrame-3"></a>QVideoFrame::<span class="name">QVideoFrame</span> ( <span class="type">int</span> <i>bytes</i>, const <span class="type"><a href="qsize.html">QSize</a></span> & <i>size</i>, <span class="type">int</span> <i>bytesPerLine</i>, <span class="type"><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></span> <i>format</i> )</h3> <p>Constructs a video frame of the given pixel <i>format</i> and <i>size</i> in pixels.</p> <p>The <i>bytesPerLine</i> (stride) is the length of each scan line in bytes, and <i>bytes</i> is the total number of bytes that must be allocated for the frame.</p> <!-- @@@QVideoFrame --> <!-- $$$QVideoFrame$$$QVideoFrameconstQImage& --> <h3 class="fn"><a name="QVideoFrame-4"></a>QVideoFrame::<span class="name">QVideoFrame</span> ( const <span class="type"><a href="qimage.html">QImage</a></span> & <i>image</i> )</h3> <p>Constructs a video frame from an <i>image</i>.</p> <p><b>Note:</b> This will construct an invalid video frame if there is no frame type equivalent to the image format.</p> <p><b>See also </b><a href="qvideoframe.html#pixelFormatFromImageFormat">pixelFormatFromImageFormat</a>().</p> <!-- @@@QVideoFrame --> <!-- $$$QVideoFrame$$$QVideoFrameconstQVideoFrame& --> <h3 class="fn"><a name="QVideoFrame-5"></a>QVideoFrame::<span class="name">QVideoFrame</span> ( const <span class="type">QVideoFrame</span> & <i>other</i> )</h3> <p>Constructs a copy of <i>other</i>.</p> <!-- @@@QVideoFrame --> <!-- $$$~QVideoFrame[overload1]$$$~QVideoFrame --> <h3 class="fn"><a name="dtor.QVideoFrame"></a>QVideoFrame::<span class="name">~QVideoFrame</span> ()</h3> <p>Destroys a video frame.</p> <!-- @@@~QVideoFrame --> <!-- $$$bits[overload1]$$$bits --> <h3 class="fn"><a name="bits"></a><span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * QVideoFrame::<span class="name">bits</span> ()</h3> <p>Returns a pointer to the start of the frame data buffer.</p> <p>This value is only valid while the frame data is <a href="qvideoframe.html#map">mapped</a>.</p> <p><b>See also </b><a href="qvideoframe.html#map">map</a>(), <a href="qvideoframe.html#mappedBytes">mappedBytes</a>(), and <a href="qvideoframe.html#bytesPerLine">bytesPerLine</a>().</p> <!-- @@@bits --> <!-- $$$bits$$$bits --> <h3 class="fn"><a name="bits-2"></a>const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * QVideoFrame::<span class="name">bits</span> () const</h3> <p>Returns a pointer to the start of the frame data buffer.</p> <p>This value is only valid while the frame data is <a href="qvideoframe.html#map">mapped</a>.</p> <p><b>See also </b><a href="qvideoframe.html#map">map</a>(), <a href="qvideoframe.html#mappedBytes">mappedBytes</a>(), and <a href="qvideoframe.html#bytesPerLine">bytesPerLine</a>().</p> <!-- @@@bits --> <!-- $$$bytesPerLine[overload1]$$$bytesPerLine --> <h3 class="fn"><a name="bytesPerLine"></a><span class="type">int</span> QVideoFrame::<span class="name">bytesPerLine</span> () const</h3> <p>Returns the number of bytes in a scan line.</p> <p><b>Note:</b> This is the bytes per line of the first plane only. The bytes per line of subsequent planes should be calculated as per the frame type.</p> <p>This value is only valid while the frame data is <a href="qvideoframe.html#map">mapped</a>.</p> <p><b>See also </b><a href="qvideoframe.html#bits">bits</a>(), <a href="qvideoframe.html#map">map</a>(), and <a href="qvideoframe.html#mappedBytes">mappedBytes</a>().</p> <!-- @@@bytesPerLine --> <!-- $$$endTime[overload1]$$$endTime --> <h3 class="fn"><a name="endTime"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QVideoFrame::<span class="name">endTime</span> () const</h3> <p>Returns the presentation time when a frame should stop being displayed.</p> <p><b>See also </b><a href="qvideoframe.html#setEndTime">setEndTime</a>().</p> <!-- @@@endTime --> <!-- $$$fieldType[overload1]$$$fieldType --> <h3 class="fn"><a name="fieldType"></a><span class="type"><a href="qvideoframe.html#FieldType-enum">FieldType</a></span> QVideoFrame::<span class="name">fieldType</span> () const</h3> <p>Returns the field an interlaced video frame belongs to.</p> <p>If the video is not interlaced this will return WholeFrame.</p> <p><b>See also </b><a href="qvideoframe.html#setFieldType">setFieldType</a>().</p> <!-- @@@fieldType --> <!-- $$$handle[overload1]$$$handle --> <h3 class="fn"><a name="handle"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QVideoFrame::<span class="name">handle</span> () const</h3> <p>Returns a type specific handle to a video frame's buffer.</p> <p>For an OpenGL texture this would be the texture ID.</p> <p><b>See also </b><a href="qabstractvideobuffer.html#handle">QAbstractVideoBuffer::handle</a>().</p> <!-- @@@handle --> <!-- $$$handleType[overload1]$$$handleType --> <h3 class="fn"><a name="handleType"></a><span class="type"><a href="qabstractvideobuffer.html#HandleType-enum">QAbstractVideoBuffer::HandleType</a></span> QVideoFrame::<span class="name">handleType</span> () const</h3> <p>Returns the type of a video frame's handle.</p> <!-- @@@handleType --> <!-- $$$height[overload1]$$$height --> <h3 class="fn"><a name="height"></a><span class="type">int</span> QVideoFrame::<span class="name">height</span> () const</h3> <p>Returns the height of a video frame.</p> <!-- @@@height --> <!-- $$$imageFormatFromPixelFormat[overload1]$$$imageFormatFromPixelFormatPixelFormat --> <h3 class="fn"><a name="imageFormatFromPixelFormat"></a><span class="type"><a href="qimage.html#Format-enum">QImage::Format</a></span> QVideoFrame::<span class="name">imageFormatFromPixelFormat</span> ( <span class="type"><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></span> <i>format</i> )<tt> [static]</tt></h3> <p>Returns an image format equivalent to a video frame pixel <i>format</i>. If there is no equivalent format <a href="qimage.html#Format-enum">QImage::Format_Invalid</a> is returned instead.</p> <!-- @@@imageFormatFromPixelFormat --> <!-- $$$isMapped[overload1]$$$isMapped --> <h3 class="fn"><a name="isMapped"></a><span class="type">bool</span> QVideoFrame::<span class="name">isMapped</span> () const</h3> <p>Identifies if a video frame's contents are currently mapped to system memory.</p> <p>This is a convenience function which checks that the <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> of the frame is not equal to <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::NotMapped</a>.</p> <p>Returns true if the contents of the video frame are mapped to system memory, and false otherwise.</p> <p><b>See also </b><a href="qvideoframe.html#mapMode">mapMode</a>() and <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a>.</p> <!-- @@@isMapped --> <!-- $$$isReadable[overload1]$$$isReadable --> <h3 class="fn"><a name="isReadable"></a><span class="type">bool</span> QVideoFrame::<span class="name">isReadable</span> () const</h3> <p>Identifies if the mapped contents of a video frame were read from the frame when it was mapped.</p> <p>This is a convenience function which checks if the <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> contains the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::WriteOnly</a> flag.</p> <p>Returns true if the contents of the mapped memory were read from the video frame, and false otherwise.</p> <p><b>See also </b><a href="qvideoframe.html#mapMode">mapMode</a>() and <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a>.</p> <!-- @@@isReadable --> <!-- $$$isValid[overload1]$$$isValid --> <h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QVideoFrame::<span class="name">isValid</span> () const</h3> <p>Identifies whether a video frame is valid.</p> <p>An invalid frame has no video buffer associated with it.</p> <p>Returns true if the frame is valid, and false if it is not.</p> <!-- @@@isValid --> <!-- $$$isWritable[overload1]$$$isWritable --> <h3 class="fn"><a name="isWritable"></a><span class="type">bool</span> QVideoFrame::<span class="name">isWritable</span> () const</h3> <p>Identifies if the mapped contents of a video frame will be persisted when the frame is unmapped.</p> <p>This is a convenience function which checks if the <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> contains the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::WriteOnly</a> flag.</p> <p>Returns true if the video frame will be updated when unmapped, and false otherwise.</p> <p><b>Note:</b> The result of altering the data of a frame that is mapped in read-only mode is undefined. Depending on the buffer implementation the changes may be persisted, or worse alter a shared buffer.</p> <p><b>See also </b><a href="qvideoframe.html#mapMode">mapMode</a>() and <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a>.</p> <!-- @@@isWritable --> <!-- $$$map[overload1]$$$mapQAbstractVideoBuffer::MapMode --> <h3 class="fn"><a name="map"></a><span class="type">bool</span> QVideoFrame::<span class="name">map</span> ( <span class="type"><a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a></span> <i>mode</i> )</h3> <p>Maps the contents of a video frame to memory.</p> <p>The map <i>mode</i> indicates whether the contents of the mapped memory should be read from and/or written to the frame. If the map mode includes the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::ReadOnly</a> flag the mapped memory will be populated with the content of the video frame when mapped. If the map mode inclues the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::WriteOnly</a> flag the content of the mapped memory will be persisted in the frame when unmapped.</p> <p>While mapped the contents of a video frame can be accessed directly through the pointer returned by the <a href="qvideoframe.html#bits">bits</a>() function.</p> <p>When access to the data is no longer needed be sure to call the <a href="qvideoframe.html#unmap">unmap</a>() function to release the mapped memory.</p> <p>Returns true if the buffer was mapped to memory in the given <i>mode</i> and false otherwise.</p> <p><b>See also </b><a href="qvideoframe.html#unmap">unmap</a>(), <a href="qvideoframe.html#mapMode">mapMode</a>(), and <a href="qvideoframe.html#bits">bits</a>().</p> <!-- @@@map --> <!-- $$$mapMode[overload1]$$$mapMode --> <h3 class="fn"><a name="mapMode"></a><span class="type"><a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a></span> QVideoFrame::<span class="name">mapMode</span> () const</h3> <p>Returns the mode a video frame was mapped to system memory in.</p> <p><b>See also </b><a href="qvideoframe.html#map">map</a>() and <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::MapMode</a>.</p> <!-- @@@mapMode --> <!-- $$$mappedBytes[overload1]$$$mappedBytes --> <h3 class="fn"><a name="mappedBytes"></a><span class="type">int</span> QVideoFrame::<span class="name">mappedBytes</span> () const</h3> <p>Returns the number of bytes occupied by the mapped frame data.</p> <p>This value is only valid while the frame data is <a href="qvideoframe.html#map">mapped</a>.</p> <p><b>See also </b><a href="qvideoframe.html#map">map</a>().</p> <!-- @@@mappedBytes --> <!-- $$$pixelFormat[overload1]$$$pixelFormat --> <h3 class="fn"><a name="pixelFormat"></a><span class="type"><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></span> QVideoFrame::<span class="name">pixelFormat</span> () const</h3> <p>Returns the color format of a video frame.</p> <!-- @@@pixelFormat --> <!-- $$$pixelFormatFromImageFormat[overload1]$$$pixelFormatFromImageFormatQImage::Format --> <h3 class="fn"><a name="pixelFormatFromImageFormat"></a><span class="type"><a href="qvideoframe.html#PixelFormat-enum">PixelFormat</a></span> QVideoFrame::<span class="name">pixelFormatFromImageFormat</span> ( <span class="type"><a href="qimage.html#Format-enum">QImage::Format</a></span> <i>format</i> )<tt> [static]</tt></h3> <p>Returns an video pixel format equivalent to an image <i>format</i>. If there is no equivalent format QVideoFrame::InvalidType is returned instead.</p> <!-- @@@pixelFormatFromImageFormat --> <!-- $$$setEndTime[overload1]$$$setEndTimeqint64 --> <h3 class="fn"><a name="setEndTime"></a><span class="type">void</span> QVideoFrame::<span class="name">setEndTime</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>time</i> )</h3> <p>Sets the presentation <i>time</i> when a frame should stop being displayed.</p> <p><b>See also </b><a href="qvideoframe.html#endTime">endTime</a>().</p> <!-- @@@setEndTime --> <!-- $$$setFieldType[overload1]$$$setFieldTypeFieldType --> <h3 class="fn"><a name="setFieldType"></a><span class="type">void</span> QVideoFrame::<span class="name">setFieldType</span> ( <span class="type"><a href="qvideoframe.html#FieldType-enum">FieldType</a></span> <i>field</i> )</h3> <p>Sets the <i>field</i> an interlaced video frame belongs to.</p> <p><b>See also </b><a href="qvideoframe.html#fieldType">fieldType</a>().</p> <!-- @@@setFieldType --> <!-- $$$setStartTime[overload1]$$$setStartTimeqint64 --> <h3 class="fn"><a name="setStartTime"></a><span class="type">void</span> QVideoFrame::<span class="name">setStartTime</span> ( <span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> <i>time</i> )</h3> <p>Sets the presentation <i>time</i> when the frame should be displayed.</p> <p><b>See also </b><a href="qvideoframe.html#startTime">startTime</a>().</p> <!-- @@@setStartTime --> <!-- $$$size[overload1]$$$size --> <h3 class="fn"><a name="size"></a><span class="type"><a href="qsize.html">QSize</a></span> QVideoFrame::<span class="name">size</span> () const</h3> <p>Returns the size of a video frame.</p> <!-- @@@size --> <!-- $$$startTime[overload1]$$$startTime --> <h3 class="fn"><a name="startTime"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QVideoFrame::<span class="name">startTime</span> () const</h3> <p>Returns the presentation time when the frame should be displayed.</p> <p><b>See also </b><a href="qvideoframe.html#setStartTime">setStartTime</a>().</p> <!-- @@@startTime --> <!-- $$$unmap[overload1]$$$unmap --> <h3 class="fn"><a name="unmap"></a><span class="type">void</span> QVideoFrame::<span class="name">unmap</span> ()</h3> <p>Releases the memory mapped by the <a href="qvideoframe.html#map">map</a>() function.</p> <p>If the <a href="qabstractvideobuffer.html#MapMode-enum">MapMode</a> included the <a href="qabstractvideobuffer.html#MapMode-enum">QAbstractVideoBuffer::WriteOnly</a> flag this will persist the current content of the mapped memory to the video frame.</p> <p><b>See also </b><a href="qvideoframe.html#map">map</a>().</p> <!-- @@@unmap --> <!-- $$$width[overload1]$$$width --> <h3 class="fn"><a name="width"></a><span class="type">int</span> QVideoFrame::<span class="name">width</span> () const</h3> <p>Returns the width of a video frame.</p> <!-- @@@width --> <!-- $$$operator=[overload1]$$$operator=constQVideoFrame& --> <h3 class="fn"><a name="operator-eq"></a><span class="type">QVideoFrame</span> & QVideoFrame::<span class="name">operator=</span> ( const <span class="type">QVideoFrame</span> & <i>other</i> )</h3> <p>Assigns the contents of <i>other</i> to a video frame.</p> <!-- @@@operator= --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> 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.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> 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. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>