QRhiTextureCopyDescription Class

Describes a texture-to-texture copy operation. 更多...

头: #include <QRhiTextureCopyDescription>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Since: Qt 6.6

公共函数

QRhiTextureCopyDescription ()
int destinationLayer () const
int destinationLevel () const
QPoint destinationTopLeft () const
QSize pixelSize () const
void setDestinationLayer (int layer )
void setDestinationLevel (int level )
void setDestinationTopLeft (const QPoint & p )
void setPixelSize (const QSize & sz )
void setSourceLayer (int layer )
void setSourceLevel (int level )
void setSourceTopLeft (const QPoint & p )
int sourceLayer () const
int sourceLevel () const
QPoint sourceTopLeft () const

详细描述

pixelSize () indicates that the entire subresource is to be copied. A default constructed copy description therefore leads to copying the entire subresource at level 0 of layer 0.

注意: The source texture must be created with QRhiTexture::UsedAsTransferSource .

注意: The source and destination rectangles defined by pixelSize (), sourceTopLeft (),和 destinationTopLeft () must fit the source and destination textures, respectively. The behavior is undefined otherwise.

With cubemaps, 3D textures, and texture arrays one face or slice can be copied at a time. The face or slice is specified by the source and destination layer indices. With mipmapped textures one mip level can be copied at a time. The source and destination layer and mip level indices can differ, but the size and position must be carefully controlled to avoid out of bounds copies, in which case the behavior is undefined.

注意: This is a RHI API with limited compatibility guarantees, see QRhi 了解细节。

成员函数文档编制

[constexpr noexcept] QRhiTextureCopyDescription:: QRhiTextureCopyDescription ()

Constructs an empty texture copy description.

int QRhiTextureCopyDescription:: destinationLayer () const

Returns the destination array layer (cubemap face or array layer index). Default to 0.

另请参阅 setDestinationLayer ().

int QRhiTextureCopyDescription:: destinationLevel () const

Returns the destionation mip level. Defaults to 0.

另请参阅 setDestinationLevel ().

QPoint QRhiTextureCopyDescription:: destinationTopLeft () const

Returns the destionation top-left position in pixels. Defaults to (0, 0).

另请参阅 setDestinationTopLeft ().

QSize QRhiTextureCopyDescription:: pixelSize () const

Returns the size of the region to copy.

注意: An empty pixelSize() indicates that the entire subresource is to be copied. A default constructed copy description therefore leads to copying the entire subresource at level 0 of layer 0.

另请参阅 setPixelSize ().

void QRhiTextureCopyDescription:: setDestinationLayer ( int layer )

Sets the destination array layer .

另请参阅 destinationLayer ().

void QRhiTextureCopyDescription:: setDestinationLevel ( int level )

Sets the destination mip level .

另请参阅 destinationLevel ().

void QRhiTextureCopyDescription:: setDestinationTopLeft (const QPoint & p )

Sets the destination top-left position p .

另请参阅 destinationTopLeft ().

void QRhiTextureCopyDescription:: setPixelSize (const QSize & sz )

Sets the size of the region to copy to sz .

另请参阅 pixelSize ().

void QRhiTextureCopyDescription:: setSourceLayer ( int layer )

Sets the source array layer .

另请参阅 sourceLayer ().

void QRhiTextureCopyDescription:: setSourceLevel ( int level )

Sets the source mip level .

另请参阅 sourceLevel ().

void QRhiTextureCopyDescription:: setSourceTopLeft (const QPoint & p )

Sets the source top-left position to p .

另请参阅 sourceTopLeft ().

int QRhiTextureCopyDescription:: sourceLayer () const

Returns the source array layer (cubemap face or array layer index). Defaults to 0.

另请参阅 setSourceLayer ().

int QRhiTextureCopyDescription:: sourceLevel () const

Returns the source mip level. Defaults to 0.

另请参阅 setSourceLevel ().

QPoint QRhiTextureCopyDescription:: sourceTopLeft () const

Returns the source top-left position (in pixels). Defaults to (0, 0).

另请参阅 setSourceTopLeft ().