![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qrhi.h>
Public Member Functions | |
QRhiTextureSubresourceUploadDescription ()=default | |
Constructs an empty subresource description. | |
QRhiTextureSubresourceUploadDescription (const QImage &image) | |
Constructs a mip level description with a image. | |
QRhiTextureSubresourceUploadDescription (const void *data, quint32 size) | |
Constructs a mip level description with the image data is specified by data and size. | |
QRhiTextureSubresourceUploadDescription (const QByteArray &data) | |
Constructs a mip level description with the image data specified by data. | |
QImage | image () const |
void | setImage (const QImage &image) |
Sets image. | |
QByteArray | data () const |
void | setData (const QByteArray &data) |
Sets data. | |
quint32 | dataStride () const |
void | setDataStride (quint32 stride) |
Sets the data stride in bytes. | |
QPoint | destinationTopLeft () const |
void | setDestinationTopLeft (const QPoint &p) |
Sets the destination top-left position p. | |
QSize | sourceSize () const |
void | setSourceSize (const QSize &size) |
Sets the source size in pixels. | |
QPoint | sourceTopLeft () const |
void | setSourceTopLeft (const QPoint &p) |
Sets the source top-left position p. | |
\inmodule QtGui
Describes the source for one mip level in a layer in a texture upload operation.
The source content is specified either as a QImage or as a raw blob. The former is only allowed for uncompressed textures with a format that can be mapped to QImage, while the latter is supported for all formats, including floating point and compressed.
destinationTopLeft() specifies the top-left corner of the target rectangle. Defaults to (0, 0).
An empty sourceSize() (the default) indicates that size is assumed to be the size of the subresource. With QImage-based uploads this implies that the size of the source image() must match the subresource. When providing raw data instead, sufficient number of bytes must be provided in data().
sourceTopLeft() is supported only for QImage-based uploads, and specifies the top-left corner of the source rectangle.
When providing raw data, and the stride is not specified via setDataStride(), the stride (row pitch, row length in bytes) of the provided data must be equal to {width * pixelSize} where
pixelSize
is the number of bytes used for one pixel, and there must be no additional padding between rows. There is no row start alignment requirement.
When there is unused data at the end of each row in the input raw data, call setDataStride() with the total number of bytes per row. The stride must always be a multiple of the number of bytes for one pixel. The row stride is only applicable to image data for textures with an uncompressed format.
|
default |
Constructs an empty subresource description.
|
explicit |
Constructs a mip level description with a image.
The \l{QImage::size()}{size} of image must match the size of the mip level. For level 0 that is the \l{QRhiTexture::pixelSize()}{texture size}.
The bit depth of image must be compatible with the \l{QRhiTexture::Format}{texture format}.
To describe a partial upload, call setSourceSize(), setSourceTopLeft(), or setDestinationTopLeft() afterwards.
|
explicit |
|
inline |
Definition at line 654 of file qrhi.h.
References m_data.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QRhiVulkan::prepareUploadSubres(), QRhiMetal::subresUploadByteSize(), and QRhiVulkan::subresUploadByteSize().
|
inline |
Definition at line 657 of file qrhi.h.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), and QRhiVulkan::prepareUploadSubres().
|
inline |
Definition at line 660 of file qrhi.h.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), and QRhiVulkan::prepareUploadSubres().
|
inline |
Definition at line 651 of file qrhi.h.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), QRhiVulkan::prepareUploadSubres(), QRhiMetal::subresUploadByteSize(), and QRhiVulkan::subresUploadByteSize().
|
inline |
Sets data.
Definition at line 655 of file qrhi.h.
References m_data.
Referenced by QSSGParticleRenderer::prepareParticlesForModel(), QSSGParticleRenderer::rhiPrepareRenderable(), and QVideoTextureHelper::updateTextureWithMap().
Sets the data stride in bytes.
By default this is 0 and not always relevant. When providing raw data(), and the stride is not specified via setDataStride(), the stride (row pitch, row length in bytes) of the provided data must be equal to {width * pixelSize} where
pixelSize
is the number of bytes used for one pixel, and there must be no additional padding between rows. Otherwise, if there is additional space between the lines, set a non-zero stride. All this is applicable only when raw image data is provided, and is not necessary when working QImage since that has its own \l{QImage::bytesPerLine()}{stride} value.
Definition at line 658 of file qrhi.h.
Referenced by QVideoTextureHelper::updateTextureWithMap().
Sets the destination top-left position p.
Definition at line 661 of file qrhi.h.
Referenced by QSGCompressedAtlasTexture::Atlas::enqueueTextureUpload(), QSGRhiAtlasTexture::Atlas::enqueueTextureUpload(), QSGRhiTextureGlyphCache::fillTexture(), and QSGRhiDistanceFieldGlyphCache::storeGlyphs().
Sets image.
Definition at line 652 of file qrhi.h.
Referenced by QSGRhiTextureGlyphCache::fillTexture().
Sets the source size in pixels.
Definition at line 664 of file qrhi.h.
Referenced by QSGCompressedAtlasTexture::Atlas::enqueueTextureUpload(), QSGRhiAtlasTexture::Atlas::enqueueTextureUpload(), QSGRhiTextureGlyphCache::fillTexture(), QSGRhiTextureGlyphCache::resizeTextureData(), and QSGRhiDistanceFieldGlyphCache::storeGlyphs().
Sets the source top-left position p.
Definition at line 667 of file qrhi.h.
Referenced by QSGRhiTextureGlyphCache::fillTexture().
|
inline |
Definition at line 663 of file qrhi.h.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), and QRhiVulkan::prepareUploadSubres().
|
inline |
Definition at line 666 of file qrhi.h.
Referenced by QRhiD3D11::enqueueSubresUpload(), QRhiGles2::enqueueSubresUpload(), QRhiMetal::enqueueSubresUpload(), and QRhiVulkan::prepareUploadSubres().