<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # QGLFramebufferObject Class Reference ## [[QtOpenGL](index.htm) module] 該QGLFramebufferObject類封裝了一個OpenGL幀緩沖區對象。[More...](#details) 繼承[QPaintDevice](qpaintdevice.html)。 ### Types * `enum Attachment { NoAttachment, CombinedDepthStencil, Depth }` ### Methods * `__init__ (self, QSize?size, int?target?=?GL_TEXTURE_2D)` * `__init__ (self, int?width, int?height, int?target?=?GL_TEXTURE_2D)` * `__init__ (self, QSize?size, Attachment?attachment, int?target?=?GL_TEXTURE_2D, int?internalFormat?=?GL_RGBA8)` * `__init__ (self, int?width, int?height, Attachment?attachment, int?target?=?GL_TEXTURE_2D, int?internalFormat?=?GL_RGBA8)` * `__init__ (self, QSize?size, QGLFramebufferObjectFormat?format)` * `__init__ (self, int?width, int?height, QGLFramebufferObjectFormat?format)` * `Attachment attachment (self)` * `bool bind (self)` * `drawTexture (self, QRectF?target, int?textureId, int?textureTarget?=?GL_TEXTURE_2D)` * `drawTexture (self, QPointF?point, int?textureId, int?textureTarget?=?GL_TEXTURE_2D)` * `QGLFramebufferObjectFormat format (self)` * `int handle (self)` * `bool isBound (self)` * `bool isValid (self)` * `int metric (self, QPaintDevice.PaintDeviceMetric?metric)` * `QPaintEngine paintEngine (self)` * `bool release (self)` * `QSize size (self)` * `int texture (self)` * `QImage toImage (self)` ### Static Methods * `blitFramebuffer (QGLFramebufferObject?target, QRect?targetRect, QGLFramebufferObject?source, QRect?sourceRect, int?buffers?=?GL_COLOR_BUFFER_BIT, int?filter?=?GL_NEAREST)` * `bool hasOpenGLFramebufferBlit ()` * `bool hasOpenGLFramebufferObjects ()` * * * ## Detailed Description 該QGLFramebufferObject類封裝了一個OpenGL幀緩沖區對象。 該QGLFramebufferObject類封裝了一個OpenGL幀緩沖區對象,由定義`GL_EXT_framebuffer_object`擴展名。此外,它提供了一種渲染表面,可以涂在用[QPainter](qpainter.html),呈現給使用本地GL調用,或兩者兼而有之。這種表面可以在自己的GL繪圖代碼的約束,并作為一個普通的紋理。默認情況下, QGLFramebufferObject類生成一個2D GL紋理(使用`GL_TEXTURE_2D`目標) ,它是用來作為內部渲染對象。 **It is important to have a current GL context when creating a QGLFramebufferObject, otherwise initialization will fail.** OpenGL的幀緩沖對象和pbuffers的(見[QGLPixelBuffer](qglpixelbuffer.html))都可以用來渲染到屏幕外表面,但也有許多與使用幀緩沖區對象而不是pbuffers的優點: 1. 一個幀緩沖對象不需要一個單獨的渲染上下文,因此切換渲染目標時不會發生上下文切換。存在參與切換目標的開銷,但一般它比上下文切換到一個pbuffer的便宜。 2. 渲染到動態紋理(即渲染到紋理功能)適用于所有平臺。沒有必要做明確的副本從一個渲染緩沖區調用到一個紋理,因為有必要對那些不支持系統`render_texture`擴展名。 3. 它可以連接多個渲染緩沖區(或紋理對象)到相同的幀緩沖區對象,并呈現給所有的人都沒有做上下文切換。 4. OpenGL的幀緩沖擴展是一個純粹的GL擴展,不依賴于系統WGL ,鱷魚卹,或GLX部分。這使得使用幀緩沖對象更便于攜帶。 當使用一個[QPainter](qpainter.html)畫一個QGLFramebufferObject的QGLFramebufferObject與創建時要注意[CombinedDepthStencil](qglframebufferobject.html#Attachment-enum)附件[QPainter](qpainter.html)要能正確呈現。請注意,您需要使用繪圖時創建每像素多于一個樣本的QGLFramebufferObject對原語進行反鋸齒[QPainter](qpainter.html)。要創建一個多重采樣幀緩沖區對象,你應該使用采取QGLFramebufferObject參數的構造函數之一,并設置QGLFramebufferObject.samples ()屬性設置為一個非零值。 當畫到QGLFramebufferObject使用[QPainter](qpainter.html),目前GL上下文的狀態將由繪圖引擎進行修改,以反映其需求。應用程序不應依賴于GL狀態被重置到其原始條件,特別是目前的著色器程序,吉爾口中,紋理單元和繪圖模式。 對于多重采樣幀緩沖對象的顏色渲染在創建緩沖區,否則創建具有指定目標的質感紋理。色彩渲染緩沖器或紋理將具有指定的內部格式,并且將被綁定到`GL_COLOR_ATTACHMENT0`附件中的幀緩沖區對象。 如果你想使用一個幀緩沖對象啟用多重采樣作為紋理,你首先需要從它復制到使用QGLContext.blitFramebuffer ( )一個普通幀緩沖區對象。 ### Threading 由于Qt的4.8的,有可能用來繪制成QGLFramebufferObject一個[QPainter](qpainter.html)在一個單獨的線程。需要注意的是OpenGL的2.0或OpenGL ES 2.0的是需要這種合作。此外, X11下,有必要設置[Qt.AA_X11InitThreads](qt.html#ApplicationAttribute-enum)應用屬性。 * * * ## Type Documentation ``` QGLFramebufferObject.Attachment ``` 該枚舉類型是用來配置連接到幀緩沖對象被創建時,它的深度和模板緩沖區。 | Constant | Value | Description | | --- | --- | --- | | `QGLFramebufferObject.NoAttachment` | `0` | 沒有附件被添加到幀緩沖區對象。需要注意的是渲染到幀緩沖區對象,沒有任何深度或模板緩沖區時, OpenGL的深度和模板測試將無法正常工作。這是默認值。 | | `QGLFramebufferObject.CombinedDepthStencil` | `1` | 如果`GL_EXT_packed_depth_stencil`擴展目前,結合深度和模板緩存連接。如果擴展名不存在,只有深度緩沖區連接。 | | `QGLFramebufferObject.Depth` | `2` | 深度緩沖連接到幀緩沖區對象。 | 這個枚舉被引入或修改的Qt 4.3 。 **See also** [attachment](qglframebufferobject.html#attachment)( ) 。 * * * ## Method Documentation ``` QGLFramebufferObject.__init__ (self, QSize?size, int?target?=?GL_TEXTURE_2D) ``` 構造一個OpenGL幀緩沖區對象和一個2D GL紋理結合到大小的緩沖_size_。紋理被綁定到`GL_COLOR_ATTACHMENT0`針對在幀緩沖對象。 該_target_參數用于指定總帳質感目標。默認的目標是`GL_TEXTURE_2D`。請記住,`GL_TEXTURE_2D`紋理必須有2寬度和高度(如256×512個)的功率,除非你正在使用的OpenGL 2.0或更高版本。 默認情況下,沒有深度和模板緩沖區連接。這種行為可以使用重載的構造函數之一進行切換。 默認的內部紋理格式是`GL_RGBA8`對于桌面OpenGL ,和`GL_RGBA`為OpenGL / ES 。 你有一個當前的GL上下文創建時設置是很重要的[QGLFramebufferObject](qglframebufferobject.html),否則初始化將失敗。 **See also** [size](qglframebufferobject.html#size)( )[texture](qglframebufferobject.html#texture)()和[attachment](qglframebufferobject.html#attachment)( ) 。 ``` QGLFramebufferObject.__init__ (self, int?width, int?height, int?target?=?GL_TEXTURE_2D) ``` 這是一個重載函數。 構造一個OpenGL幀緩沖區對象和GL 2D紋理綁定到給定緩沖區_width_和_height_。 **See also** [size](qglframebufferobject.html#size)()和[texture](qglframebufferobject.html#texture)( ) 。 ``` QGLFramebufferObject.__init__ (self, QSize?size, Attachment?attachment, int?target?=?GL_TEXTURE_2D, int?internalFormat?=?GL_RGBA8) ``` 這是一個重載函數。 構造給定一個OpenGL幀緩沖區對象_size_基于所提供的_format_。 ``` QGLFramebufferObject.__init__ (self, int?width, int?height, Attachment?attachment, int?target?=?GL_TEXTURE_2D, int?internalFormat?=?GL_RGBA8) ``` 這是一個重載函數。 構造給定一個OpenGL幀緩沖區對象_width_和_height_基于所提供的_format_。 ``` QGLFramebufferObject.__init__ (self, QSize?size, QGLFramebufferObjectFormat?format) ``` 這是一個重載函數。 構造一個OpenGL幀緩沖區對象和紋理綁定到給定緩沖區_width_和_height_。 該_attachment_參數描述了深度/模板緩存配置,_target_紋理和目標_internal_format_內部紋理格式。默認質感的目標是`GL_TEXTURE_2D`,而默認的內部格式是`GL_RGBA8`桌面OpenGL和`GL_RGBA`為OpenGL / ES 。 **See also** [size](qglframebufferobject.html#size)( )[texture](qglframebufferobject.html#texture)()和[attachment](qglframebufferobject.html#attachment)( ) 。 ``` QGLFramebufferObject.__init__ (self, int?width, int?height, QGLFramebufferObjectFormat?format) ``` 這是一個重載函數。 構造一個OpenGL幀緩沖區對象和紋理綁定到給定緩沖區_size_。 該_attachment_參數描述了深度/模板緩存配置,_target_紋理和目標_internal_format_內部紋理格式。默認質感的目標是`GL_TEXTURE_2D`,而默認的內部格式是`GL_RGBA8`桌面OpenGL和`GL_RGBA`為OpenGL / ES 。 **See also** [size](qglframebufferobject.html#size)( )[texture](qglframebufferobject.html#texture)()和[attachment](qglframebufferobject.html#attachment)( ) 。 ``` Attachment QGLFramebufferObject.attachment (self) ``` [ 返回附加到該幀緩沖區對象的深度和模具緩沖器的狀態。 ``` bool QGLFramebufferObject.bind (self) ``` 從默認的開關渲染,窗口提供系統的framebuffer來此幀緩沖區對象。成功時返回真,否則返回False。 ](qglframebufferobject.html#Attachment-enum) [**See also**](qglframebufferobject.html#Attachment-enum) [release](qglframebufferobject.html#release)( ) 。 ``` QGLFramebufferObject.blitFramebuffer (QGLFramebufferObject?target, QRect?targetRect, QGLFramebufferObject?source, QRect?sourceRect, int?buffers?=?GL_COLOR_BUFFER_BIT, int?filter?=?GL_NEAREST) ``` 從位塊傳輸_sourceRect_矩形的_source_幀緩沖區對象的_targetRect_矩形的_target_幀緩沖區對象。 If _source_ or _target_是0 ,則默認幀緩沖區將被用于一個幀緩沖對象作為源或目標,而不是分別。 該_buffers_參數應該包括任何組合的掩模`GL_COLOR_BUFFER_BIT`,`GL_DEPTH_BUFFER_BIT`和`GL_STENCIL_BUFFER_BIT`。任何未在源和目標緩沖器呈現兩個緩沖器類型被忽略。 該_sourceRect_和_targetRect_矩形可以有不同的大小,在這種情況_buffers_不應該包含`GL_DEPTH_BUFFER_BIT` or `GL_STENCIL_BUFFER_BIT`。該_filter_參數應該被設置為`GL_LINEAR` or `GL_NEAREST`以及指定是否線性的或最接近的內插時,執行縮放應該被使用。 If _source_等于_target_副本相同的緩沖區內進行。結果是不確定的,如果源和目標矩形重疊,并且具有不同的尺寸。的大小也必須相同,如果任何幀緩沖的對象是多重采樣的幀緩沖區。 請注意,如果啟用了剪刀測試將限制位塊傳輸的區域。 此功能不會有任何影響,除非[hasOpenGLFramebufferBlit](qglframebufferobject.html#hasOpenGLFramebufferBlit)( )返回True 。 此功能被引入Qt的4.6 。 **See also** [hasOpenGLFramebufferBlit](qglframebufferobject.html#hasOpenGLFramebufferBlit)( ) 。 ``` QGLFramebufferObject.drawTexture (self, QRectF?target, int?textureId, int?textureTarget?=?GL_TEXTURE_2D) ``` 繪制給定的質感,_textureId_向給定目標矩形,_target_在OpenGL的模型空間。該_textureTarget_應該是一個2D紋理的目標。 幀緩沖對象應該調用這個函數時的約束。 等同于相應的[QGLContext.drawTexture](qglcontext.html#drawTexture)( ) 。 此功能被引入Qt的4.4 。 ``` QGLFramebufferObject.drawTexture (self, QPointF?point, int?textureId, int?textureTarget?=?GL_TEXTURE_2D) ``` 繪制給定的質感,_textureId_,在給定的_point_在OpenGL的模型空間。該_textureTarget_應該是一個2D紋理的目標。 幀緩沖對象應該調用這個函數時的約束。 等同于相應的[QGLContext.drawTexture](qglcontext.html#drawTexture)( ) 。 此功能被引入Qt的4.4 。 ``` QGLFramebufferObjectFormat QGLFramebufferObject.format (self) ``` [ 返回此幀緩沖區對象的格式。 ``` int QGLFramebufferObject.handle (self) ``` 返回此幀緩沖區對象的GL幀緩沖對象句柄(由返回`glGenFrameBuffersEXT()`功能)。這個句柄可以被用來連接新的圖像或緩沖區的幀緩沖。用戶是負責清理和銷毀這些對象。 ``` bool QGLFramebufferObject.hasOpenGLFramebufferBlit () ``` 返回True如果OpenGL的`GL_EXT_framebuffer_blit`擴展出現在這個系統上,否則返回False 。 此功能被引入Qt的4.6 。 ](qglframebufferobjectformat.html) [**See also**](qglframebufferobjectformat.html) [blitFramebuffer](qglframebufferobject.html#blitFramebuffer)( ) 。 ``` bool QGLFramebufferObject.hasOpenGLFramebufferObjects () ``` 返回True如果OpenGL的`GL_EXT_framebuffer_object`擴展出現在這個系統上,否則返回False 。 ``` bool QGLFramebufferObject.isBound (self) ``` 如果幀緩沖區對象當前綁定到一個上下文,否則返回False ,則返回True 。 此功能被引入Qt的4.5 。 ``` bool QGLFramebufferObject.isValid (self) ``` 返回True如果幀緩沖對象是有效的。 如果初始化進程失敗時,使用者將一個無效緩存到幀緩沖區對象,或者兩種寬度/高度的非功率被指定為紋理大小,如果紋理是目標幀緩沖可以成為無效`GL_TEXTURE_2D`。兩條限制非電力不適用,如果OpenGL版本為2.0或更高版本,或者如果GL_ARB_texture_non_power_of_two擴展存在。 幀緩沖也可以成為無效的,如果[QGLContext](qglcontext.html)該幀緩存創建內被破壞,并且沒有其他共享的上下文,可以采取在幀緩沖區的所有權。 ``` int QGLFramebufferObject.metric (self, QPaintDevice.PaintDeviceMetric?metric) ``` 從重新實現[QPaintDevice.metric](qpaintdevice.html#metric)( ) 。 ``` QPaintEngine QGLFramebufferObject.paintEngine (self) ``` [](qpaintengine.html) [從重新實現](qpaintengine.html)[QPaintDevice.paintEngine](qpaintdevice.html#paintEngine)( ) 。 ``` bool QGLFramebufferObject.release (self) ``` 切換渲染回默認的,窗口提供系統的framebuffer 。成功時返回真,否則返回False。 **See also** [bind](qglframebufferobject.html#bind)( ) 。 ``` QSize QGLFramebufferObject.size (self) ``` [ 返回附加到該幀緩沖區對象的紋理的大小。 ``` int QGLFramebufferObject.texture (self) ``` 返回紋理ID為連接作為默認渲染目標在此幀緩沖區對象的質感。這種質地的id可以在自己的總帳代碼綁定作為一個正常的質感。 如果一個多重采樣幀緩沖區對象被使用,那么從這個函數返回的值將是無效的。 ](qsize.html) ``` QImage QGLFramebufferObject.toImage (self) ``` [](qimage.html) [返回此幀緩沖區對象的內容作為](qimage.html)[QImage](qimage.html)。
                  <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>

                              哎呀哎呀视频在线观看