本页内容

QRhiSampler 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
继承自: 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

指定缩小、放大或MIP映射过滤

常量值描述
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() const。

返回资源类型。

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 。

如果纹理没有米普级别,或者不需要考虑米普级别,请将此选项设置为“None”。

另请参阅 mipmapMode()。

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

设置纹理比较函数op 。

另请参阅 textureCompareOp()。

QRhiSampler::CompareOp QRhiSampler::textureCompareOp() const

返回纹理比较函数。

另请参阅 setTextureCompareOp()。

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