<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # QGLPixelBuffer Class Reference ## [[QtOpenGL](index.htm) module] 該QGLPixelBuffer類封裝了一個OpenGL pbuffer的。[More...](#details) 繼承[QPaintDevice](qpaintdevice.html)。 ### Methods * `__init__ (self, QSize?size, QGLFormat?format?=?QGLFormat.defaultFormat(), QGLWidget?shareWidget?=?None)` * `__init__ (self, int?width, int?height, QGLFormat?format?=?QGLFormat.defaultFormat(), QGLWidget?shareWidget?=?None)` * `int bindTexture (self, QImage?image, int?target?=?GL_TEXTURE_2D)` * `int bindTexture (self, QPixmap?pixmap, int?target?=?GL_TEXTURE_2D)` * `int bindTexture (self, QString?fileName)` * `bool bindToDynamicTexture (self, int?texture)` * `deleteTexture (self, int?texture_id)` * `int devType (self)` * `bool doneCurrent (self)` * `drawTexture (self, QRectF?target, int?textureId, int?textureTarget?=?GL_TEXTURE_2D)` * `drawTexture (self, QPointF?point, int?textureId, int?textureTarget?=?GL_TEXTURE_2D)` * `QGLFormat format (self)` * `int generateDynamicTexture (self)` * `int handle (self)` * `bool isValid (self)` * `bool makeCurrent (self)` * `int metric (self, QPaintDevice.PaintDeviceMetric?metric)` * `QPaintEngine paintEngine (self)` * `releaseFromDynamicTexture (self)` * `QSize size (self)` * `QImage toImage (self)` * `updateDynamicTexture (self, int?texture_id)` ### Static Methods * `bool hasOpenGLPbuffers ()` * * * ## Detailed Description 該QGLPixelBuffer類封裝了一個OpenGL pbuffer的。 渲染到pbuffer的通常情況下用完整的硬件加速。這可以比渲染成顯著更快[QPixmap](qpixmap.html)。 有三種方法來使用這個類: 1. **We can draw into the pbuffer and convert it to a [QImage](qimage.html) using [toImage](qglpixelbuffer.html#toImage)().**這通常比調用更快[QGLWidget.renderPixmap](qglwidget.html#renderPixmap)( ) 。 2. **We can draw into the pbuffer and copy the contents into an OpenGL texture using [updateDynamicTexture](qglpixelbuffer.html#updateDynamicTexture)().**這使我們能夠創建與pbuffer的支持所有的系統動態紋理和作品。 3. **On systems that support it, we can bind the pbuffer to an OpenGL texture.**紋理將自動更新時, pbuffer的內容發生變化,不再需要額外的復制操作。這僅支持在Windows和Mac OS X系統,提供了`render_texture`擴展名。需要注意的是在Windows下,一個多采樣pbuffer的不能與結合使用`render_texture`擴展名。如果一個多重采樣pbuffer的在Windows下所要求的`render_texture`擴展關閉該pbuffer的。 ### Threading 由于Qt的4.8的,有可能使用的是渲染成QGLPixelBuffer[QPainter](qpainter.html)在一個單獨的線程。需要注意的是OpenGL的2.0或OpenGL ES 2.0的是需要這種合作。此外, X11下,有必要設置[Qt.AA_X11InitThreads](qt.html#ApplicationAttribute-enum)應用屬性。 pbuffers的是通過對OpenGL提供`pbuffer`擴展;調用hasOpenGLPbuffer ( ) ,以找出是否為系統提供pbuffers的。 * * * ## Method Documentation ``` QGLPixelBuffer.__init__ (self, QSize?size, QGLFormat?format?=?QGLFormat.defaultFormat(), QGLWidget?shareWidget?=?None) ``` 構造給定一個OpenGL pbuffer的_size_。如果沒有_format_被指定,則[default format](qglformat.html#defaultFormat)被使用。如果_shareWidget_參數指向一個有效的[QGLWidget](qglwidget.html),該pbuffer的將共享其上下文_shareWidget_。 如果您打算在這個pbuffer的綁定為一個動態紋理的寬度和高度組件`size`必須是兩個(例如, 512× 128)的權力。 **See also** [size](qglpixelbuffer.html#size)()和[format](qglpixelbuffer.html#format)( ) 。 ``` QGLPixelBuffer.__init__ (self, int?width, int?height, QGLFormat?format?=?QGLFormat.defaultFormat(), QGLWidget?shareWidget?=?None) ``` 這是一個重載函數。 構造一個OpenGL pbuffer的同_width_和_height_。如果沒有_format_被指定,則[default format](qglformat.html#defaultFormat)被使用。如果_shareWidget_參數指向一個有效的[QGLWidget](qglwidget.html),該pbuffer的將共享其上下文_shareWidget_。 如果您打算在這個pbuffer的綁定為一個動態紋理的寬度和高度組件`size`必須是兩個(例如, 512× 128)的權力。 **See also** [size](qglpixelbuffer.html#size)()和[format](qglpixelbuffer.html#format)( ) 。 ``` int QGLPixelBuffer.bindTexture (self, QImage?image, int?target?=?GL_TEXTURE_2D) ``` 生成和二維GL紋理綁定到當前上下文的基礎上,_image_。所生成的紋理ID被返回,并且可以被用于在以后glBindTexture ()調用。 該_target_參數指定紋理目標。 相當于調用[QGLContext.bindTexture](qglcontext.html#bindTexture)( ) 。 **See also** [deleteTexture](qglpixelbuffer.html#deleteTexture)( ) 。 ``` int QGLPixelBuffer.bindTexture (self, QPixmap?pixmap, int?target?=?GL_TEXTURE_2D) ``` 這是一個重載函數。 生成并根據綁定一個2D GL紋理_pixmap_。 相當于調用[QGLContext.bindTexture](qglcontext.html#bindTexture)( ) 。 **See also** [deleteTexture](qglpixelbuffer.html#deleteTexture)( ) 。 ``` int QGLPixelBuffer.bindTexture (self, QString?fileName) ``` 這是一個重載函數。 讀取DirectDrawSurface ( DDS )壓縮文件_fileName_并從它生成一個二維GL紋理。 相當于調用[QGLContext.bindTexture](qglcontext.html#bindTexture)( ) 。 **See also** [deleteTexture](qglpixelbuffer.html#deleteTexture)( ) 。 ``` bool QGLPixelBuffer.bindToDynamicTexture (self, int?texture) ``` 通過綁定指定的質感_texture_id_該pbuffer的。成功時返回TRUE ,否則返回False 。 紋理必須是相同的尺寸和格式的pbuffer的的。 要解除綁定紋理,呼叫[releaseFromDynamicTexture](qglpixelbuffer.html#releaseFromDynamicTexture)( ) 。雖然質地是綁定的,它會自動更新時, pbuffer的內容發生變化,不再需要額外的復制操作。 例如: ``` [QGLPixelBuffer](qglpixelbuffer.html) pbuffer(...); ... pbuffer.makeCurrent(); GLuint dynamicTexture = pbuffer.generateDynamicTexture(); pbuffer.bindToDynamicTexture(dynamicTexture); ... pbuffer.releaseFromDynamicTexture(); ``` **Warning:**該函數使用`render_texture`擴展,這是目前沒有在X11下的支持。在所有的系統(包括X11)的作品另一種方法是手動使用pbuffer的內容復制到一個紋理[updateDynamicTexture](qglpixelbuffer.html#updateDynamicTexture)( ) 。 **Warning:**對于bindToDynamicTexture ( )調用成功,在Mac OS X上, pbuffer的需要一個共享的情況下,即[QGLPixelBuffer](qglpixelbuffer.html)必須以份額小部件來創建。 **See also** [generateDynamicTexture](qglpixelbuffer.html#generateDynamicTexture)()和[releaseFromDynamicTexture](qglpixelbuffer.html#releaseFromDynamicTexture)( ) 。 ``` QGLPixelBuffer.deleteTexture (self, int?texture_id) ``` 去除所確定的紋理_texture_id_從紋理高速緩存。 相當于調用[QGLContext.deleteTexture](qglcontext.html#deleteTexture)( ) 。 ``` int QGLPixelBuffer.devType (self) ``` ``` bool QGLPixelBuffer.doneCurrent (self) ``` 是沒有上下文的當前OpenGL上下文。成功時返回TRUE ,否則返回False 。 ``` QGLPixelBuffer.drawTexture (self, QRectF?target, int?textureId, int?textureTarget?=?GL_TEXTURE_2D) ``` 繪制給定的質感,_textureId_向給定目標矩形,_target_在OpenGL的模型空間。該_textureTarget_應該是一個2D紋理的目標。 等同于相應的[QGLContext.drawTexture](qglcontext.html#drawTexture)( ) 。 此功能被引入Qt的4.4 。 ``` QGLPixelBuffer.drawTexture (self, QPointF?point, int?textureId, int?textureTarget?=?GL_TEXTURE_2D) ``` 繪制給定的質感,_textureId_,在給定的_point_在OpenGL的模型空間。該textureTarget參數應該是一個2D紋理的目標。 等同于相應的[QGLContext.drawTexture](qglcontext.html#drawTexture)( ) 。 此功能被引入Qt的4.4 。 ``` QGLFormat QGLPixelBuffer.format (self) ``` [ 返回pbuffer的格式。該格式可以是從被請求的不同。 ``` int QGLPixelBuffer.generateDynamicTexture (self) ``` ](qglformat.html) [生成并結合一個2D GL的手感是大小相同的pbuffer的,并返回該紋理的ID。這可與結合使用](qglformat.html)[bindToDynamicTexture](qglpixelbuffer.html#bindToDynamicTexture)()和[updateDynamicTexture](qglpixelbuffer.html#updateDynamicTexture)( ) 。 **See also** [size](qglpixelbuffer.html#size)( ) 。 ``` int QGLPixelBuffer.handle (self) ``` 返回本機pbuffer的句柄。 ``` bool QGLPixelBuffer.hasOpenGLPbuffers () ``` 返回True如果OpenGL的`pbuffer`擴展出現在這個系統上,否則返回False 。 ``` bool QGLPixelBuffer.isValid (self) ``` 返回True如果pbuffer的是有效的,否則返回False 。 ``` bool QGLPixelBuffer.makeCurrent (self) ``` 使得這個pbuffer的當前OpenGL渲染上下文。成功時返回TRUE ,否則返回False 。 **See also** [QGLContext.makeCurrent](qglcontext.html#makeCurrent)()和[doneCurrent](qglpixelbuffer.html#doneCurrent)( ) 。 ``` int QGLPixelBuffer.metric (self, QPaintDevice.PaintDeviceMetric?metric) ``` 從重新實現[QPaintDevice.metric](qpaintdevice.html#metric)( ) 。 ``` QPaintEngine QGLPixelBuffer.paintEngine (self) ``` [](qpaintengine.html) [從重新實現](qpaintengine.html)[QPaintDevice.paintEngine](qpaintdevice.html#paintEngine)( ) 。 ``` QGLPixelBuffer.releaseFromDynamicTexture (self) ``` 發布任何以前綁定的質感pbuffer的。 **See also** [bindToDynamicTexture](qglpixelbuffer.html#bindToDynamicTexture)( ) 。 ``` QSize QGLPixelBuffer.size (self) ``` [ 返回pbuffer的大小。 ](qsize.html) ``` QImage QGLPixelBuffer.toImage (self) ``` [](qimage.html) [返回pbuffer的內容作為](qimage.html)[QImage](qimage.html)。 ``` QGLPixelBuffer.updateDynamicTexture (self, int?texture_id) ``` 與指定復制pbuffer的內容到紋理_texture_id_。 紋理必須是相同的尺寸和格式的pbuffer的的。 例如: ``` [QGLPixelBuffer](qglpixelbuffer.html) pbuffer(...); ... pbuffer.makeCurrent(); GLuint dynamicTexture = pbuffer.generateDynamicTexture(); ... pbuffer.updateDynamicTexture(dynamicTexture); ``` 在支持Windows和Mac OS X系統的替代`render_texture`分機是用[bindToDynamicTexture](qglpixelbuffer.html#bindToDynamicTexture)()來獲取紋理的動態更新。 **See also** [generateDynamicTexture](qglpixelbuffer.html#generateDynamicTexture)()和[bindToDynamicTexture](qglpixelbuffer.html#bindToDynamicTexture)( ) 。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看