QAbstractTexture Class

(Qt3DRender::QAbstractTexture)

A base class to be used to provide textures. 更多...

公有类型

enum ComparisonFunction { CompareLessEqual, CompareGreaterEqual, CompareLess, CompareGreater, ..., CompareNever }
enum ComparisonMode { CompareRefToTexture, CompareNone }
enum CubeMapFace { CubeMapPositiveX, CubeMapNegativeX, CubeMapPositiveY, CubeMapNegativeY, ..., AllFaces }
enum Filter { Nearest, Linear, NearestMipMapNearest, NearestMipMapLinear, LinearMipMapNearest, LinearMipMapLinear }
enum Status { None, Loading, Ready, Error }
enum Target { TargetAutomatic, Target1D, Target1DArray, Target2D, ..., TargetBuffer }
enum TextureFormat { NoFormat, Automatic, R8_UNorm, RG8_UNorm, ..., LuminanceAlphaFormat }

属性

公有函数

void addTextureImage(QAbstractTextureImage *textureImage)
ComparisonFunction comparisonFunction() const
ComparisonMode comparisonMode() const
QTextureGeneratorPtr dataGenerator() const
int depth() const
TextureFormat format() const
bool generateMipMaps() const
int height() const
int layers() const
Filter magnificationFilter() const
float maximumAnisotropy() const
Filter minificationFilter() const
void removeTextureImage(QAbstractTextureImage *textureImage)
int samples() const
void setSize(int w, int h = 1, int d = 1)
void setWrapMode(const QTextureWrapMode &wrapMode)
Status status() const
Target target() const
QVector<QAbstractTextureImage *> textureImages() const
int width() const
QTextureWrapMode *wrapMode()

公有槽函数

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

信号

void comparisonFunctionChanged(ComparisonFunction comparisonFunction)
void comparisonModeChanged(ComparisonMode comparisonMode)
void depthChanged(int depth)
void formatChanged(TextureFormat format)
void generateMipMapsChanged(bool generateMipMaps)
void heightChanged(int height)
void layersChanged(int layers)
void magnificationFilterChanged(Filter magnificationFilter)
void maximumAnisotropyChanged(float maximumAnisotropy)
void minificationFilterChanged(Filter minificationFilter)
void samplesChanged(int samples)
void statusChanged(Status status)
void widthChanged(int width)

受保护的函数

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

其他继承的成员

  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

A base class to be used to provide textures.

The QAbstractTexture class shouldn't be used directly but rather through one of its subclasses. Each subclass implements a given texture target (2D, 2DArray, 3D, CubeMap ...) Each subclass provides a set of functors for each layer, cube map face and mipmap level. In turn the backend uses those functor to properly fill a corresponding OpenGL texture with data.

成员类型

enum QAbstractTexture::ComparisonFunction

enum QAbstractTexture::ComparisonMode

enum QAbstractTexture::CubeMapFace

This enum identifies the faces of a cube map texture

ConstantValueDescription
Qt3DRender::QAbstractTexture::CubeMapPositiveX0x8515Specify the positive X face of a cube map
Qt3DRender::QAbstractTexture::CubeMapNegativeX0x8516Specify the negative X face of a cube map
Qt3DRender::QAbstractTexture::CubeMapPositiveY0x8517Specify the positive Y face of a cube map
Qt3DRender::QAbstractTexture::CubeMapNegativeY0x8518Specify the negative Y face of a cube map
Qt3DRender::QAbstractTexture::CubeMapPositiveZ0x8519Specify the positive Z face of a cube map
Qt3DRender::QAbstractTexture::CubeMapNegativeZ0x851ASpecify the negative Z face of a cube map
Qt3DRender::QAbstractTexture::AllFaces?Specify all the faces of a cube map

Note: AllFaces should only be used when a behavior needs to be applied to all the faces of a cubemap. This is the case for example when using a cube map as a texture attachment. Using AllFaces in the attachment specfication would result in all faces being bound to the attachment point. On the other hand, if a specific face is specified, the attachment would only be using the specified face.

enum QAbstractTexture::Filter

enum QAbstractTexture::Status

enum QAbstractTexture::Target

enum QAbstractTexture::TextureFormat

属性

comparisonFunction : ComparisonFunction

Holds the comparison function of the texture provider.

访问函数:

ComparisonFunction comparisonFunction() const
void setComparisonFunction(ComparisonFunction function)

Notifier signal:

void comparisonFunctionChanged(ComparisonFunction comparisonFunction)

comparisonMode : ComparisonMode

Holds the comparison mode of the texture provider.

访问函数:

ComparisonMode comparisonMode() const
void setComparisonMode(ComparisonMode mode)

Notifier signal:

void comparisonModeChanged(ComparisonMode comparisonMode)

depth : int

Holds the depth of the texture provider.

访问函数:

int depth() const
void setDepth(int depth)

Notifier signal:

void depthChanged(int depth)

format : TextureFormat

Holds the format of the texture provider.

访问函数:

TextureFormat format() const
void setFormat(TextureFormat format)

Notifier signal:

void formatChanged(TextureFormat format)

generateMipMaps : bool

Holds whether the texture provider should auto generate mipmaps.

访问函数:

bool generateMipMaps() const
void setGenerateMipMaps(bool gen)

Notifier signal:

void generateMipMapsChanged(bool generateMipMaps)

height : int

Holds the height of the texture provider.

访问函数:

int height() const
void setHeight(int height)

Notifier signal:

void heightChanged(int height)

layers : int

Holds the maximum layer count of the texture provider. By default, the maximum layer count is 1.

Note: this has a meaning only for texture providers that have 3D or array target formats.

访问函数:

int layers() const
void setLayers(int layers)

Notifier signal:

void layersChanged(int layers)

magnificationFilter : Filter

Holds the magnification filter of the texture provider.

访问函数:

Filter magnificationFilter() const
void setMagnificationFilter(Filter f)

Notifier signal:

void magnificationFilterChanged(Filter magnificationFilter)

maximumAnisotropy : float

Holds the maximum anisotropy of the texture provider.

访问函数:

float maximumAnisotropy() const
void setMaximumAnisotropy(float anisotropy)

Notifier signal:

void maximumAnisotropyChanged(float maximumAnisotropy)

minificationFilter : Filter

Holds the minification filter of the texture provider.

访问函数:

Filter minificationFilter() const
void setMinificationFilter(Filter f)

Notifier signal:

void minificationFilterChanged(Filter minificationFilter)

samples : int

Holds the number of samples per texel for the texture provider. By default, the number of samples is 1.

Note: this has a meaning only for texture providers that have multisample formats.

访问函数:

int samples() const
void setSamples(int samples)

Notifier signal:

void samplesChanged(int samples)

status : const Status

Holds the current status of the texture provider.

访问函数:

Status status() const

Notifier signal:

void statusChanged(Status status)

target : const Target

Holds the target format of the texture provider.

Note: The target format can only be set once.

访问函数:

Target target() const

width : int

Holds the width of the texture provider.

访问函数:

int width() const
void setWidth(int width)

Notifier signal:

void widthChanged(int width)

wrapMode : Qt3DRender::QTextureWrapMode * const

Holds the wrap mode of the texture provider.

访问函数:

QTextureWrapMode *wrapMode()

成员函数

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

Default constructs an instance of QAbstractTexture.

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

Default constructs an instance of QAbstractTexture.

[protected] QAbstractTexture::QAbstractTexture(QAbstractTexturePrivate &dd, Qt3DCore::QNode *parent = nullptr)

Copy constructor.

void QAbstractTexture::addTextureImage(QAbstractTextureImage *textureImage)

Adds a new Qt3DCore::QAbstractTextureImage textureImage to the texture provider.

Note: Qt3DRender::QAbstractTextureImage should never be shared between multiple Qt3DRender::QAbstractTexture instances.

ComparisonFunction QAbstractTexture::comparisonFunction() const

Returns the current comparison function.

Note: Getter function for property comparisonFunction.

参见 setComparisonFunction().

ComparisonMode QAbstractTexture::comparisonMode() const

Returns the current comparison mode.

Note: Getter function for property comparisonMode.

参见 setComparisonMode().

QTextureGeneratorPtr QAbstractTexture::dataGenerator() const

Returns the current data generator.

int QAbstractTexture::depth() const

Returns the depth of the texture

Note: Getter function for property depth.

参见 setDepth().

TextureFormat QAbstractTexture::format() const

Returns the texture provider's format.

Note: Getter function for property format.

参见 setFormat().

int QAbstractTexture::height() const

Returns the height of the texture

Note: Getter function for property height.

参见 setHeight().

int QAbstractTexture::layers() const

Returns the maximum number of layers for the texture provider.

Note: this has a meaning only for texture providers that have 3D or array target formats.

Note: Getter function for property layers.

参见 setLayers().

float QAbstractTexture::maximumAnisotropy() const

Returns the current maximum anisotropy

Note: Getter function for property maximumAnisotropy.

参见 setMaximumAnisotropy().

void QAbstractTexture::removeTextureImage(QAbstractTextureImage *textureImage)

Removes a Qt3DCore::QAbstractTextureImage textureImage from the texture provider.

int QAbstractTexture::samples() const

Returns the number of samples per texel for the texture provider.

Note: this has a meaning only for texture providers that have multisample formats.

Note: Getter function for property samples.

参见 setSamples().

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

Sets the size of the texture provider to width w, height h and depth d.

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

参见 status().

void QAbstractTexture::setWrapMode(const QTextureWrapMode &wrapMode)

参见 wrapMode().

Status QAbstractTexture::status() const

Returns the current status

Note: Getter function for property status.

参见 setStatus().

QVector<QAbstractTextureImage *> QAbstractTexture::textureImages() const

Returns a list of pointers to QAbstractTextureImage objects contained in the texture provider.

int QAbstractTexture::width() const

Returns the width of the texture

Note: Getter function for property width.

参见 setWidth().