Qt3DRender::QBlitFramebuffer Class

class Qt3DRender::QBlitFramebuffer

FrameGraph 节点,用于将像素值矩形从渲染目标的一个区域传输到另一个区域。更多

Header: #include <QBlitFramebuffer>
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

信号

详细说明

此节点会在命令流中插入glBlitFrameBuffer 或同等内容。与绘制纹理四边形相比,它为在纹理或由QRenderTarget 封装的曲面后缓冲区之间复制矩形提供了更有效的方法。它还支持使用指定的插值方法进行缩放。

注: 在实践中,QBlitFramebuffer 节点经常与QNoDraw 结合使用,因为 blit 不应涉及为任何实体发出绘制调用。

成员类型文档

enum QBlitFramebuffer::InterpolationMethod

指定拉伸图像时应用的插值。

常数说明
Qt3DRender::QBlitFramebuffer::Nearest0最近邻插值。
Qt3DRender::QBlitFramebuffer::Linear1线性插值

属性文档

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

source : Qt3DRender::QRenderTarget*

指定源渲染目标。如果未设置,源会被认为是默认帧缓冲(即当前曲面的后缓冲)(如果有的话)。

注意: 源和目标不能指向同一个渲染目标。

访问函数

Qt3DRender::QRenderTarget *source() const
void setSource(Qt3DRender::QRenderTarget *source)

通知信号

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)

Notifier 信号:

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 。默认为线性。

注: 属性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

返回源呈现目标。

注: 属性源的获取函数。

另请参阅 setSource().

Qt3DRender::QRenderTargetOutput::AttachmentPoint QBlitFramebuffer::sourceAttachmentPoint() const

返回源连接点。

注: 属性 sourceAttachmentPoint 的获取函数。

另请参阅 setSourceAttachmentPoint().

QRectF QBlitFramebuffer::sourceRect() const

返回源矩形。

注: 属性 sourceRect 的获取函数。

另请参阅 setSourceRect()。

© 2025 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.