QQuickRenderTarget Class

The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a render target, and associated metadata. 更多...

头: #include <QQuickRenderTarget>
CMake: find_package(Qt6 COMPONENTS Quick REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: QT += quick
Since: Qt 6.0

公共函数

  QQuickRenderTarget ()
  ~QQuickRenderTarget ()
bool isNull () const

静态公共成员

QQuickRenderTarget fromD3D11Texture (void * texture , const QSize & pixelSize , int sampleCount = 1)
QQuickRenderTarget fromMetalTexture (MTLTexture * texture , const QSize & pixelSize , int sampleCount = 1)
QQuickRenderTarget fromOpenGLRenderBuffer (uint renderbufferId , const QSize & pixelSize , int sampleCount = 1)
QQuickRenderTarget fromOpenGLTexture (uint textureId , const QSize & pixelSize , int sampleCount = 1)
QQuickRenderTarget fromVulkanImage (VkImage image , VkImageLayout layout , const QSize & pixelSize , int sampleCount = 1)
bool operator!= (const QQuickRenderTarget & a , const QQuickRenderTarget & b )
bool operator== (const QQuickRenderTarget & a , const QQuickRenderTarget & b )

详细描述

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickGraphicsDevice .

成员函数文档编制

QQuickRenderTarget:: QQuickRenderTarget ()

Constructs a default QQuickRenderTarget that does not reference any native objects.

QQuickRenderTarget:: ~QQuickRenderTarget ()

析构函数。

[static] QQuickRenderTarget QQuickRenderTarget:: fromD3D11Texture ( void * texture , const QSize & pixelSize , int sampleCount = 1)

返回新的 QQuickRenderTarget referencing an D3D11 texture object specified by texture .

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

注意: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickRenderControl .

[static] QQuickRenderTarget QQuickRenderTarget:: fromMetalTexture ( MTLTexture * texture , const QSize & pixelSize , int sampleCount = 1)

返回新的 QQuickRenderTarget referencing an Metal texture object specified by texture .

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

注意: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickRenderControl .

[static, since 6.2] QQuickRenderTarget QQuickRenderTarget:: fromOpenGLRenderBuffer ( uint renderbufferId , const QSize & pixelSize , int sampleCount = 1)

返回新的 QQuickRenderTarget referencing an OpenGL renderbuffer object specified by renderbufferId .

The renderbuffer will be used as the color attachment for the internal framebuffer object. This function is provided to allow targeting renderbuffers that are created by the application with some external buffer underneath, such as an EGLImageKHR. Once the application has called glEGLImageTargetRenderbufferStorageOES , the renderbuffer can be passed to this function.

pixelSize specifies the size of the image, in pixels.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample renderbuffer.

注意: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

该函数在 Qt 6.2 引入。

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickRenderControl .

[static] QQuickRenderTarget QQuickRenderTarget:: fromOpenGLTexture ( uint textureId , const QSize & pixelSize , int sampleCount = 1)

返回新的 QQuickRenderTarget referencing an OpenGL texture object specified by textureId .

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

注意: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickRenderControl .

[static] QQuickRenderTarget QQuickRenderTarget:: fromVulkanImage ( VkImage image , VkImageLayout layout , const QSize & pixelSize , int sampleCount = 1)

返回新的 QQuickRenderTarget referencing an Vulkan image object specified by image . The current layout of the image must be provided as well.

pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.

sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.

注意: the resulting QQuickRenderTarget does not own any native resources, it merely contains references and the associated metadata of the size and sample count. It is the caller's responsibility to ensure that the native resource exists as long as necessary.

另请参阅 QQuickWindow::setRenderTarget () 和 QQuickRenderControl .

bool QQuickRenderTarget:: isNull () const

返回 true,若此 QQuickRenderTarget is default constructed, referencing no native objects.

相关非成员

bool operator!= (const QQuickRenderTarget & a , const QQuickRenderTarget & b )

返回 true 若 a and b refer to a different set of native objects, or the associated data (size, sample count) does not match.

bool operator== (const QQuickRenderTarget & a , const QQuickRenderTarget & b )

返回 true 若 a and b refer to the same set of native objects and have matching associated data (size, sample count).