Encapsulates the necessary information to create an OpenGL texture image from an image source. 更多...
头: | #include <QTextureImage> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS 3drender)
target_link_libraries(mytarget PRIVATE Qt6::3drender) |
qmake: | QT += 3drender |
实例化: | TextureImage |
继承: | Qt3DRender::QAbstractTextureImage |
enum | Status { None, Loading, Ready, Error } |
QTextureImage (Qt3DCore::QNode * parent = nullptr) | |
bool | isMirrored () const |
QUrl | source () const |
Qt3DRender::QTextureImage::Status | status () const |
void | setMirrored (bool mirrored ) |
void | setSource (const QUrl & source ) |
void | mirroredChanged (bool mirrored ) |
void | sourceChanged (const QUrl & source ) |
void | statusChanged (Qt3DRender::QTextureImage::Status status ) |
void | setStatus (Qt3DRender::QTextureImage::Status status ) |
It contains the necessary information mipmap level, layer, cube face and source URL to load at the proper place data into an OpenGL texture.
This enumeration specifies the status values for texture image loading.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QTextureImage::None
|
0
|
The texture image loading has not been started yet. |
Qt3DRender::QTextureImage::Loading
|
1
|
The texture image loading has started, but not finised. |
Qt3DRender::QTextureImage::Ready
|
2
|
The texture image loading has finished. |
Qt3DRender::QTextureImage::Error
|
3
|
The texture image loading confronted an error. |
This property specifies whether the image should be mirrored when loaded. This is a convenience to avoid having to manipulate images to match the origin of the texture coordinates used by the rendering API. By default this property is set to true. This has no effect when using GPU compressed texture formats.
警告: This property results in a performance price payed at runtime when loading uncompressed or CPU compressed image formats such as PNG. To avoid this performance price it is better to set this property to false and load texture assets that have been pre-mirrored.
注意: OpenGL specifies the origin of texture coordinates from the lower left hand corner whereas DirectX uses the the upper left hand corner.
注意: When using cube map texture you'll probably want mirroring disabled as the cube map sampler takes a direction rather than regular texture coordinates.
访问函数:
bool | isMirrored () const |
void | setMirrored (bool mirrored ) |
通知程序信号:
void | mirroredChanged (bool mirrored ) |
This property holds the source url from which data for the texture image will be loaded.
访问函数:
QUrl | source () const |
void | setSource (const QUrl & source ) |
通知程序信号:
void | sourceChanged (const QUrl & source ) |
[read-only]
status
: const
Status
This property holds the status of the texture image loading.
访问函数:
Qt3DRender::QTextureImage::Status | status () const |
通知程序信号:
void | statusChanged (Qt3DRender::QTextureImage::Status status ) |
[explicit]
QTextureImage::
QTextureImage
(
Qt3DCore::QNode
*
parent
= nullptr)
构造新的 Qt3DRender::QTextureImage 实例与 parent 作为父级。
Returns whether mirroring is enabled or not.
注意: getter 函数对于特性 mirrored .
[slot]
void
QTextureImage::
setMirrored
(
bool
mirrored
)
Sets mirroring to mirrored .
注意: This internally triggers a call to update the data generator.
注意: setter 函数对于特性 mirrored .
另请参阅 isMirrored ().
[slot]
void
QTextureImage::
setSource
(const
QUrl
&
source
)
Sets the source url of the texture image to source .
注意: This internally triggers a call to update the data generator.
注意: setter 函数对于特性 source .
另请参阅 source ().
[protected]
void
QTextureImage::
setStatus
(
Qt3DRender::QTextureImage::Status
status
)
Sets the status to status . status
另请参阅 status ().
Returns the source url from which data for the texture image will be loaded.
注意: getter 函数对于特性 source。
另请参阅 setSource ().
Returns the current status.
注意: getter 函数对于特性 status。
另请参阅 setStatus ().