Qt3DRender::QAbstractTexture Class

class Qt3DRender::QAbstractTexture

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

公共类型

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 层提供一组函数。反过来,后端使用这些函数将数据正确填充到相应的 OpenGL 纹理中。为了不减慢纹理生成和上传的速度,我们希望函数能尽可能少地进行处理。如果纹理的内容是缓慢的程序生成过程的结果,建议不要直接在函数中实现。

所有纹理都是唯一的。如果两次实例化相同的纹理,将在 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::TargetBuffer0x8C2A纹理缓冲区

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_RGB16_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_signed_float_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_ALPHA_Alpha_bptc_unorm_arb
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

设置纹理提供程序是否自动生成 mipmaps。

访问功能:

bool generateMipMaps() const
void setGenerateMipMaps(bool gen)

通知信号:

void generateMipMapsChanged(bool generateMipMaps)

[read-only] handle : const QVariant

保存当前纹理句柄,如果Qt 3D 使用的是 OpenGL 渲染器,句柄就是纹理 ID 整数。

访问功能:

QVariant handle() const

通知信号:

void handleChanged(QVariant handle)

[read-only] handleType : const 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 : const 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)

构造函数用指定的targetparent 创建一个新的QAbstractTexture::QAbstractTexture 实例。

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

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

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

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

返回当前比较函数。

注: 属性 comparisonFunction 的获取函数。

另请参阅 setComparisonFunction().

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

返回当前的比较模式。

注: 属性 comparisonMode 的获取函数。

另请参阅 setComparisonMode().

int QAbstractTexture::depth() const

返回纹理的深度

注: 属性深度的获取函数。

另请参阅 setDepth()。

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

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

注: 属性格式的获取函数。

另请参阅 setFormat()。

QVariant QAbstractTexture::handle() const

返回当前纹理句柄,如果Qt 3D 使用的是 OpenGL 渲染器,句柄就是纹理 ID 整数。

注: 属性句柄的获取函数。

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

返回当前纹理句柄类型。

注: 属性 handleType 的获取函数。

int QAbstractTexture::height() const

返回纹理的高度

注: 高度属性的获取函数。

另请参阅 setHeight()。

int QAbstractTexture::layers() const

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

注意: 这只对具有三维或数组目标格式的纹理提供程序有意义。

注: 属性层的获取函数。

另请参阅 setLayers()。

float QAbstractTexture::maximumAnisotropy() const

返回当前的最大各向异性

注: 属性 maximumAnisotropy 的获取函数。

另请参阅 setMaximumAnisotropy().

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

从纹理提供程序中删除 Qt3DCore::QAbstractTextureImagetextureImage

int QAbstractTexture::samples() const

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

注意: 这只对具有多采样格式的纹理提供程序有意义。

注: 属性样本的获取函数。

另请参阅 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 设置一个标志,指示纹理提供程序是否应生成 mipmaps。

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

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

注: 属性状态的获取函数。

另请参阅 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

返回纹理的宽度

注: 宽度属性的获取函数。

另请参阅 setWidth().

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