QRhiTextureCopyDescription Class
描述了一种纹理到纹理的复制操作。更多内容...
| 标题: | #include <rhi/qrhi.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS GuiPrivate) target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate) |
| qmake: | QT += gui-private |
| 自: | Qt 6.6 |
公共函数
| QRhiTextureCopyDescription() | |
| int | destinationLayer() const |
| int | destinationLevel() const |
| QPoint | destinationTopLeft() const |
| QSize | pixelSize() const |
| void | setDestinationLayer(int layer) |
| void | setDestinationLevel(int level) |
| void | setDestinationTopLeft(const QPoint &p) |
| void | setPixelSize(const QSize &sz) |
| void | setSourceLayer(int layer) |
| void | setSourceLevel(int level) |
| void | setSourceTopLeft(const QPoint &p) |
| int | sourceLayer() const |
| int | sourceLevel() const |
| QPoint | sourceTopLeft() const |
详细说明
空的pixelSize() 表示将复制整个子资源。因此,默认构造的复制描述将导致复制第 0 层第 0 级下的整个子资源。
注意: 源纹理必须通过QRhiTexture::UsedAsTransferSource 创建。
注意: 由pixelSize()、sourceTopLeft() 和destinationTopLeft() 定义的源和目标矩形必须分别与源纹理和目标纹理相匹配。否则,行为未定义。
对于立方贴图、3D 纹理和纹理数组,每次可复制一个面或切片。该面或切片由源和目标层索引指定。对于具有 Mip 映射的纹理,每次可复制一个 Mip 级别。 源和目标的层索引以及 Mip 级别索引可以不同,但必须仔细控制大小和位置,以避免发生越界复制,否则行为未定义。
注意:这是一个 兼容性保证有限的 RHI API,详情请参阅QRhi 。
成员函数文档
[constexpr noexcept default] QRhiTextureCopyDescription::QRhiTextureCopyDescription()
构建一个空的纹理复制描述。
int QRhiTextureCopyDescription::destinationLayer() const
返回目标数组层(立方体贴图面或数组层索引)。默认为 0。
另请参阅 setDestinationLayer()。
int QRhiTextureCopyDescription::destinationLevel() const
返回目标MIP级别。默认值为0。
另请参阅 setDestinationLevel()。
QPoint QRhiTextureCopyDescription::destinationTopLeft() const
返回目标区域的左上角位置(以像素为单位)。默认值为 (0, 0)。
另请参阅 setDestinationTopLeft()。
QSize QRhiTextureCopyDescription::pixelSize() const
返回要复制的区域的大小。
注意:若 ` pixelSize()` 为空 ,则表示将复制整个子资源。因此,通过默认构造生成的复制描述将导致复制第 0 层第 0 级下的整个子资源。
另请参阅 setPixelSize()。
void QRhiTextureCopyDescription::setDestinationLayer(int layer)
设置目标数组layer 。
另请参阅 destinationLayer()。
void QRhiTextureCopyDescription::setDestinationLevel(int level)
设置目标MIPlevel 。
另请参阅 destinationLevel()。
void QRhiTextureCopyDescription::setDestinationTopLeft(const QPoint &p)
设置目标的左上角位置p 。
另请参阅 destinationTopLeft()。
void QRhiTextureCopyDescription::setPixelSize(const QSize &sz)
设置要复制到sz 的区域大小。
另请参阅 pixelSize()。
void QRhiTextureCopyDescription::setSourceLayer(int layer)
设置源数组layer 。
另请参阅 sourceLayer()。
void QRhiTextureCopyDescription::setSourceLevel(int level)
设置源MIPlevel 。
另请参阅 sourceLevel()。
void QRhiTextureCopyDescription::setSourceTopLeft(const QPoint &p)
将源图像的左上角位置设置为p 。
另请参阅 sourceTopLeft()。
int QRhiTextureCopyDescription::sourceLayer() const
返回源数组层(立方贴图面或数组层索引)。默认值为 0。
另请参阅 setSourceLayer()。
int QRhiTextureCopyDescription::sourceLevel() const
返回源MIP级别。默认值为0。
另请参阅 setSourceLevel()。
QPoint QRhiTextureCopyDescription::sourceTopLeft() const
返回源图像左上角的位置(以像素为单位)。默认值为 (0, 0)。
另请参阅 setSourceTopLeft()。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. 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.