1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qwaylandbufferref.cpp -->
<title>QWaylandBufferRef Class | Qt Wayland Compositor 5.11</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 ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtwaylandcompositor-index.html">Qt Wayland Compositor</a></td><td ><a href="qtwaylandcompositor-module.html">C++ Classes</a></td><td >QWaylandBufferRef</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.11.2 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="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</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">QWaylandBufferRef Class</h1>
<!-- $$$QWaylandBufferRef-brief -->
<p>The <a href="qwaylandbufferref.html">QWaylandBufferRef</a> class holds the reference to a surface buffer. <a href="#details">More...</a></p>
<!-- @@@QWaylandBufferRef -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QWaylandBufferRef></span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += waylandcompositor</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.8</td></tr></table></div><ul>
<li><a href="qwaylandbufferref-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#BufferFormatEgl-enum">BufferFormatEgl</a></b> { BufferFormatEgl_Null, BufferFormatEgl_RGB, BufferFormatEgl_RGBA, BufferFormatEgl_EXTERNAL_OES, ..., BufferFormatEgl_Y_XUXV }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#BufferType-enum">BufferType</a></b> { BufferType_Null, BufferType_SharedMemory, BufferType_Egl }</td></tr>
</table></div>
<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="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#QWaylandBufferRef-1">QWaylandBufferRef</a></b>(const QWaylandBufferRef &<i>ref</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#dtor.QWaylandBufferRef">~QWaylandBufferRef</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWaylandBufferRef::BufferFormatEgl </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#bufferFormatEgl">bufferFormatEgl</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWaylandBufferRef::BufferType </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#bufferType">bufferType</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#hasBuffer">hasBuffer</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#hasContent">hasContent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QImage </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#image">image</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#isDestroyed">isDestroyed</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#isNull">isNull</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#isSharedMemory">isSharedMemory</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> quintptr </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#lockNativeBuffer">lockNativeBuffer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWaylandSurface::Origin </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#origin">origin</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#size">size</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QOpenGLTexture *</td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#toOpenGLTexture">toOpenGLTexture</a></b>(int <i>plane</i> = 0) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#unlockNativeBuffer">unlockNativeBuffer</a></b>(quintptr <i>handle</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> struct wl_resource *</td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#wl_buffer">wl_buffer</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#operator-not-eq">operator!=</a></b>(const QWaylandBufferRef &<i>ref</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWaylandBufferRef &</td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#operator-eq">operator=</a></b>(const QWaylandBufferRef &<i>ref</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qwaylandbufferref.html#operator-eq-eq">operator==</a></b>(const QWaylandBufferRef &<i>ref</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QWaylandBufferRef-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qwaylandbufferref.html">QWaylandBufferRef</a> class holds the reference to a surface buffer.</p>
<p>This class can be used to reference a surface buffer. As long as a reference to the buffer exists, it is owned by the compositor and the client cannot modify it.</p>
</div>
<!-- @@@QWaylandBufferRef -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$BufferFormatEgl$$$BufferFormatEgl_Null$$$BufferFormatEgl_RGB$$$BufferFormatEgl_RGBA$$$BufferFormatEgl_EXTERNAL_OES$$$BufferFormatEgl_Y_U_V$$$BufferFormatEgl_Y_UV$$$BufferFormatEgl_Y_XUXV -->
<h3 class="fn" id="BufferFormatEgl-enum"><a name="BufferFormatEgl-enum"></a>enum QWaylandBufferRef::<span class="name">BufferFormatEgl</span></h3>
<!-- @@@BufferFormatEgl -->
<!-- $$$BufferType$$$BufferType_Null$$$BufferType_SharedMemory$$$BufferType_Egl -->
<h3 class="fn" id="BufferType-enum"><a name="BufferType-enum"></a>enum QWaylandBufferRef::<span class="name">BufferType</span></h3>
<!-- @@@BufferType -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QWaylandBufferRef[overload1]$$$QWaylandBufferRef -->
<h3 class="fn" id="QWaylandBufferRef"><a name="QWaylandBufferRef"></a>QWaylandBufferRef::<span class="name">QWaylandBufferRef</span>()</h3>
<p>Constructs a null buffer ref.</p>
<!-- @@@QWaylandBufferRef -->
<!-- $$$QWaylandBufferRef$$$QWaylandBufferRefconstQWaylandBufferRef& -->
<h3 class="fn" id="QWaylandBufferRef-1"><a name="QWaylandBufferRef-1"></a>QWaylandBufferRef::<span class="name">QWaylandBufferRef</span>(const <span class="type"><a href="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></span> &<i>ref</i>)</h3>
<p>Creates a new reference to the buffer referenced by <i>ref</i>.</p>
<!-- @@@QWaylandBufferRef -->
<!-- $$$~QWaylandBufferRef[overload1]$$$~QWaylandBufferRef -->
<h3 class="fn" id="dtor.QWaylandBufferRef"><a name="dtor.QWaylandBufferRef"></a>QWaylandBufferRef::<span class="name">~QWaylandBufferRef</span>()</h3>
<p>Dereferences the buffer.</p>
<!-- @@@~QWaylandBufferRef -->
<!-- $$$bufferFormatEgl[overload1]$$$bufferFormatEgl -->
<h3 class="fn" id="bufferFormatEgl"><a name="bufferFormatEgl"></a><span class="type"><a href="qwaylandbufferref.html#BufferFormatEgl-enum">QWaylandBufferRef::BufferFormatEgl</a></span> QWaylandBufferRef::<span class="name">bufferFormatEgl</span>() const</h3>
<!-- @@@bufferFormatEgl -->
<!-- $$$bufferType[overload1]$$$bufferType -->
<h3 class="fn" id="bufferType"><a name="bufferType"></a><span class="type"><a href="qwaylandbufferref.html#BufferType-enum">QWaylandBufferRef::BufferType</a></span> QWaylandBufferRef::<span class="name">bufferType</span>() const</h3>
<!-- @@@bufferType -->
<!-- $$$hasBuffer[overload1]$$$hasBuffer -->
<h3 class="fn" id="hasBuffer"><a name="hasBuffer"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">hasBuffer</span>() const</h3>
<p>Returns true if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> references a buffer. Otherwise returns false.</p>
<p><b>See also </b><a href="qwaylandbufferref.html#isNull">isNull</a>() and <a href="qwaylandbufferref.html#hasContent">hasContent</a>().</p>
<!-- @@@hasBuffer -->
<!-- $$$hasContent[overload1]$$$hasContent -->
<h3 class="fn" id="hasContent"><a name="hasContent"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">hasContent</span>() const</h3>
<p>Returns true if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> references a buffer that has content. Otherwise returns false.</p>
<p><b>See also </b><a href="qwaylandbufferref.html#isNull">isNull</a>() and <a href="qwaylandbufferref.html#hasBuffer">hasBuffer</a>().</p>
<!-- @@@hasContent -->
<!-- $$$image[overload1]$$$image -->
<h3 class="fn" id="image"><a name="image"></a><span class="type"><a href="../qtgui/qimage.html">QImage</a></span> QWaylandBufferRef::<span class="name">image</span>() const</h3>
<p>Returns an image with the contents of the buffer.</p>
<!-- @@@image -->
<!-- $$$isDestroyed[overload1]$$$isDestroyed -->
<h3 class="fn" id="isDestroyed"><a name="isDestroyed"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">isDestroyed</span>() const</h3>
<p>Returns true if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> references a buffer that has been destroyed. Otherwise returns false.</p>
<!-- @@@isDestroyed -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn" id="isNull"><a name="isNull"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">isNull</span>() const</h3>
<p>Returns true if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> does not reference a buffer. Otherwise returns false.</p>
<p><b>See also </b><a href="qwaylandbufferref.html#hasBuffer">hasBuffer</a>() and <a href="qwaylandbufferref.html#hasContent">hasContent</a>().</p>
<!-- @@@isNull -->
<!-- $$$isSharedMemory[overload1]$$$isSharedMemory -->
<h3 class="fn" id="isSharedMemory"><a name="isSharedMemory"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">isSharedMemory</span>() const</h3>
<p>Returns true if the buffer is a shared memory buffer. Otherwise returns false.</p>
<!-- @@@isSharedMemory -->
<!-- $$$lockNativeBuffer[overload1]$$$lockNativeBuffer -->
<h3 class="fn" id="lockNativeBuffer"><a name="lockNativeBuffer"></a><span class="type"><a href="../qtcore/qtglobal.html#quintptr-typedef">quintptr</a></span> QWaylandBufferRef::<span class="name">lockNativeBuffer</span>()</h3>
<p>Returns the native handle for this buffer, and marks it as locked so it will not be released until <a href="qwaylandbufferref.html#unlockNativeBuffer">unlockNativeBuffer</a>() is called.</p>
<p>Returns 0 if there is no native handle for this buffer, or if the lock was unsuccessful.</p>
<!-- @@@lockNativeBuffer -->
<!-- $$$origin[overload1]$$$origin -->
<h3 class="fn" id="origin"><a name="origin"></a><span class="type"><a href="qwaylandsurface.html#Origin-enum">QWaylandSurface::Origin</a></span> QWaylandBufferRef::<span class="name">origin</span>() const</h3>
<p>Returns the origin of the buffer. If the buffer referenced is null, <a href="qwaylandsurface.html#Origin-enum">QWaylandSurface::OriginBottomLeft</a> is returned.</p>
<!-- @@@origin -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn" id="size"><a name="size"></a><span class="type"><a href="../qtcore/qsize.html">QSize</a></span> QWaylandBufferRef::<span class="name">size</span>() const</h3>
<p>Returns the size of the buffer. If the buffer referenced is null, an invalid QSize() is returned.</p>
<!-- @@@size -->
<!-- $$$toOpenGLTexture[overload1]$$$toOpenGLTextureint -->
<h3 class="fn" id="toOpenGLTexture"><a name="toOpenGLTexture"></a><span class="type"><a href="../qtgui/qopengltexture.html">QOpenGLTexture</a></span> *QWaylandBufferRef::<span class="name">toOpenGLTexture</span>(<span class="type">int</span> <i>plane</i> = 0) const</h3>
<p>Returns an OpenGL texture for the buffer. <i>plane</i> is the index for multi-plane formats, such as YUV.</p>
<p>The returned texture is owned by the buffer. The texture is only valid for as long as the buffer reference exists. The caller of this function must not delete the texture, and must keep a reference to the buffer for as long as the texture is being used.</p>
<p>Returns <code>nullptr</code> if there is no valid buffer, or if no texture can be created.</p>
<!-- @@@toOpenGLTexture -->
<!-- $$$unlockNativeBuffer[overload1]$$$unlockNativeBufferquintptr -->
<h3 class="fn" id="unlockNativeBuffer"><a name="unlockNativeBuffer"></a><span class="type">void</span> QWaylandBufferRef::<span class="name">unlockNativeBuffer</span>(<span class="type"><a href="../qtcore/qtglobal.html#quintptr-typedef">quintptr</a></span> <i>handle</i>)</h3>
<p>Marks the native buffer as no longer in use. <i>handle</i> must correspond to the value returned by a previous call to <a href="qwaylandbufferref.html#lockNativeBuffer">lockNativeBuffer</a>().</p>
<!-- @@@unlockNativeBuffer -->
<!-- $$$wl_buffer[overload1]$$$wl_buffer -->
<h3 class="fn" id="wl_buffer"><a name="wl_buffer"></a><span class="type">struct</span> <span class="type">wl_resource</span> *QWaylandBufferRef::<span class="name">wl_buffer</span>() const</h3>
<p>Returns the Wayland resource for the buffer.</p>
<!-- @@@wl_buffer -->
<!-- $$$operator!=[overload1]$$$operator!=constQWaylandBufferRef& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">operator!=</span>(const <span class="type"><a href="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></span> &<i>ref</i>)</h3>
<p>Returns false if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> references the same buffer as <i>ref</i>. Otherwise returns true.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQWaylandBufferRef& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></span> &QWaylandBufferRef::<span class="name">operator=</span>(const <span class="type"><a href="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></span> &<i>ref</i>)</h3>
<p>Assigns <i>ref</i> to this buffer and adds a reference to it. The previously referenced buffer is dereferenced.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQWaylandBufferRef& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QWaylandBufferRef::<span class="name">operator==</span>(const <span class="type"><a href="qwaylandbufferref.html#QWaylandBufferRef">QWaylandBufferRef</a></span> &<i>ref</i>)</h3>
<p>Returns true if this <a href="qwaylandbufferref.html">QWaylandBufferRef</a> references the same buffer as <i>ref</i>. Otherwise returns false.</p>
<!-- @@@operator== -->
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2018 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>