QAbstractTextureProvider Class

(Qt3D::QAbstractTextureProvider)

A base class to be used to provide textures. More...

Public Types

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

Properties

Public Functions

~QAbstractTextureProvider()
void addTextureImage(QAbstractTextureImage * textureImage)
ComparisonFunction comparisonFunction() const
ComparisonMode comparisonMode() const
int depth() const
TextureFormat format() const
bool generateMipMaps() const
int height() const
bool isUnique() const
Filter magnificationFilter() const
float maximumAnisotropy() const
int maximumLayers() const
Filter minificationFilter() const
void removeTextureImage(QAbstractTextureImage * textureImage)
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 setMagnificationFilter(Filter f)
void setMaximumAnisotropy(float anisotropy)
void setMaximumLayers(int maximumLayers)
void setMinificationFilter(Filter f)
void setSize(int w, int h = 1, int d = 1)
void setUnique(bool unique)
void setWidth(int width)
void setWrapMode(const QTextureWrapMode & wrapMode)
Status status() const
Target target() const
QList<QAbstractTextureImage *> textureImages() const
int width() const
QTextureWrapMode * wrapMode()

Signals

Protected Functions

QAbstractTextureProvider(QNode * parent = 0)
QAbstractTextureProvider(Target target, QNode * parent = 0)
void copy(const QNode * ref)
void setStatus(Status status)

Detailed Description

A base class to be used to provide textures.

Qt3D::QAbstractTextureProvider 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.

Member Type Documentation

enum QAbstractTextureProvider::ComparisonFunction

enum QAbstractTextureProvider::ComparisonMode

enum QAbstractTextureProvider::CubeMapFace

enum QAbstractTextureProvider::Filter

enum QAbstractTextureProvider::Status

enum QAbstractTextureProvider::Target

enum QAbstractTextureProvider::TextureFormat

Property Documentation

comparisonFunction : ComparisonFunction

Holds the comparison function of the texture provider.

Access functions:

ComparisonFunction comparisonFunction() const
void setComparisonFunction(ComparisonFunction function)

Notifier signal:

void comparisonFunctionChanged()

comparisonMode : ComparisonMode

Holds the comparison mode of the texture provider.

Access functions:

ComparisonMode comparisonMode() const
void setComparisonMode(ComparisonMode mode)

Notifier signal:

void comparisonModeChanged()

depth : int

Holds the depth of the texture provider.

Access functions:

int depth() const
void setDepth(int depth)

Notifier signal:

void depthChanged()

format : TextureFormat

Holds the format of the texture provider.

Access functions:

TextureFormat format() const
void setFormat(TextureFormat format)

Notifier signal:

void formatChanged()

generateMipMaps : bool

Holds whether the texture provider should auto generate mipmaps.

Access functions:

bool generateMipMaps() const
void setGenerateMipMaps(bool gen)

Notifier signal:

void generateMipMapsChanged()

height : int

Holds the height of the texture provider.

Access functions:

int height() const
void setHeight(int height)

Notifier signal:

void heightChanged()

magnificationFilter : Filter

Holds the magnification filter of the texture provider.

Access functions:

Filter magnificationFilter() const
void setMagnificationFilter(Filter f)

Notifier signal:

void magnificationFilterChanged()

maximumAnisotropy : float

Holds the maximum anisotropy of the texture provider.

Access functions:

float maximumAnisotropy() const
void setMaximumAnisotropy(float anisotropy)

Notifier signal:

void maximumAnisotropyChanged()

maximumLayers : 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.

Access functions:

int maximumLayers() const
void setMaximumLayers(int maximumLayers)

Notifier signal:

void maximumLayersChanged()

minificationFilter : Filter

Holds the minification filter of the texture provider.

Access functions:

Filter minificationFilter() const
void setMinificationFilter(Filter f)

Notifier signal:

void minificationFilterChanged()

status : const Status

Holds the current status of the texture provider.

Access functions:

Status status() const

Notifier signal:

void statusChanged()

target : const Target

Holds the target format of the texture provider.

Note: The target format can only be set once.

Access functions:

Target target() const

unique : bool

Sets whether this texture provider should be unique by reading unique. By default this is false.

By default the renderer based on the attributes of texture providers is able to compare them and detect duplicates (same size, format and image sources) and smartly avoid unnecessary computations. In some cases however (texture providers used as Qt3D::RenderTarget attachments) you don't want the renderer to perform these comparison, in which case you can set is unique to true.

Access functions:

bool isUnique() const
void setUnique(bool unique)

Notifier signal:

void uniqueChanged()

width : int

Holds the width of the texture provider.

Access functions:

int width() const
void setWidth(int width)

Notifier signal:

void widthChanged()

wrapMode : Qt3D::QTextureWrapMode * const

Holds the wrap mode of the texture provider.

Access functions:

QTextureWrapMode * wrapMode()

Member Function Documentation

[protected] QAbstractTextureProvider::QAbstractTextureProvider(QNode * parent = 0)

[protected] QAbstractTextureProvider::QAbstractTextureProvider(Target target, QNode * parent = 0)

QAbstractTextureProvider::~QAbstractTextureProvider()

void QAbstractTextureProvider::addTextureImage(QAbstractTextureImage * textureImage)

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

Note: Qt3D::QAbstractTextureImage should never be shared between multiple Qt3D::QAbstractTextureProvider instances.

[protected] void QAbstractTextureProvider::copy(const QNode * ref)

TextureFormat QAbstractTextureProvider::format() const

Return the texture provider's format.

Note: Getter function for property format.

See also setFormat().

bool QAbstractTextureProvider::isUnique() const

Returns whether the texture should be shared with other textures in the renderer or not. Defaults to false as this allow in most cases the renderer to be faster.

Note: Getter function for property unique.

int QAbstractTextureProvider::maximumLayers() 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 maximumLayers.

See also setMaximumLayers().

void QAbstractTextureProvider::removeTextureImage(QAbstractTextureImage * textureImage)

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

void QAbstractTextureProvider::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 QAbstractTextureProvider::setStatus(Status status)

See also status().

void QAbstractTextureProvider::setWrapMode(const QTextureWrapMode & wrapMode)

See also wrapMode().

QList<QAbstractTextureImage *> QAbstractTextureProvider::textureImages() const

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

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