QRhiSampler Class

采样器资源。更多

头文件: #include <rhi/qrhi.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::GuiPrivate)
qmake: QT += gui-private
Qt 6.6
继承: QRhiResource

公共类型

enum AddressMode { Repeat, ClampToEdge, Mirror }
enum CompareOp { Never, Less, Equal, LessOrEqual, Greater, …, Always }
enum Filter { None, Nearest, Linear }

公共函数

QRhiSampler::AddressMode addressU() const
QRhiSampler::AddressMode addressV() const
QRhiSampler::AddressMode addressW() const
QRhiSampler::Filter magFilter() const
QRhiSampler::Filter minFilter() const
QRhiSampler::Filter mipmapMode() const
void setAddressU(QRhiSampler::AddressMode mode)
void setAddressV(QRhiSampler::AddressMode mode)
void setAddressW(QRhiSampler::AddressMode mode)
void setMagFilter(QRhiSampler::Filter f)
void setMinFilter(QRhiSampler::Filter f)
void setMipmapMode(QRhiSampler::Filter f)
void setTextureCompareOp(QRhiSampler::CompareOp op)
QRhiSampler::CompareOp textureCompareOp() const

重新实现的公共函数

virtual QRhiResource::Type resourceType() const override

详细说明

注: 这是一个 RHI API,具有有限的兼容性保证,详情请参见QRhi

成员类型文档

enum QRhiSampler::AddressMode

指定寻址模式

常数
QRhiSampler::Repeat0
QRhiSampler::ClampToEdge1
QRhiSampler::Mirror2

enum QRhiSampler::CompareOp

指定纹理比较函数。

常数说明
QRhiSampler::Never0(默认值)
QRhiSampler::Less1
QRhiSampler::Equal2
QRhiSampler::LessOrEqual3
QRhiSampler::Greater4
QRhiSampler::NotEqual5
QRhiSampler::GreaterOrEqual6
QRhiSampler::Always7

enum QRhiSampler::Filter

指定最小化、放大或 mipmap 过滤

常数说明
QRhiSampler::None0仅适用于mipmapMode(),表示不使用 mipmap
QRhiSampler::Nearest1
QRhiSampler::Linear2

成员函数文档

QRhiSampler::AddressMode QRhiSampler::addressU() const

返回水平换行模式。

另请参见 setAddressU()。

QRhiSampler::AddressMode QRhiSampler::addressV() const

返回垂直换行模式。

另请参见 setAddressV()。

QRhiSampler::AddressMode QRhiSampler::addressW() const

返回深度包模式。

另请参见 setAddressW()。

QRhiSampler::Filter QRhiSampler::magFilter() const

返回放大滤镜模式。

另请参阅 setMagFilter()。

QRhiSampler::Filter QRhiSampler::minFilter() const

返回最小化过滤模式。

另请参见 setMinFilter()。

QRhiSampler::Filter QRhiSampler::mipmapMode() const

返回 mipmap 过滤模式。

另请参阅 setMipmapMode()。

[override virtual] QRhiResource::Type QRhiSampler::resourceType() const

重实现:QRhiResource::resourceType() 常量。

返回资源类型。

void QRhiSampler::setAddressU(QRhiSampler::AddressMode mode)

设置水平换行mode

另请参见 addressU() 。

void QRhiSampler::setAddressV(QRhiSampler::AddressMode mode)

设置垂直换行mode

另请参见 addressV() 。

void QRhiSampler::setAddressW(QRhiSampler::AddressMode mode)

设置深度包络mode

另请参见 addressW() 。

void QRhiSampler::setMagFilter(QRhiSampler::Filter f)

将放大滤镜模式设置为f

另请参阅 magFilter() 。

void QRhiSampler::setMinFilter(QRhiSampler::Filter f)

将最小化过滤模式设置为f

另请参阅 minFilter() 。

void QRhiSampler::setMipmapMode(QRhiSampler::Filter f)

将 mipmap 滤波模式设置为f

如果纹理没有 mip 层次,或不考虑 mip 层次,则将此设置为 "无"。

另请参阅 mipmapMode() 。

void QRhiSampler::setTextureCompareOp(QRhiSampler::CompareOp op)

设置纹理比较函数op

另请参阅 textureCompareOp() 。

QRhiSampler::CompareOp QRhiSampler::textureCompareOp() const

返回纹理比较函数。

另请参阅 setTextureCompareOp()。

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