本页内容

Qt3DRender::QAbstractTexture Class

class Qt3DRender::QAbstractTexture

一个用于提供纹理的基类。更多...

头文件: #include <qabstracttexture.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender)
qmake: QT += 3drender
在 QML 中: AbstractTexture
继承自: Qt3DCore::QNode
被继承类:
13 种类型

Qt3DRender::QSharedGLTexture、Qt3DRender::QTexture1D 、Qt3DRender::QTexture1DArray 、Qt3DRender::QTexture2D 、Qt3DRender::QTexture2DArray 、Qt3DRender::QTexture2DMultisample 、Qt3DRender::QTexture2DMultisampleArray 、Qt3DRender::QTexture3D 、Qt3DRender::QTextureBuffer 、Qt3DRender::QTextureCubeMap 、Qt3DRender::QTextureCubeMapArray 、Qt3DRender::QTextureLoader ,以及Qt3DRender::QTextureRectangle

状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共类型

enum CubeMapFace { CubeMapPositiveX, CubeMapNegativeX, CubeMapPositiveY, CubeMapNegativeY, CubeMapPositiveZ, …, AllFaces }
enum Filter { Nearest, Linear, NearestMipMapNearest, NearestMipMapLinear, LinearMipMapNearest, LinearMipMapLinear }
enum Status { None, Loading, Ready, Error }
enum Target { TargetAutomatic, Target1D, Target1DArray, Target2D, Target2DArray, …, TargetBuffer }
enum TextureFormat { NoFormat, Automatic, R8_UNorm, RG8_UNorm, RGB8_UNorm, …, LuminanceAlphaFormat }

属性

公共函数

void addTextureImage(Qt3DRender::QAbstractTextureImage *textureImage)
Qt3DRender::QAbstractTexture::ComparisonFunction comparisonFunction() const
Qt3DRender::QAbstractTexture::ComparisonMode comparisonMode() const
int depth() const
Qt3DRender::QAbstractTexture::TextureFormat format() const
bool generateMipMaps() const
QVariant handle() const
Qt3DRender::QAbstractTexture::HandleType handleType() const
int height() const
int layers() const
Qt3DRender::QAbstractTexture::Filter magnificationFilter() const
float maximumAnisotropy() const
Qt3DRender::QAbstractTexture::Filter minificationFilter() const
int mipLevels() const
void removeTextureImage(Qt3DRender::QAbstractTextureImage *textureImage)
int samples() const
void setSize(int w, int h = 1, int d = 1)
void setWrapMode(const Qt3DRender::QTextureWrapMode &wrapMode)
Qt3DRender::QAbstractTexture::Status status() const
Qt3DRender::QAbstractTexture::Target target() const
QList<Qt3DRender::QAbstractTextureImage *> textureImages() const
void updateData(const Qt3DRender::QTextureDataUpdate &update)
int width() const
Qt3DRender::QTextureWrapMode *wrapMode()

公共槽位

void setComparisonFunction(Qt3DRender::QAbstractTexture::ComparisonFunction function)
void setComparisonMode(Qt3DRender::QAbstractTexture::ComparisonMode mode)
void setDepth(int depth)
void setFormat(Qt3DRender::QAbstractTexture::TextureFormat format)
void setGenerateMipMaps(bool gen)
void setHeight(int height)
void setLayers(int layers)
void setMagnificationFilter(Qt3DRender::QAbstractTexture::Filter f)
void setMaximumAnisotropy(float anisotropy)
void setMinificationFilter(Qt3DRender::QAbstractTexture::Filter f)
void setMipLevels(int mipLevels)
void setSamples(int samples)
void setWidth(int width)

信号

void comparisonFunctionChanged(Qt3DRender::QAbstractTexture::ComparisonFunction comparisonFunction)
void comparisonModeChanged(Qt3DRender::QAbstractTexture::ComparisonMode comparisonMode)
void depthChanged(int depth)
void formatChanged(Qt3DRender::QAbstractTexture::TextureFormat format)
void generateMipMapsChanged(bool generateMipMaps)
void handleChanged(QVariant handle)
void handleTypeChanged(Qt3DRender::QAbstractTexture::HandleType handleType)
void heightChanged(int height)
void layersChanged(int layers)
void magnificationFilterChanged(Qt3DRender::QAbstractTexture::Filter magnificationFilter)
void maximumAnisotropyChanged(float maximumAnisotropy)
void minificationFilterChanged(Qt3DRender::QAbstractTexture::Filter minificationFilter)
void mipLevelsChanged(int mipLevels)
void samplesChanged(int samples)
void statusChanged(Qt3DRender::QAbstractTexture::Status status)
void widthChanged(int width)

受保护函数

QAbstractTexture(Qt3DCore::QNode *parent = nullptr)
QAbstractTexture(Qt3DRender::QAbstractTexture::Target target, Qt3DCore::QNode *parent = nullptr)
void setStatus(Qt3DRender::QAbstractTexture::Status status)

详细说明

不应直接使用 QAbstractTexture 类,而应通过其某个子类进行使用。每个子类都实现了特定的纹理目标(2D、2DArray、3D、CubeMap 等)。每个子类为每一层、立方体贴图的每个面以及每个 MipMap 级别提供了一组函子。 随后,后端会利用这些 functor 将数据正确地填充到相应的 OpenGL 纹理中。预计 functor 应尽可能减少处理操作,以免拖慢纹理的生成和上传速度。如果纹理的内容是由耗时的过程生成算法生成的,则建议不要直接在 functor 中实现该过程。

所有纹理都是唯一的。如果两次实例化相同的纹理,这将在 GPU 上创建两个完全相同的纹理,不会发生资源共享。

成员类型文档

enum QAbstractTexture::CubeMapFace

该枚举用于标识立方体贴图纹理的各个面

常量值描述
Qt3DRender::QAbstractTexture::CubeMapPositiveX0x8515指定立方体贴图的正X面
Qt3DRender::QAbstractTexture::CubeMapNegativeX0x8516指定立方体贴图的负X面
Qt3DRender::QAbstractTexture::CubeMapPositiveY0x8517指定立方体贴图的正 Y 面
Qt3DRender::QAbstractTexture::CubeMapNegativeY0x8518指定立方体贴图的负Y面
Qt3DRender::QAbstractTexture::CubeMapPositiveZ0x8519指定立方体贴图的正 Z 面
Qt3DRender::QAbstractTexture::CubeMapNegativeZ0x851A指定立方体贴图的负 Z 面
Qt3DRender::QAbstractTexture::AllFaces0x851b指定立方贴图的所有面

注意: 仅当需要将某种行为应用于立方贴图的所有面时,才应使用AllFaces 。例如,当将立方贴图用作纹理附加点时即属于这种情况。在附加点规范中使用 AllFaces 将导致所有面都绑定到该附加点。 另一方面,如果指定了特定面,则该附着将仅使用所指定的面。

enum QAbstractTexture::Filter

保存纹理提供程序的滤镜类型。

常量值描述
Qt3DRender::QAbstractTexture::Nearest0x2600GL_NEAREST
Qt3DRender::QAbstractTexture::Linear0x2601GL_LINEAR
Qt3DRender::QAbstractTexture::NearestMipMapNearest0x2700GL_NEAREST_MIPMAP_NEAREST
Qt3DRender::QAbstractTexture::NearestMipMapLinear0x2702GL_NEAREST_MIPMAP_LINEAR
Qt3DRender::QAbstractTexture::LinearMipMapNearest0x2701GL_LINEAR_MIPMAP_NEAREST
Qt3DRender::QAbstractTexture::LinearMipMapLinear0x2703GL_LINEAR_MIPMAP_LINEAR

enum QAbstractTexture::Status

包含纹理提供程序的状态。

常量值
Qt3DRender::QAbstractTexture::None0
Qt3DRender::QAbstractTexture::Loading1
Qt3DRender::QAbstractTexture::Ready2
Qt3DRender::QAbstractTexture::Error3

enum QAbstractTexture::Target

常数值描述
Qt3DRender::QAbstractTexture::TargetAutomatic0目标将由 Qt3D 引擎确定
Qt3DRender::QAbstractTexture::Target1D0x0DE0GL_TEXTURE_1D
Qt3DRender::QAbstractTexture::Target1DArray0x8C18GL_TEXTURE_1D_ARRAY
Qt3DRender::QAbstractTexture::Target2D0x0DE1GL_TEXTURE_2D
Qt3DRender::QAbstractTexture::Target2DArray0x8C1AGL_TEXTURE_2D_ARRAY
Qt3DRender::QAbstractTexture::Target3D0x806FGL_TEXTURE_3D
Qt3DRender::QAbstractTexture::TargetCubeMap0x8513GL_TEXTURE_CUBE_MAP
Qt3DRender::QAbstractTexture::TargetCubeMapArray0x9009GL_TEXTURE_CUBE_MAP_ARRAY
Qt3DRender::QAbstractTexture::Target2DMultisample0x9100GL_TEXTURE_2D_MULTISAMPLE
Qt3DRender::QAbstractTexture::Target2DMultisampleArray0x9102GL_TEXTURE_2D_MULTISAMPLE_ARRAY
Qt3DRender::QAbstractTexture::TargetRectangle0x84F5GL_TEXTURE_RECTANGLE
Qt3DRender::QAbstractTexture::TargetBuffer0x8C2AGL_TEXTURE_BUFFER

enum QAbstractTexture::TextureFormat

此列表列出了所有可能的纹理格式

常量值描述
Qt3DRender::QAbstractTexture::NoFormat0GL_NONE
Qt3DRender::QAbstractTexture::Automatic1自动确定格式
Qt3DRender::QAbstractTexture::R8_UNorm0x8229GL_R8
Qt3DRender::QAbstractTexture::RG8_UNorm0x822BGL_RG8
Qt3DRender::QAbstractTexture::RGB8_UNorm0x8051GL_RGB8
Qt3DRender::QAbstractTexture::RGBA8_UNorm0x8058GL_RGBA8
Qt3DRender::QAbstractTexture::R16_UNorm0x822AGL_R16
Qt3DRender::QAbstractTexture::RG16_UNorm0x822CGL_RG16
Qt3DRender::QAbstractTexture::RGB16_UNorm0x8054GL_RGB16
Qt3DRender::QAbstractTexture::RGBA16_UNorm0x805BGL_RGBA16
Qt3DRender::QAbstractTexture::R8_SNorm0x8F94GL_R8_SNORM
Qt3DRender::QAbstractTexture::RG8_SNorm0x8F95GL_RG8_SNORM
Qt3DRender::QAbstractTexture::RGB8_SNorm0x8F96GL_RGB8_SNORM
Qt3DRender::QAbstractTexture::RGBA8_SNorm0x8F97GL_RGBA8_SNORM
Qt3DRender::QAbstractTexture::R16_SNorm0x8F98GL_R16_SNORM
Qt3DRender::QAbstractTexture::RG16_SNorm0x8F99GL_RG16_SNORM
Qt3DRender::QAbstractTexture::RGB16_SNorm0x8F9AGL_RGB16_SNORM
Qt3DRender::QAbstractTexture::RGBA16_SNorm0x8F9BGL_RGBA16_SNORM
Qt3DRender::QAbstractTexture::R8U0x8232GL_R8UI
Qt3DRender::QAbstractTexture::RG8U0x8238GL_RG8UI
Qt3DRender::QAbstractTexture::RGB8U0x8D7DGL_RGB8UI
Qt3DRender::QAbstractTexture::RGBA8U0x8D7CGL_RGBA8UI
Qt3DRender::QAbstractTexture::R16U0x8234GL_R16UI
Qt3DRender::QAbstractTexture::RG16U0x823AGL_RG16UI
Qt3DRender::QAbstractTexture::RGB16U0x8D77GL_RGB16UI
Qt3DRender::QAbstractTexture::RGBA16U0x8D76GL_RGBA16UI
Qt3DRender::QAbstractTexture::R32U0x8236GL_R32UI
Qt3DRender::QAbstractTexture::RG32U0x823CGL_RG32UI
Qt3DRender::QAbstractTexture::RGB32U0x8D71GL_RGB32UI
Qt3DRender::QAbstractTexture::RGBA32U0x8D70GL_RGBA32UI
Qt3DRender::QAbstractTexture::R8I0x8231GL_R8I
Qt3DRender::QAbstractTexture::RG8I0x8237GL_RG8I
Qt3DRender::QAbstractTexture::RGB8I0x8D8FGL_RGB8I
Qt3DRender::QAbstractTexture::RGBA8I0x8D8EGL_RGBA8I
Qt3DRender::QAbstractTexture::R16I0x8233GL_R16I
Qt3DRender::QAbstractTexture::RG16I0x8239GL_RG16I
Qt3DRender::QAbstractTexture::RGB16I0x8D89GL_RGB16I
Qt3DRender::QAbstractTexture::RGBA16I0x8D88GL_RGBA16I
Qt3DRender::QAbstractTexture::R32I0x8235GL_R32I
Qt3DRender::QAbstractTexture::RG32I0x823BGL_RG32I
Qt3DRender::QAbstractTexture::RGB32I0x8D83GL_RGB32I
Qt3DRender::QAbstractTexture::RGBA32I0x8D82GL_RGBA32I
Qt3DRender::QAbstractTexture::R16F0x822DGL_R16F
Qt3DRender::QAbstractTexture::RG16F0x822FGL_RG16F
Qt3DRender::QAbstractTexture::RGB16F0x881BGL_RGB16F
Qt3DRender::QAbstractTexture::RGBA16F0x881AGL_RGBA16F
Qt3DRender::QAbstractTexture::R32F0x822EGL_R32F
Qt3DRender::QAbstractTexture::RG32F0x8230GL_RG32F
Qt3DRender::QAbstractTexture::RGB32F0x8815GL_RGB32F
Qt3DRender::QAbstractTexture::RGBA32F0x8814GL_RGBA32F
Qt3DRender::QAbstractTexture::RGB9E50x8C3DGL_RGB9_E5
Qt3DRender::QAbstractTexture::RG11B10F0x8C3AGL_R11F_G11F_B10F
Qt3DRender::QAbstractTexture::RG3B20x2A10GL_R3_G3_B2
Qt3DRender::QAbstractTexture::R5G6B50x8D62GL_RGB565
Qt3DRender::QAbstractTexture::RGB5A10x8057GL_RGB5_A1
Qt3DRender::QAbstractTexture::RGBA40x8056GL_RGBA4
Qt3DRender::QAbstractTexture::RGB10A20x8059GL_RGB10_A2
Qt3DRender::QAbstractTexture::RGB10A2U0x906FGL_RGB10_A2UI
Qt3DRender::QAbstractTexture::D160x81A5GL_DEPTH_COMPONENT16
Qt3DRender::QAbstractTexture::D240x81A6GL_DEPTH_COMPONENT24
Qt3DRender::QAbstractTexture::D24S80x88F0GL_DEPTH24_STENCIL8
Qt3DRender::QAbstractTexture::D320x81A7GL_DEPTH_COMPONENT32
Qt3DRender::QAbstractTexture::D32F0x8CACGL_DEPTH_COMPONENT32F
Qt3DRender::QAbstractTexture::D32FS8X240x8CADGL_DEPTH32F_STENCIL8
Qt3DRender::QAbstractTexture::RGB_DXT10x83F0GL_COMPRESSED_RGB_S3TC_DXT1_EXT
Qt3DRender::QAbstractTexture::RGBA_DXT10x83F1GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
Qt3DRender::QAbstractTexture::RGBA_DXT30x83F2GL_COMPRESSED_RGBA_S3TC_DXT3_EXT
Qt3DRender::QAbstractTexture::RGBA_DXT50x83F3GL_COMPRESSED_RGBA_S3TC_DXT5_EXT
Qt3DRender::QAbstractTexture::R_ATI1N_UNorm0x8DBBGL_COMPRESSED_RED_RGTC1
Qt3DRender::QAbstractTexture::R_ATI1N_SNorm0x8DBCGL_COMPRESSED_SIGNED_RED_RGTC1
Qt3DRender::QAbstractTexture::RG_ATI2N_UNorm0x8DBDGL_COMPRESSED_RG_RGTC2
Qt3DRender::QAbstractTexture::RG_ATI2N_SNorm0x8DBEGL_COMPRESSED_SIGNED_RG_RGTC2
Qt3DRender::QAbstractTexture::RGB_BP_UNSIGNED_FLOAT0x8E8FGL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB
Qt3DRender::QAbstractTexture::RGB_BP_SIGNED_FLOAT0x8E8EGL_COMPRESSED_RGB_BPTC_有符号_浮点_ARB
Qt3DRender::QAbstractTexture::RGB_BP_UNorm0x8E8CGL_COMPRESSED_RGBA_BPTC_UNORM_ARB
Qt3DRender::QAbstractTexture::R11_EAC_UNorm0x9270GL_COMPRESSED_R11_EAC
Qt3DRender::QAbstractTexture::R11_EAC_SNorm0x9271GL_COMPRESSED_SIGNED_R11_EAC
Qt3DRender::QAbstractTexture::RG11_EAC_UNorm0x9272GL_COMPRESSED_RG11_EAC
Qt3DRender::QAbstractTexture::RG11_EAC_SNorm0x9273GL_COMPRESSED_SIGNED_RG11_EAC
Qt3DRender::QAbstractTexture::RGB8_ETC20x9274GL_COMPRESSED_RGB8_ETC2
Qt3DRender::QAbstractTexture::SRGB8_ETC20x9275GL_COMPRESSED_SRGB8_ETC2
Qt3DRender::QAbstractTexture::RGB8_PunchThrough_Alpha1_ETC20x9276GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
Qt3DRender::QAbstractTexture::SRGB8_PunchThrough_Alpha1_ETC20x9277GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
Qt3DRender::QAbstractTexture::RGBA8_ETC2_EAC0x9278GL_COMPRESSED_RGBA8_ETC2_EAC
Qt3DRender::QAbstractTexture::SRGB8_Alpha8_ETC2_EAC0x9279GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
Qt3DRender::QAbstractTexture::RGB8_ETC10x8D64GL_ETC1_RGB8_OES
Qt3DRender::QAbstractTexture::SRGB80x8C41GL_SRGB8
Qt3DRender::QAbstractTexture::SRGB8_Alpha80x8C43GL_SRGB8_ALPHA8
Qt3DRender::QAbstractTexture::SRGB_DXT10x8C4CGL_COMPRESSED_SRGB_S3TC_DXT1_EXT
Qt3DRender::QAbstractTexture::SRGB_Alpha_DXT10x8C4DGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT
Qt3DRender::QAbstractTexture::SRGB_Alpha_DXT30x8C4EGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT
Qt3DRender::QAbstractTexture::SRGB_Alpha_DXT50x8C4FGL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
Qt3DRender::QAbstractTexture::SRGB_BP_UNorm0x8E8DGL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
Qt3DRender::QAbstractTexture::DepthFormat0x1902GL_DEPTH_COMPONENT
Qt3DRender::QAbstractTexture::AlphaFormat0x1906GL_ALPHA
Qt3DRender::QAbstractTexture::RGBFormat0x1907GL_RGB
Qt3DRender::QAbstractTexture::RGBAFormat0x1908GL_RGBA
Qt3DRender::QAbstractTexture::LuminanceFormat0x1909GL_LUMINANCE
Qt3DRender::QAbstractTexture::LuminanceAlphaFormat0x190A0x190A

属性文档

comparisonFunction : ComparisonFunction

保存纹理提供程序的比较函数。

访问函数:

Qt3DRender::QAbstractTexture::ComparisonFunction comparisonFunction() const
void setComparisonFunction(Qt3DRender::QAbstractTexture::ComparisonFunction function)

通知器信号:

void comparisonFunctionChanged(Qt3DRender::QAbstractTexture::ComparisonFunction comparisonFunction)

comparisonMode : ComparisonMode

保存纹理提供程序的比较模式。

访问函数:

Qt3DRender::QAbstractTexture::ComparisonMode comparisonMode() const
void setComparisonMode(Qt3DRender::QAbstractTexture::ComparisonMode mode)

通知器信号:

void comparisonModeChanged(Qt3DRender::QAbstractTexture::ComparisonMode comparisonMode)

depth : int

存储纹理提供程序的深度。

访问函数:

int depth() const
void setDepth(int depth)

通知器信号:

void depthChanged(int depth)

format : TextureFormat

保存纹理提供程序的格式。

访问函数:

Qt3DRender::QAbstractTexture::TextureFormat format() const
void setFormat(Qt3DRender::QAbstractTexture::TextureFormat format)

通知器信号:

void formatChanged(Qt3DRender::QAbstractTexture::TextureFormat format)

generateMipMaps : bool

指定纹理提供程序是否应自动生成MIP贴图。

访问函数:

bool generateMipMaps() const
void setGenerateMipMaps(bool gen)

通知器信号:

void generateMipMapsChanged(bool generateMipMaps)

[read-only] handle : QVariant

保存当前纹理句柄;如果Qt 3D 使用OpenGL渲染器,则该句柄是一个纹理ID整数。

访问函数:

QVariant handle() const

通知器信号:

void handleChanged(QVariant handle)

[read-only] handleType : HandleType

存储当前纹理句柄类型。

访问函数:

Qt3DRender::QAbstractTexture::HandleType handleType() const

通知器信号:

void handleTypeChanged(Qt3DRender::QAbstractTexture::HandleType handleType)

height : int

存储纹理提供程序的高度。

访问函数:

int height() const
void setHeight(int height)

通知器信号:

void heightChanged(int height)

layers : int

存储纹理提供程序的最大图层数。默认情况下,最大图层数为 1。

注意:此属性 仅对具有 3D 或数组目标格式的纹理提供程序有效。

访问函数:

int layers() const
void setLayers(int layers)

通知器信号:

void layersChanged(int layers)

magnificationFilter : Filter

保存纹理提供程序的缩放滤镜。

访问函数:

Qt3DRender::QAbstractTexture::Filter magnificationFilter() const
void setMagnificationFilter(Qt3DRender::QAbstractTexture::Filter f)

通知器信号:

void magnificationFilterChanged(Qt3DRender::QAbstractTexture::Filter magnificationFilter)

maximumAnisotropy : float

存储纹理提供程序的最大各向异性值。

访问函数:

float maximumAnisotropy() const
void setMaximumAnisotropy(float anisotropy)

通知器信号:

void maximumAnisotropyChanged(float maximumAnisotropy)

minificationFilter : Filter

保存纹理提供程序的压缩过滤器。

访问函数:

Qt3DRender::QAbstractTexture::Filter minificationFilter() const
void setMinificationFilter(Qt3DRender::QAbstractTexture::Filter f)

通知器信号:

void minificationFilterChanged(Qt3DRender::QAbstractTexture::Filter minificationFilter)

mipLevels : int

存储纹理提供程序的Mipmap级别。

访问函数:

int mipLevels() const
void setMipLevels(int mipLevels)

通知器信号:

void mipLevelsChanged(int mipLevels)

samples : int

存储纹理提供程序中每个纹素的采样数。默认情况下,采样数为 1。

注意:此参数 仅对具有多采样格式的纹理提供程序有效。

访问函数:

int samples() const
void setSamples(int samples)

通知信号:

void samplesChanged(int samples)

[read-only] status : Status

保存纹理提供程序的当前状态。

访问函数:

Qt3DRender::QAbstractTexture::Status status() const

通知器信号:

void statusChanged(Qt3DRender::QAbstractTexture::Status status)

[read-only] target : const Target

保存纹理提供程序的目标格式。

注意: 目标格式只能设置一次。

访问函数:

Qt3DRender::QAbstractTexture::Target target() const

width : int

存储纹理提供程序的宽度。

访问函数:

int width() const
void setWidth(int width)

通知器信号:

void widthChanged(int width)

[read-only] wrapMode : Qt3DRender::QTextureWrapMode* const

保存纹理提供程序的环绕模式。

访问函数:

Qt3DRender::QTextureWrapMode *wrapMode()

成员函数文档

[explicit protected] QAbstractTexture::QAbstractTexture(Qt3DCore::QNode *parent = nullptr)

该构造函数会根据指定的parent 创建一个新的QAbstractTexture::QAbstractTexture 实例。

[explicit protected] QAbstractTexture::QAbstractTexture(Qt3DRender::QAbstractTexture::Target target, Qt3DCore::QNode *parent = nullptr)

该构造函数使用指定的target 和parent 创建一个新的QAbstractTexture::QAbstractTexture 实例。

void QAbstractTexture::addTextureImage(Qt3DRender::QAbstractTextureImage *textureImage)

向纹理提供程序添加一个新的 Qt3DCore::QAbstractTextureImagetextureImage 。

注意: 多个Qt3DRender::QAbstractTexture 实例之间绝不应共享同一个Qt3DRender ::QAbstractTextureImage。

Qt3DRender::QAbstractTexture::ComparisonFunction QAbstractTexture::comparisonFunction() const

返回当前的比较函数。

注意: 这是属性 comparisonFunction 的获取 函数。

另请参阅 ` setComparisonFunction()`。

Qt3DRender::QAbstractTexture::ComparisonMode QAbstractTexture::comparisonMode() const

返回当前的比较模式。

注意: 这是属性 comparisonMode 的获取 函数。

另请参阅 ` setComparisonMode()`。

int QAbstractTexture::depth() const

返回纹理的深度

注意: 这是 depth 属性的获取 函数。

另请参阅 setDepth()。

Qt3DRender::QAbstractTexture::TextureFormat QAbstractTexture::format() const

返回纹理提供程序的格式。

注意: 这是属性 format 的获取 函数。

另请参阅 setFormat()。

QVariant QAbstractTexture::handle() const

返回当前纹理句柄;若Qt 3D 使用OpenGL渲染器,则handle为纹理ID整数。

注意: 这是属性 handle 的获取 函数。

Qt3DRender::QAbstractTexture::HandleType QAbstractTexture::handleType() const

返回当前纹理句柄的类型。

注意: 这是 handleType 属性的获取 函数。

int QAbstractTexture::height() const

返回纹理的高度

注意: 这是 height 属性的获取 函数。

另请参阅 setHeight()。

int QAbstractTexture::layers() const

返回纹理提供程序的最大图层数。

注意:此方法 仅对具有 3D 或数组目标格式的纹理提供程序有效。

注意: 这是属性 layers 的获取 函数。

另请参阅 setLayers()。

float QAbstractTexture::maximumAnisotropy() const

返回当前的最大各向异性

注: 这是属性 maximumAnisotropy 的获取 函数。

另请参阅 ` setMaximumAnisotropy()`。

void QAbstractTexture::removeTextureImage(Qt3DRender::QAbstractTextureImage *textureImage)

从纹理提供程序中移除一个 Qt3DCore::QAbstractTextureImagetextureImage 。

int QAbstractTexture::samples() const

返回该纹理提供程序中每个纹理像素的采样数。

注意:此 属性仅对具有多采样格式的纹理提供程序有效。

注意: 这是属性 samples的获取 函数。

另请参阅 setSamples()。

[slot] void QAbstractTexture::setComparisonFunction(Qt3DRender::QAbstractTexture::ComparisonFunction function)

将比较函数设置为function 。

注意: 这是属性 `comparisonFunction`的设置 函数。

另请参阅 comparisonFunction()。

[slot] void QAbstractTexture::setComparisonMode(Qt3DRender::QAbstractTexture::ComparisonMode mode)

将比较模式设置为“mode ”。

注意: 属性comparisonMode 的设置 函数。

另请参阅 comparisonMode()。

[slot] void QAbstractTexture::setDepth(int depth)

将纹理的深度设置为depth 。

注意: 这是属性 `depth`的设置 函数。

另请参阅 depth()。

[slot] void QAbstractTexture::setFormat(Qt3DRender::QAbstractTexture::TextureFormat format)

将纹理格式设置为format 。

注意: 这是属性 `format`的设置 函数。

另请参阅 format()。

[slot] void QAbstractTexture::setGenerateMipMaps(bool gen)

布尔参数 `gen ` 用于设置一个标志,指示纹理提供程序是否应生成米普图。

注意: 属性generateMipMaps 的设置 函数。

另请参阅 generateMipMaps()。

[slot] void QAbstractTexture::setHeight(int height)

将高度设置为height 。

注意: height 属性的设置 函数。

另请参阅 height()。

[slot] void QAbstractTexture::setLayers(int layers)

将最大图层数设置为layers 。

注意: 这是属性layers 的设置 函数。

另请参阅 layers()。

[slot] void QAbstractTexture::setMagnificationFilter(Qt3DRender::QAbstractTexture::Filter f)

将缩放过滤器设置为f 。

注意: 这是属性magnificationFilter 的设置 函数。

另请参阅 magnificationFilter()。

[slot] void QAbstractTexture::setMaximumAnisotropy(float anisotropy)

将最大各向异性设置为anisotropy 。

注意: 这是属性maximumAnisotropy 的设置 函数。

另请参阅 maximumAnisotropy()。

[slot] void QAbstractTexture::setMinificationFilter(Qt3DRender::QAbstractTexture::Filter f)

将压缩过滤器设置为指定值f 。

注意: 这是属性 `minificationFilter`的设置 函数。

另请参阅 minificationFilter()。

[slot] void QAbstractTexture::setSamples(int samples)

将每个纹素的采样数设置为samples 。

注意: 这是属性samples 的设置 函数。

另请参阅 samples()。

void QAbstractTexture::setSize(int w, int h = 1, int d = 1)

将纹理提供程序的大小设置为宽度w 、高度h 和深度d 。

[protected] void QAbstractTexture::setStatus(Qt3DRender::QAbstractTexture::Status status)

将纹理提供程序的状态设置为指定的status 。

另请参阅 status()。

[slot] void QAbstractTexture::setWidth(int width)

将纹理提供程序的宽度设置为width 。

注意: 这是属性width 的设置 函数。

另请参阅 width()。

void QAbstractTexture::setWrapMode(const Qt3DRender::QTextureWrapMode &wrapMode)

将 wrapmode 设置为wrapMode 中指定的值。

另请参阅 wrapMode()。

Qt3DRender::QAbstractTexture::Status QAbstractTexture::status() const

返回纹理提供程序的当前状态。

注意: 这是 status 属性的获取 函数。

另请参阅 setStatus()。

Qt3DRender::QAbstractTexture::Target QAbstractTexture::target() const

返回纹理提供程序的目标格式。

注意: 这是属性 target 的获取器 函数。

QList<Qt3DRender::QAbstractTextureImage *> QAbstractTexture::textureImages() const

返回一个列表,其中包含纹理提供程序中包含的 QAbstractTextureImage 对象的指针。

[invokable] void QAbstractTexture::updateData(const Qt3DRender::QTextureDataUpdate &update)

更新纹理的某个子区域(由 `update` 定义),而无需更改数据生成器,也不依赖于添加或移除纹理图像。

注意: 可通过元对象系统和 QML 调用此 函数。参见Q_INVOKABLE 。

int QAbstractTexture::width() const

返回纹理的宽度

注意: 这是 width 属性的获取 函数。

另请参阅 setWidth()。

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