PythonQt.QtGui.QOpenGLTexture
QOpenGLTexture
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
QOpenGLTexture makes it easy to work with OpenGL textures and the myriad features and targets that they offer depending upon the capabilities of your OpenGL implementation.
The typical usage pattern for QOpenGLTexture is
- Instantiate the object specifying the texture target type
- Set properties that affect the storage requirements e.g. storage format, dimensions
- Allocate the server-side storage
- Optionally upload pixel data
- Optionally set any additional properties e.g. filtering and border options
- Render with texture or render to texture
In the common case of simply using a QImage as the source of texture pixel data most of the above steps are performed automatically.
// Prepare texture
QOpenGLTexture *texture = new QOpenGLTexture(QImage(fileName).mirrored());
texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
texture->setMagnificationFilter(QOpenGLTexture::Linear);
...
// Render with texture
texture->bind();
glDrawArrays(...);
Note that the QImage is mirrored vertically to account for the fact that OpenGL and QImage use opposite directions for the y axis. Another option would be to transform your texture coordinates.
Source: https://doc.qt.io/archives/qt-5.15/qopengltexture.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
Alpha |
attribute | Any |
|
AlphaFormat |
attribute | Any |
|
AlphaValue |
attribute | Any |
|
AnisotropicFiltering |
attribute | Any |
|
BGR |
attribute | Any |
|
BGRA |
attribute | Any |
|
BGRA_Integer |
attribute | Any |
|
BGR_Integer |
attribute | Any |
|
BindingTarget |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
BindingTarget1D |
attribute | Any |
|
BindingTarget1DArray |
attribute | Any |
|
BindingTarget2D |
attribute | Any |
|
BindingTarget2DArray |
attribute | Any |
|
BindingTarget2DMultisample |
attribute | Any |
|
BindingTarget2DMultisampleArray |
attribute | Any |
|
BindingTarget3D |
attribute | Any |
|
BindingTargetBuffer |
attribute | Any |
|
BindingTargetCubeMap |
attribute | Any |
|
BindingTargetCubeMapArray |
attribute | Any |
|
BindingTargetRectangle |
attribute | Any |
|
BlueValue |
attribute | Any |
|
ClampToBorder |
attribute | Any |
|
ClampToEdge |
attribute | Any |
|
CommpareNotEqual |
attribute | Any |
|
CompareAlways |
attribute | Any |
|
CompareEqual |
attribute | Any |
|
CompareGreater |
attribute | Any |
|
CompareGreaterEqual |
attribute | Any |
|
CompareLess |
attribute | Any |
|
CompareLessEqual |
attribute | Any |
|
CompareNever |
attribute | Any |
|
CompareNone |
attribute | Any |
|
CompareRefToTexture |
attribute | Any |
|
ComparisonFunction |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
ComparisonMode |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
CoordinateDirection |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
CubeMapFace |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
CubeMapNegativeX |
attribute | Any |
|
CubeMapNegativeY |
attribute | Any |
|
CubeMapNegativeZ |
attribute | Any |
|
CubeMapPositiveX |
attribute | Any |
|
CubeMapPositiveY |
attribute | Any |
|
CubeMapPositiveZ |
attribute | Any |
|
D16 |
attribute | Any |
|
D24 |
attribute | Any |
|
D24S8 |
attribute | Any |
|
D32 |
attribute | Any |
|
D32F |
attribute | Any |
|
D32FS8X24 |
attribute | Any |
|
Depth |
attribute | Any |
(shared captured text) |
DepthFormat |
attribute | Any |
|
DepthMode |
attribute | Any |
|
DepthStencil |
attribute | Any |
|
DepthStencilMode |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
DirectionR |
attribute | Any |
|
DirectionS |
attribute | Any |
|
DirectionT |
attribute | Any |
|
DontGenerateMipMaps |
attribute | Any |
|
DontResetTextureUnit |
attribute | Any |
|
Feature |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
Features |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
Filter |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. (shared captured text) |
Float16 |
attribute | Any |
|
Float16OES |
attribute | Any |
|
Float32 |
attribute | Any |
|
Float32_D32_UInt32_S8_X24 |
attribute | Any |
|
FormatClass_128Bit |
attribute | Any |
|
FormatClass_16Bit |
attribute | Any |
|
FormatClass_24Bit |
attribute | Any |
|
FormatClass_32Bit |
attribute | Any |
|
FormatClass_48Bit |
attribute | Any |
|
FormatClass_64Bit |
attribute | Any |
|
FormatClass_8Bit |
attribute | Any |
|
FormatClass_96Bit |
attribute | Any |
|
FormatClass_BPTC_Float |
attribute | Any |
|
FormatClass_BPTC_Unorm |
attribute | Any |
|
FormatClass_RGTC1_R |
attribute | Any |
|
FormatClass_RGTC2_RG |
attribute | Any |
|
FormatClass_S3TC_DXT1_RGB |
attribute | Any |
|
FormatClass_S3TC_DXT1_RGBA |
attribute | Any |
|
FormatClass_S3TC_DXT3_RGBA |
attribute | Any |
|
FormatClass_S3TC_DXT5_RGBA |
attribute | Any |
|
FormatClass_Unique |
attribute | Any |
|
GenerateMipMaps |
attribute | Any |
|
GreenValue |
attribute | Any |
|
ImmutableMultisampleStorage |
attribute | Any |
|
ImmutableStorage |
attribute | Any |
|
Int16 |
attribute | Any |
|
Int32 |
attribute | Any |
|
Int8 |
attribute | Any |
|
Linear |
attribute | Any |
(shared captured text) |
LinearMipMapLinear |
attribute | Any |
|
LinearMipMapNearest |
attribute | Any |
|
Luminance |
attribute | Any |
|
LuminanceAlpha |
attribute | Any |
|
LuminanceAlphaFormat |
attribute | Any |
|
LuminanceFormat |
attribute | Any |
|
MaxFeatureFlag |
attribute | Any |
|
MipMapGeneration |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
MirroredRepeat |
attribute | Any |
|
NPOTTextureRepeat |
attribute | Any |
|
NPOTTextures |
attribute | Any |
|
Nearest |
attribute | Any |
|
NearestMipMapLinear |
attribute | Any |
|
NearestMipMapNearest |
attribute | Any |
|
NoFormat |
attribute | Any |
|
NoFormatClass |
attribute | Any |
|
NoPixelType |
attribute | Any |
|
NoSourceFormat |
attribute | Any |
|
OneValue |
attribute | Any |
|
PixelFormat |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
PixelType |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
R11_EAC_SNorm |
attribute | Any |
|
R11_EAC_UNorm |
attribute | Any |
|
R16F |
attribute | Any |
|
R16I |
attribute | Any |
|
R16U |
attribute | Any |
|
R16_SNorm |
attribute | Any |
|
R16_UNorm |
attribute | Any |
|
R32F |
attribute | Any |
|
R32I |
attribute | Any |
|
R32U |
attribute | Any |
|
R5G6B5 |
attribute | Any |
|
R8I |
attribute | Any |
|
R8U |
attribute | Any |
|
R8_SNorm |
attribute | Any |
|
R8_UNorm |
attribute | Any |
|
RG |
attribute | Any |
|
RG11B10F |
attribute | Any |
|
RG11_EAC_SNorm |
attribute | Any |
|
RG11_EAC_UNorm |
attribute | Any |
|
RG16F |
attribute | Any |
|
RG16I |
attribute | Any |
|
RG16U |
attribute | Any |
|
RG16_SNorm |
attribute | Any |
|
RG16_UNorm |
attribute | Any |
|
RG32F |
attribute | Any |
|
RG32I |
attribute | Any |
|
RG32U |
attribute | Any |
|
RG3B2 |
attribute | Any |
|
RG8I |
attribute | Any |
|
RG8U |
attribute | Any |
|
RG8_SNorm |
attribute | Any |
|
RG8_UNorm |
attribute | Any |
|
RGB |
attribute | Any |
|
RGB10A2 |
attribute | Any |
|
RGB16F |
attribute | Any |
|
RGB16I |
attribute | Any |
|
RGB16U |
attribute | Any |
|
RGB16_SNorm |
attribute | Any |
|
RGB16_UNorm |
attribute | Any |
|
RGB32F |
attribute | Any |
|
RGB32I |
attribute | Any |
|
RGB32U |
attribute | Any |
|
RGB5A1 |
attribute | Any |
|
RGB8I |
attribute | Any |
|
RGB8U |
attribute | Any |
|
RGB8_ETC1 |
attribute | Any |
|
RGB8_ETC2 |
attribute | Any |
|
RGB8_PunchThrough_Alpha1_ETC2 |
attribute | Any |
|
RGB8_SNorm |
attribute | Any |
|
RGB8_UNorm |
attribute | Any |
|
RGB9E5 |
attribute | Any |
|
RGBA |
attribute | Any |
|
RGBA16F |
attribute | Any |
|
RGBA16I |
attribute | Any |
|
RGBA16U |
attribute | Any |
|
RGBA16_SNorm |
attribute | Any |
|
RGBA16_UNorm |
attribute | Any |
|
RGBA32F |
attribute | Any |
|
RGBA32I |
attribute | Any |
|
RGBA32U |
attribute | Any |
|
RGBA4 |
attribute | Any |
|
RGBA8I |
attribute | Any |
|
RGBA8U |
attribute | Any |
|
RGBA8_ETC2_EAC |
attribute | Any |
|
RGBA8_SNorm |
attribute | Any |
|
RGBA8_UNorm |
attribute | Any |
|
RGBAFormat |
attribute | Any |
|
RGBA_DXT1 |
attribute | Any |
|
RGBA_DXT3 |
attribute | Any |
|
RGBA_DXT5 |
attribute | Any |
|
RGBA_Integer |
attribute | Any |
|
RGBFormat |
attribute | Any |
|
RGB_BP_SIGNED_FLOAT |
attribute | Any |
|
RGB_BP_UNSIGNED_FLOAT |
attribute | Any |
|
RGB_BP_UNorm |
attribute | Any |
|
RGB_DXT1 |
attribute | Any |
|
RGB_Integer |
attribute | Any |
|
RG_ATI2N_SNorm |
attribute | Any |
|
RG_ATI2N_UNorm |
attribute | Any |
|
RG_Integer |
attribute | Any |
|
R_ATI1N_SNorm |
attribute | Any |
|
R_ATI1N_UNorm |
attribute | Any |
|
Red |
attribute | Any |
|
RedValue |
attribute | Any |
|
Red_Integer |
attribute | Any |
|
Repeat |
attribute | Any |
|
ResetTextureUnit |
attribute | Any |
|
S8 |
attribute | Any |
|
SRGB8 |
attribute | Any |
|
SRGB8_Alpha8 |
attribute | Any |
|
SRGB8_Alpha8_ETC2_EAC |
attribute | Any |
|
SRGB8_ETC2 |
attribute | Any |
|
SRGB8_PunchThrough_Alpha1_ETC2 |
attribute | Any |
|
SRGB_Alpha_DXT1 |
attribute | Any |
|
SRGB_Alpha_DXT3 |
attribute | Any |
|
SRGB_Alpha_DXT5 |
attribute | Any |
|
SRGB_BP_UNorm |
attribute | Any |
|
SRGB_DXT1 |
attribute | Any |
|
Stencil |
attribute | Any |
|
StencilMode |
attribute | Any |
|
StencilTexturing |
attribute | Any |
|
Swizzle |
attribute | Any |
|
SwizzleAlpha |
attribute | Any |
|
SwizzleBlue |
attribute | Any |
|
SwizzleComponent |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
SwizzleGreen |
attribute | Any |
|
SwizzleRed |
attribute | Any |
|
SwizzleValue |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
Target |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
Target1D |
attribute | Any |
|
Target1DArray |
attribute | Any |
|
Target2D |
attribute | Any |
|
Target2DArray |
attribute | Any |
|
Target2DMultisample |
attribute | Any |
|
Target2DMultisampleArray |
attribute | Any |
|
Target3D |
attribute | Any |
|
TargetBuffer |
attribute | Any |
|
TargetCubeMap |
attribute | Any |
|
TargetCubeMapArray |
attribute | Any |
|
TargetRectangle |
attribute | Any |
|
Texture1D |
attribute | Any |
|
Texture3D |
attribute | Any |
|
TextureArrays |
attribute | Any |
|
TextureBuffer |
attribute | Any |
|
TextureComparisonOperators |
attribute | Any |
|
TextureCubeMapArrays |
attribute | Any |
|
TextureFormat |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
TextureFormatClass |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
TextureMipMapLevel |
attribute | Any |
|
TextureMultisample |
attribute | Any |
|
TextureRectangle |
attribute | Any |
|
TextureUnitReset |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
UInt16 |
attribute | Any |
|
UInt16_R5G6B5 |
attribute | Any |
|
UInt16_R5G6B5_Rev |
attribute | Any |
|
UInt16_RGB5A1 |
attribute | Any |
|
UInt16_RGB5A1_Rev |
attribute | Any |
|
UInt16_RGBA4 |
attribute | Any |
|
UInt16_RGBA4_Rev |
attribute | Any |
|
UInt32 |
attribute | Any |
|
UInt32_D24S8 |
attribute | Any |
|
UInt32_RG11B10F |
attribute | Any |
|
UInt32_RGB10A2 |
attribute | Any |
|
UInt32_RGB10A2_Rev |
attribute | Any |
|
UInt32_RGB9_E5 |
attribute | Any |
|
UInt32_RGBA8 |
attribute | Any |
|
UInt32_RGBA8_Rev |
attribute | Any |
|
UInt8 |
attribute | Any |
|
UInt8_RG3B2 |
attribute | Any |
|
UInt8_RG3B2_Rev |
attribute | Any |
|
WrapMode |
attribute | type |
Convert a number or string to an integer, or return 0 if no arguments are given. |
ZeroValue |
attribute | Any |
|
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
allocateStorage |
function | (self, pixelFormat: Any, pixelType: Any) -> None |
X.allocateStorage(pixelFormat, pixelType) |
bind |
function | (self, unit: Any, reset: Any) -> None |
X.bind(unit, reset) |
borderColor |
function | (self, border: Any) -> Any |
X.borderColor(border) -> PythonQt.QtGui.QColor |
boundTextureId |
function | (self, unit: Any, target: Any) -> int |
X.boundTextureId(unit, target) -> int |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
comparisonFunction |
function | (self) -> Any |
Returns the texture comparison operator set on this texture. |
comparisonMode |
function | (self) -> Any |
Returns the texture comparison mode set on this texture. |
create |
function | (self) -> bool |
X.create() -> bool |
createTextureView |
function | (self, target: Any, viewFormat: Any, minimumMipmapLevel: int, maximumMipmapLevel: int, minimumLayer: int, max… |
X.createTextureView(target, viewFormat, minimumMipmapLevel, maximumMipmapLevel, minimumLayer, maximumLayer) -> PythonQt.QtGui.QOpenGLTexture |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
depth |
function | (self) -> int |
X.depth() -> int |
depthStencilMode |
function | (self) -> Any |
Returns the depth stencil mode for textures using a combined depth/stencil format. |
destroy |
function | (self) -> None |
Destroys the underlying OpenGL texture object. |
faces |
function | (self) -> int |
X.faces() -> int |
format |
function | (self) -> Any |
Returns the format of this texture object. |
generateMipMaps |
function | (self, baseLevel: Any, resetBaseLevel: Any) -> None |
X.generateMipMaps(baseLevel, resetBaseLevel) |
hasFeature |
function | (self, feature: Any) -> bool |
X.hasFeature(feature) -> bool |
height |
function | (self) -> int |
X.height() -> int |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
isAutoMipMapGenerationEnabled |
function | (self) -> bool |
X.isAutoMipMapGenerationEnabled() -> bool |
isBound |
function | (self, unit: Any) -> bool |
X.isBound(unit) -> bool |
isCreated |
function | (self) -> bool |
X.isCreated() -> bool |
isFixedSamplePositions |
function | (self) -> bool |
X.isFixedSamplePositions() -> bool |
isStorageAllocated |
function | (self) -> bool |
X.isStorageAllocated() -> bool |
isTextureView |
function | (self) -> bool |
X.isTextureView() -> bool |
layers |
function | (self) -> int |
X.layers() -> int |
levelOfDetailRange |
function | (self) -> Any |
Returns the minimum and maximum level of detail parameters. |
levelofDetailBias |
function | (self) -> float |
X.levelofDetailBias() -> float |
magnificationFilter |
function | (self) -> Any |
Returns the magnification filter. |
maximumAnisotropy |
function | (self) -> float |
X.maximumAnisotropy() -> float |
maximumLevelOfDetail |
function | (self) -> float |
X.maximumLevelOfDetail() -> float |
maximumMipLevels |
function | (self) -> int |
X.maximumMipLevels() -> int |
minMagFilters |
function | (self) -> Any |
Returns the current minification and magnification filters. |
minificationFilter |
function | (self) -> Any |
Returns the minification filter. |
minimumLevelOfDetail |
function | (self) -> float |
X.minimumLevelOfDetail() -> float |
mipBaseLevel |
function | (self) -> int |
X.mipBaseLevel() -> int |
mipLevelRange |
function | (self) -> Any |
Returns the range of mipmap levels that can be used for texture lookups with this texture. |
mipLevels |
function | (self) -> int |
X.mipLevels() -> int |
mipMaxLevel |
function | (self) -> int |
X.mipMaxLevel() -> int |
release |
function | (self, unit: Any, reset: Any) -> None |
X.release(unit, reset) |
samples |
function | (self) -> int |
X.samples() -> int |
setAutoMipMapGenerationEnabled |
function | (self, enabled: bool) -> None |
If enabled is true, enables automatic mipmap generation for this texture object to occur whenever the level 0 mipmap data is set via… |
setBorderColor |
function | (self, r: Any, g: Any, b: Any, a: Any) -> None |
X.setBorderColor(r, g, b, a) |
setComparisonFunction |
function | (self, function: Any) -> None |
Sets the texture comparison function on this texture to function. |
setComparisonMode |
function | (self, mode: Any) -> None |
Sets the texture comparison mode on this texture to mode. |
setData |
function | (self, image: Any, genMipMaps: Any) -> None |
X.setData(image, genMipMaps) |
setDepthStencilMode |
function | (self, mode: Any) -> None |
If using a texture that has a combined depth/stencil format this function sets which component of the texture is accessed to mode. |
setFixedSamplePositions |
function | (self, fixed: bool) -> None |
Sets whether the sample positions and number of samples used with a multisample capable texture target to fixed. |
setFormat |
function | (self, format: Any) -> None |
Sets the format of this texture object to format. |
setLayers |
function | (self, layers: int) -> None |
Sets the number of array layers to allocate storage for. |
setLevelOfDetailRange |
function | (self, min: float, max: float) -> None |
X.setLevelOfDetailRange(min, max) |
setLevelofDetailBias |
function | (self, bias: float) -> None |
Sets the level of detail bias to bias. |
setMagnificationFilter |
function | (self, filter: Any) -> None |
Sets the magnification filter to filter. |
setMaximumAnisotropy |
function | (self, anisotropy: float) -> None |
If your OpenGL implementation supports the GL_EXT_texture_filter_anisotropic extension this function sets the maximum anisotropy level to anisotropy. |
setMaximumLevelOfDetail |
function | (self, value: float) -> None |
Sets the maximum level of detail to value. |
setMinMagFilters |
function | (self, minificationFilter: Any, magnificationFilter: Any) -> None |
X.setMinMagFilters(minificationFilter, magnificationFilter) |
setMinificationFilter |
function | (self, filter: Any) -> None |
Sets the filter used for minification to filter. |
setMinimumLevelOfDetail |
function | (self, value: float) -> None |
Sets the minimum level of detail to value. |
setMipBaseLevel |
function | (self, baseLevel: int) -> None |
Sets the base mipmap level used for all texture lookups with this texture to baseLevel. |
setMipLevelRange |
function | (self, baseLevel: int, maxLevel: int) -> None |
X.setMipLevelRange(baseLevel, maxLevel) |
setMipLevels |
function | (self, levels: int) -> None |
For texture targets that support mipmaps, this function sets the requested number of mipmap levels to allocate storage for. |
setMipMaxLevel |
function | (self, maxLevel: int) -> None |
Sets the maximum mipmap level used for all texture lookups with this texture to maxLevel. |
setSamples |
function | (self, samples: int) -> None |
Sets the number of samples to allocate storage for when rendering to a multisample capable texture target. |
setSize |
function | (self, width: int, height: int, depth: int) -> None |
X.setSize(width, height, depth) |
setSwizzleMask |
function | (self, r: Any, g: Any, b: Any, a: Any) -> None |
X.setSwizzleMask(r, g, b, a) |
setWrapMode |
function | (self, direction: Any, mode: Any) -> None |
X.setWrapMode(direction, mode) |
swizzleMask |
function | (self, component: Any) -> Any |
Returns the swizzle mask for texture component. |
target |
function | (self) -> Any |
Returns the binding target of this texture. |
textureId |
function | (self) -> int |
X.textureId() -> int |
width |
function | (self) -> int |
X.width() -> int |
wrapMode |
function | (self, direction: Any) -> Any |
Returns the wrap mode for the texture dimension direction. |