Qt3DRender::QBlitFramebuffer Class
class Qt3DRender::QBlitFramebufferFrameGraph 节点,用于将渲染目标中一个区域的像素值矩形传输到另一个区域。更多内容...
| 标题: | #include <qblitframebuffer.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender) target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| 在 QML 中: | BlitFramebuffer |
| 继承自: | Qt3DRender::QFrameGraphNode |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议在新代码中不要使用它。
公共类型
| enum | InterpolationMethod { Nearest, Linear } |
属性
|
|
公共函数
| QBlitFramebuffer(Qt3DCore::QNode *parent = nullptr) | |
| virtual | ~QBlitFramebuffer() |
| Qt3DRender::QRenderTarget * | destination() const |
| Qt3DRender::QRenderTargetOutput::AttachmentPoint | destinationAttachmentPoint() const |
| QRectF | destinationRect() const |
| Qt3DRender::QBlitFramebuffer::InterpolationMethod | interpolationMethod() const |
| void | setDestination(Qt3DRender::QRenderTarget *destination) |
| void | setDestinationAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint) |
| void | setDestinationRect(const QRectF &outputRect) |
| void | setInterpolationMethod(Qt3DRender::QBlitFramebuffer::InterpolationMethod interpolationMethod) |
| void | setSource(Qt3DRender::QRenderTarget *source) |
| void | setSourceAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint) |
| void | setSourceRect(const QRectF &inputRect) |
| Qt3DRender::QRenderTarget * | source() const |
| Qt3DRender::QRenderTargetOutput::AttachmentPoint | sourceAttachmentPoint() const |
| QRectF | sourceRect() const |
信号
| void | destinationAttachmentPointChanged() |
| void | destinationChanged() |
| void | destinationRectChanged() |
| void | interpolationMethodChanged() |
| void | sourceAttachmentPointChanged() |
| void | sourceChanged() |
| void | sourceRectChanged() |
详细说明
该节点将glBlitFrameBuffer 或等效内容插入到命令流中。与绘制带纹理的四边形相比,这为在纹理或由QRenderTarget 封装的表面后缓冲区之间复制矩形提供了一种更高效的方法。它还支持使用指定的插值方法进行缩放。
注意:实际上, QBlitFramebuffer节点通常会与QNoDraw 结合使用,因为位图复制操作不应涉及对任何实体的绘制调用。
成员类型文档
enum QBlitFramebuffer::InterpolationMethod
指定在拉伸图像时应用的插值方法。
| 常量 | 值 | 描述 |
|---|---|---|
Qt3DRender::QBlitFramebuffer::Nearest | 0 | 最近邻插值。 |
Qt3DRender::QBlitFramebuffer::Linear | 1 | 线性插值。 |
属性文档
destination : Qt3DRender::QRenderTarget*
指定目标渲染目标。如果未设置,则假定目标为默认帧缓冲区(即当前表面的后缓冲区),前提是存在该缓冲区。
注意: 源和目标不得指向同一个渲染目标。
访问函数:
| Qt3DRender::QRenderTarget * | destination() const |
| void | setDestination(Qt3DRender::QRenderTarget *destination) |
通知器信号:
| void | destinationChanged() |
destinationAttachmentPoint : Qt3DRender::QRenderTargetOutput::AttachmentPoint
指定目标连接点。
访问函数:
| Qt3DRender::QRenderTargetOutput::AttachmentPoint | destinationAttachmentPoint() const |
| void | setDestinationAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint) |
通知信号:
| void | destinationAttachmentPointChanged() |
destinationRect : QRectF
指定目标矩形。坐标默认采用标准的 Qt 坐标系,即 Y 轴从上至下。
访问函数:
| QRectF | destinationRect() const |
| void | setDestinationRect(const QRectF &outputRect) |
通知器信号:
| void | destinationRectChanged() |
interpolationMethod : InterpolationMethod
该属性用于指定在拉伸图像时应用的插值方法。
指定在拉伸图像时应用的插值方法。默认值为“线性”。
访问函数:
| Qt3DRender::QBlitFramebuffer::InterpolationMethod | interpolationMethod() const |
| void | setInterpolationMethod(Qt3DRender::QBlitFramebuffer::InterpolationMethod interpolationMethod) |
通知信号:
| void | interpolationMethodChanged() |
source : Qt3DRender::QRenderTarget*
指定源渲染目标。如果未设置,则假定源为默认帧缓冲区(即当前表面的后缓冲区),如果存在的话。
注意: 源和目标不得指向同一个渲染目标。
访问函数:
通知器信号:
| void | sourceChanged() |
sourceAttachmentPoint : Qt3DRender::QRenderTargetOutput::AttachmentPoint
指定源连接点。
访问函数:
| Qt3DRender::QRenderTargetOutput::AttachmentPoint | sourceAttachmentPoint() const |
| void | setSourceAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint) |
通知信号:
| void | sourceAttachmentPointChanged() |
sourceRect : QRectF
指定源矩形。坐标默认遵循标准的 Qt 坐标系,即 Y 轴从上到下。
访问函数:
| QRectF | sourceRect() const |
| void | setSourceRect(const QRectF &inputRect) |
通知器信号:
| void | sourceRectChanged() |
成员函数文档
[explicit] QBlitFramebuffer::QBlitFramebuffer(Qt3DCore::QNode *parent = nullptr)
使用给定的parent 创建一个新的QBlitFramebuffer。
[virtual noexcept] QBlitFramebuffer::~QBlitFramebuffer()
析构函数。
Qt3DRender::QRenderTarget *QBlitFramebuffer::destination() const
返回目标渲染目标。
注意: 这是 destination 属性的获取器 函数。
另请参阅 setDestination()。
Qt3DRender::QRenderTargetOutput::AttachmentPoint QBlitFramebuffer::destinationAttachmentPoint() const
返回目标锚点。
注意: 这是 destinationAttachmentPoint 属性的获取器 函数。
另请参阅 ` setDestinationAttachmentPoint()`。
QRectF QBlitFramebuffer::destinationRect() const
返回目标矩形。
注意: 这是 destinationRect 属性的获取 函数。
另请参阅 setDestinationRect()。
Qt3DRender::QBlitFramebuffer::InterpolationMethod QBlitFramebuffer::interpolationMethod() const
返回插值方法。
注意: 这是属性 interpolationMethod的获取 函数。
另请参阅 ` setInterpolationMethod()`。
void QBlitFramebuffer::setDestination(Qt3DRender::QRenderTarget *destination)
设置目标渲染目标。默认值为 nullptr,此时若存在目标,则默认将其视为默认帧缓冲区(即当前表面的后缓冲区)。
注意: 源和目标不得指向同一个渲染目标。
注意: 与其他节点一样 ,当未设置父节点时,destination 会自动成为QBlitFramebuffer 实例的子节点。其生命周期也会被跟踪,这意味着如果当前设置的destination 被销毁,目标将恢复为nullptr。
注意: 属性destination 的设置 函数。
另请参阅 destination()。
void QBlitFramebuffer::setDestinationAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint)
设置destinationAttachmentPoint 。默认值为Qt3DRender::QRenderTargetOutput::AttachmentPoint::Color0 。
注意: 这是属性destinationAttachmentPoint 的设置 函数。
另请参阅 destinationAttachmentPoint()。
void QBlitFramebuffer::setDestinationRect(const QRectF &outputRect)
将目标矩形设置为outputRect 。坐标按Qt标准坐标系计算,即Y轴从上到下。
注意: 这是属性destinationRect 的设置 函数。
另请参阅 destinationRect()。
void QBlitFramebuffer::setInterpolationMethod(Qt3DRender::QBlitFramebuffer::InterpolationMethod interpolationMethod)
设置在拉伸图像时应用的interpolationMethod 。默认值为Linear。
注意: 这是属性interpolationMethod 的设置 函数。
另请参阅 interpolationMethod()。
void QBlitFramebuffer::setSource(Qt3DRender::QRenderTarget *source)
设置源渲染目标。默认值为 nullptr,此时若存在源渲染目标,则默认将其视为默认帧缓冲区(即当前表面的后缓冲区)。
注意: 源和目标不得指向同一个渲染目标。
注意: 与其他节点一样, 若未设置父节点,则source 会自动作为QBlitFramebuffer 实例的子节点。其生命周期也会被追踪,这意味着如果当前设置的source 被销毁,源将恢复为nullptr。
注意: 属性 `source`的设置 函数。
另请参阅 source()。
void QBlitFramebuffer::setSourceAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint)
设置sourceAttachmentPoint 。默认值为Qt3DRender::QRenderTargetOutput::AttachmentPoint::Color0 。
注意: 这是属性sourceAttachmentPoint 的设置 函数。
另请参阅 sourceAttachmentPoint()。
void QBlitFramebuffer::setSourceRect(const QRectF &inputRect)
将源矩形设置为inputRect 。坐标默认遵循标准的Qt坐标系,即Y轴从上到下。
注意: 这是属性sourceRect 的设置 函数。
另请参阅 sourceRect()。
Qt3DRender::QRenderTarget *QBlitFramebuffer::source() const
返回源渲染目标。
注意: 这是属性 source 的获取 函数。
另请参阅 setSource()。
Qt3DRender::QRenderTargetOutput::AttachmentPoint QBlitFramebuffer::sourceAttachmentPoint() const
返回源锚点。
注意: 这是 sourceAttachmentPoint 属性的获取函数 。
另请参阅 ` setSourceAttachmentPoint()`。
QRectF QBlitFramebuffer::sourceRect() const
返回源矩形。
注意: 这是 sourceRect 属性的获取 函数。
另请参阅 ` setSourceRect()`。
© 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.