- Qt 6.6
- Qt GUI
- C++ Classes
- QRhiSampler
- Qt 6.6.2 Reference Documentation

# QRhiSampler Class

Sampler resource. More...

Header: | #include <QRhiSampler>
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: | QT += gui
Since: | Qt 6.6
Inherits: | QRhiResource

- List of all members, including inherited members

## Public Types

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

## Public Functions

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

## Reimplemented Public Functions

virtual QRhiResource::Type | resourceType() const override

## Detailed Description

Note: This is a RHI API with limited compatibility guarantees, see QRhi for details.

## Member Type Documentation

### enum QRhiSampler::AddressMode

Specifies the addressing mode

Constant | Value
--- | ---
`QRhiSampler::Repeat` | `0`
`QRhiSampler::ClampToEdge` | `1`
`QRhiSampler::Mirror` | `2`

### enum QRhiSampler::CompareOp

Specifies the texture comparison function.

Constant | Value | Description
--- | --- | ---
`QRhiSampler::Never` | `0` | (default)
`QRhiSampler::Less` | `1` |
`QRhiSampler::Equal` | `2` |
`QRhiSampler::LessOrEqual` | `3` |
`QRhiSampler::Greater` | `4` |
`QRhiSampler::NotEqual` | `5` |
`QRhiSampler::GreaterOrEqual` | `6` |
`QRhiSampler::Always` | `7` |

### enum QRhiSampler::Filter

Specifies the minification, magnification, or mipmap filtering

Constant | Value | Description
--- | --- | ---
`QRhiSampler::None` | `0` | Applicable only for mipmapMode(), indicates no mipmaps to be used
`QRhiSampler::Nearest` | `1` |
`QRhiSampler::Linear` | `2` |

## Member Function Documentation

### QRhiSampler::AddressMode QRhiSampler::addressU() const

Returns the horizontal wrap mode.

See also setAddressU().

### QRhiSampler::AddressMode QRhiSampler::addressV() const

Returns the vertical wrap mode.

See also setAddressV().

### QRhiSampler::AddressMode QRhiSampler::addressW() const

Returns the depth wrap mode.

See also setAddressW().

### QRhiSampler::Filter QRhiSampler::magFilter() const

Returns the magnification filter mode.

See also setMagFilter().

### QRhiSampler::Filter QRhiSampler::minFilter() const

Returns the minification filter mode.

See also setMinFilter().

### QRhiSampler::Filter QRhiSampler::mipmapMode() const

Returns the mipmap filter mode.

See also setMipmapMode().

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

Reimplements: QRhiResource::resourceType() const.

Returns the resource type.

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

Sets the horizontal wrap mode.

See also addressU().

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

Sets the vertical wrap mode.

See also addressV().

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

Sets the depth wrap mode.

See also addressW().

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

Sets the magnification filter mode to f.

See also magFilter().

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

Sets the minification filter mode to f.

See also minFilter().

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

Sets the mipmap filter mode to f.

Leave this set to None when the texture has no mip levels, or when the mip levels are not to be taken into account.

See also mipmapMode().

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

Sets the texture comparison function op.

See also textureCompareOp().

### QRhiSampler::CompareOp QRhiSampler::textureCompareOp() const

Returns the texture comparison function.

See also setTextureCompareOp().