PySide6.QtOpenGL.QOpenGLTexture¶
- class QOpenGLTexture¶
- The - QOpenGLTextureclass encapsulates an OpenGL texture object.- Details- QOpenGLTexturemakes 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 - QOpenGLTextureis- 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).flipped()); texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear); texture->setMagnificationFilter(QOpenGLTexture::Linear); ... // Render with texture texture->bind(); glDrawArrays(...); - Note that the QImage is flipped 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. - Synopsis¶- Methods¶- def - __init__()
- def - bind()
- def - borderColor()
- def - comparisonMode()
- def - create()
- def - depth()
- def - destroy()
- def - faces()
- def - format()
- def - height()
- def - isBound()
- def - isCreated()
- def - isTextureView()
- def - layers()
- def - minMagFilters()
- def - mipBaseLevel()
- def - mipLevelRange()
- def - mipLevels()
- def - mipMaxLevel()
- def - release()
- def - samples()
- def - setBorderColor()
- def - setData()
- def - setFormat()
- def - setLayers()
- def - setMipLevels()
- def - setMipMaxLevel()
- def - setSamples()
- def - setSize()
- def - setSwizzleMask()
- def - setWrapMode()
- def - swizzleMask()
- def - target()
- def - textureId()
- def - width()
- def - wrapMode()
 - Static functions¶- def - boundTextureId()
- def - hasFeature()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - class Target¶
- This enum defines the texture target of a - QOpenGLTextureobject. For more information on creating array textures, see Array Texture.- Constant - Description - QOpenGLTexture.Target.Target1D - A 1-dimensional texture. Equivalent to GL_TEXTURE_1D. - QOpenGLTexture.Target.Target1DArray - An array of 1-dimensional textures. Equivalent to GL_TEXTURE_1D_ARRAY - QOpenGLTexture.Target.Target2D - A 2-dimensional texture. Equivalent to GL_TEXTURE_2D - QOpenGLTexture.Target.Target2DArray - An array of 2-dimensional textures. Equivalent to GL_TEXTURE_2D_ARRAY - QOpenGLTexture.Target.Target3D - A 3-dimensional texture. Equivalent to GL_TEXTURE_3D - QOpenGLTexture.Target.TargetCubeMap - A cubemap texture. Equivalent to GL_TEXTURE_CUBE_MAP - QOpenGLTexture.Target.TargetCubeMapArray - An array of cubemap textures. Equivalent to GL_TEXTURE_CUBE_MAP_ARRAY - QOpenGLTexture.Target.Target2DMultisample - A 2-dimensional texture with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE - QOpenGLTexture.Target.Target2DMultisampleArray - An array of 2-dimensional textures with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE_ARRAY - QOpenGLTexture.Target.TargetRectangle - A rectangular 2-dimensional texture. Equivalent to GL_TEXTURE_RECTANGLE - QOpenGLTexture.Target.TargetBuffer - A texture with data from an OpenGL buffer object. Equivalent to GL_TEXTURE_BUFFER 
 - class BindingTarget¶
- This enum defines the possible binding targets of texture units. - Constant - Description - QOpenGLTexture.BindingTarget.BindingTarget1D - Equivalent to GL_TEXTURE_BINDING_1D - QOpenGLTexture.BindingTarget.BindingTarget1DArray - Equivalent to GL_TEXTURE_BINDING_1D_ARRAY - QOpenGLTexture.BindingTarget.BindingTarget2D - Equivalent to GL_TEXTURE_BINDING_2D - QOpenGLTexture.BindingTarget.BindingTarget2DArray - Equivalent to GL_TEXTURE_BINDING_2D_ARRAY - QOpenGLTexture.BindingTarget.BindingTarget3D - Equivalent to GL_TEXTURE_BINDING_3D - QOpenGLTexture.BindingTarget.BindingTargetCubeMap - Equivalent to GL_TEXTURE_BINDING_CUBE_MAP - QOpenGLTexture.BindingTarget.BindingTargetCubeMapArray - Equivalent to GL_TEXTURE_BINDING_CUBE_MAP_ARRAY - QOpenGLTexture.BindingTarget.BindingTarget2DMultisample - Equivalent to GL_TEXTURE_BINDING_2D_MULTISAMPLE - QOpenGLTexture.BindingTarget.BindingTarget2DMultisampleArray - Equivalent to GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY - QOpenGLTexture.BindingTarget.BindingTargetRectangle - Equivalent to GL_TEXTURE_BINDING_RECTANGLE - QOpenGLTexture.BindingTarget.BindingTargetBuffer - Equivalent to GL_TEXTURE_BINDING_BUFFER 
 - class MipMapGeneration¶
- This enum defines the options to control mipmap generation. - Constant - Description - QOpenGLTexture.MipMapGeneration.GenerateMipMaps - Mipmaps should be generated - QOpenGLTexture.MipMapGeneration.DontGenerateMipMaps - Mipmaps should not be generated 
 - class TextureUnitReset¶
- This enum defines options ot control texture unit activation. - Constant - Description - QOpenGLTexture.TextureUnitReset.ResetTextureUnit - The previous active texture unit will be reset - QOpenGLTexture.TextureUnitReset.DontResetTextureUnit - The previous active texture unit will not be rest 
 - class TextureFormat¶
- This enum defines the possible texture formats. Depending upon your OpenGL implementation only a subset of these may be supported. - Constant - Description - QOpenGLTexture.TextureFormat.NoFormat - Equivalent to GL_NONE - QOpenGLTexture.TextureFormat.R8_UNorm - Equivalent to GL_R8 - QOpenGLTexture.TextureFormat.RG8_UNorm - Equivalent to GL_RG8 - QOpenGLTexture.TextureFormat.RGB8_UNorm - Equivalent to GL_RGB8 - QOpenGLTexture.TextureFormat.RGBA8_UNorm - Equivalent to GL_RGBA8 - QOpenGLTexture.TextureFormat.R16_UNorm - Equivalent to GL_R16 - QOpenGLTexture.TextureFormat.RG16_UNorm - Equivalent to GL_RG16 - QOpenGLTexture.TextureFormat.RGB16_UNorm - Equivalent to GL_RGB16 - QOpenGLTexture.TextureFormat.RGBA16_UNorm - Equivalent to GL_RGBA16 - QOpenGLTexture.TextureFormat.R8_SNorm - Equivalent to GL_R8_SNORM - QOpenGLTexture.TextureFormat.RG8_SNorm - Equivalent to GL_RG8_SNORM - QOpenGLTexture.TextureFormat.RGB8_SNorm - Equivalent to GL_RGB8_SNORM - QOpenGLTexture.TextureFormat.RGBA8_SNorm - Equivalent to GL_RGBA8_SNORM - QOpenGLTexture.TextureFormat.R16_SNorm - Equivalent to GL_R16_SNORM - QOpenGLTexture.TextureFormat.RG16_SNorm - Equivalent to GL_RG16_SNORM - QOpenGLTexture.TextureFormat.RGB16_SNorm - Equivalent to GL_RGB16_SNORM - QOpenGLTexture.TextureFormat.RGBA16_SNorm - Equivalent to GL_RGBA16_SNORM - QOpenGLTexture.TextureFormat.R8U - Equivalent to GL_R8UI - QOpenGLTexture.TextureFormat.RG8U - Equivalent to GL_RG8UI - QOpenGLTexture.TextureFormat.RGB8U - Equivalent to GL_RGB8UI - QOpenGLTexture.TextureFormat.RGBA8U - Equivalent to GL_RGBA8UI - QOpenGLTexture.TextureFormat.R16U - Equivalent to GL_R16UI - QOpenGLTexture.TextureFormat.RG16U - Equivalent to GL_RG16UI - QOpenGLTexture.TextureFormat.RGB16U - Equivalent to GL_RGB16UI - QOpenGLTexture.TextureFormat.RGBA16U - Equivalent to GL_RGBA16UI - QOpenGLTexture.TextureFormat.R32U - Equivalent to GL_R32UI - QOpenGLTexture.TextureFormat.RG32U - Equivalent to GL_RG32UI - QOpenGLTexture.TextureFormat.RGB32U - Equivalent to GL_RGB32UI - QOpenGLTexture.TextureFormat.RGBA32U - Equivalent to GL_RGBA32UI - QOpenGLTexture.TextureFormat.R8I - Equivalent to GL_R8I - QOpenGLTexture.TextureFormat.RG8I - Equivalent to GL_RG8I - QOpenGLTexture.TextureFormat.RGB8I - Equivalent to GL_RGB8I - QOpenGLTexture.TextureFormat.RGBA8I - Equivalent to GL_RGBA8I - QOpenGLTexture.TextureFormat.R16I - Equivalent to GL_R16I - QOpenGLTexture.TextureFormat.RG16I - Equivalent to GL_RG16I - QOpenGLTexture.TextureFormat.RGB16I - Equivalent to GL_RGB16I - QOpenGLTexture.TextureFormat.RGBA16I - Equivalent to GL_RGBA16I - QOpenGLTexture.TextureFormat.R32I - Equivalent to GL_R32I - QOpenGLTexture.TextureFormat.RG32I - Equivalent to GL_RG32I - QOpenGLTexture.TextureFormat.RGB32I - Equivalent to GL_RGB32I - QOpenGLTexture.TextureFormat.RGBA32I - Equivalent to GL_RGBA32I - QOpenGLTexture.TextureFormat.R16F - Equivalent to GL_R16F - QOpenGLTexture.TextureFormat.RG16F - Equivalent to GL_RG16F - QOpenGLTexture.TextureFormat.RGB16F - Equivalent to GL_RGB16F - QOpenGLTexture.TextureFormat.RGBA16F - Equivalent to GL_RGBA16F - QOpenGLTexture.TextureFormat.R32F - Equivalent to GL_R32F - QOpenGLTexture.TextureFormat.RG32F - Equivalent to GL_RG32F - QOpenGLTexture.TextureFormat.RGB32F - Equivalent to GL_RGB32F - QOpenGLTexture.TextureFormat.RGBA32F - Equivalent to GL_RGBA32F - QOpenGLTexture.TextureFormat.RGB9E5 - Equivalent to GL_RGB9_E5 - QOpenGLTexture.TextureFormat.RG11B10F - Equivalent to GL_R11F_G11F_B10F - QOpenGLTexture.TextureFormat.RG3B2 - Equivalent to GL_R3_G3_B2 - QOpenGLTexture.TextureFormat.R5G6B5 - Equivalent to GL_RGB565 - QOpenGLTexture.TextureFormat.RGB5A1 - Equivalent to GL_RGB5_A1 - QOpenGLTexture.TextureFormat.RGBA4 - Equivalent to GL_RGBA4 - QOpenGLTexture.TextureFormat.RGB10A2 - Equivalent to GL_RGB10_A2UI - QOpenGLTexture.TextureFormat.D16 - Equivalent to GL_DEPTH_COMPONENT16 - QOpenGLTexture.TextureFormat.D24 - Equivalent to GL_DEPTH_COMPONENT24 - QOpenGLTexture.TextureFormat.D24S8 - Equivalent to GL_DEPTH24_STENCIL8 - QOpenGLTexture.TextureFormat.D32 - Equivalent to GL_DEPTH_COMPONENT32 - QOpenGLTexture.TextureFormat.D32F - Equivalent to GL_DEPTH_COMPONENT32F - QOpenGLTexture.TextureFormat.D32FS8X24 - Equivalent to GL_DEPTH32F_STENCIL8 - QOpenGLTexture.TextureFormat.S8 - Equivalent to GL_STENCIL_INDEX8. Introduced in Qt 5.4 - QOpenGLTexture.TextureFormat.RGB_DXT1 - Equivalent to GL_COMPRESSED_RGB_S3TC_DXT1_EXT - QOpenGLTexture.TextureFormat.RGBA_DXT1 - Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT1_EXT - QOpenGLTexture.TextureFormat.RGBA_DXT3 - Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT3_EXT - QOpenGLTexture.TextureFormat.RGBA_DXT5 - Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT5_EXT - QOpenGLTexture.TextureFormat.R_ATI1N_UNorm - Equivalent to GL_COMPRESSED_RED_RGTC1 - QOpenGLTexture.TextureFormat.R_ATI1N_SNorm - Equivalent to GL_COMPRESSED_SIGNED_RED_RGTC1 - QOpenGLTexture.TextureFormat.RG_ATI2N_UNorm - Equivalent to GL_COMPRESSED_RG_RGTC2 - QOpenGLTexture.TextureFormat.RG_ATI2N_SNorm - Equivalent to GL_COMPRESSED_SIGNED_RG_RGTC2 - QOpenGLTexture.TextureFormat.RGB_BP_UNSIGNED_FLOAT - Equivalent to GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB - QOpenGLTexture.TextureFormat.RGB_BP_SIGNED_FLOAT - Equivalent to GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB - QOpenGLTexture.TextureFormat.RGB_BP_UNorm - Equivalent to GL_COMPRESSED_RGBA_BPTC_UNORM_ARB - QOpenGLTexture.TextureFormat.R11_EAC_UNorm - Equivalent to GL_COMPRESSED_R11_EAC - QOpenGLTexture.TextureFormat.R11_EAC_SNorm - Equivalent to GL_COMPRESSED_SIGNED_R11_EAC - QOpenGLTexture.TextureFormat.RG11_EAC_UNorm - Equivalent to GL_COMPRESSED_RG11_EAC - QOpenGLTexture.TextureFormat.RG11_EAC_SNorm - Equivalent to GL_COMPRESSED_SIGNED_RG11_EAC - QOpenGLTexture.TextureFormat.RGB8_ETC2 - Equivalent to GL_COMPRESSED_RGB8_ETC2 - QOpenGLTexture.TextureFormat.SRGB8_ETC2 - Equivalent to GL_COMPRESSED_SRGB8_ETC2 - QOpenGLTexture.TextureFormat.RGB8_PunchThrough_Alpha1_ETC2 - Equivalent to GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 - QOpenGLTexture.TextureFormat.SRGB8_PunchThrough_Alpha1_ETC2 - Equivalent to GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 - QOpenGLTexture.TextureFormat.RGBA8_ETC2_EAC - Equivalent to GL_COMPRESSED_RGBA8_ETC2_EAC - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ETC2_EAC - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC - QOpenGLTexture.TextureFormat.RGB8_ETC1 - Equivalent to GL_ETC1_RGB8_OES - QOpenGLTexture.TextureFormat.RGBA_ASTC_4x4 - Equivalent to GL_COMPRESSED_RGBA_ASTC_4x4_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_5x4 - Equivalent to GL_COMPRESSED_RGBA_ASTC_5x4_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_5x5 - Equivalent to GL_COMPRESSED_RGBA_ASTC_5x5_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_6x5 - Equivalent to GL_COMPRESSED_RGBA_ASTC_6x5_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_6x6 - Equivalent to GL_COMPRESSED_RGBA_ASTC_6x6_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_8x5 - Equivalent to GL_COMPRESSED_RGBA_ASTC_8x5_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_8x6 - Equivalent to GL_COMPRESSED_RGBA_ASTC_8x6_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_8x8 - Equivalent to GL_COMPRESSED_RGBA_ASTC_8x8_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_10x5 - Equivalent to GL_COMPRESSED_RGBA_ASTC_10x5_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_10x6 - Equivalent to GL_COMPRESSED_RGBA_ASTC_10x6_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_10x8 - Equivalent to GL_COMPRESSED_RGBA_ASTC_10x8_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_10x10 - Equivalent to GL_COMPRESSED_RGBA_ASTC_10x10_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_12x10 - Equivalent to GL_COMPRESSED_RGBA_ASTC_12x10_KHR - QOpenGLTexture.TextureFormat.RGBA_ASTC_12x12 - Equivalent to GL_COMPRESSED_RGBA_ASTC_12x12_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_4x4 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_5x4 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_5x5 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_6x5 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_6x6 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_8x5 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_8x6 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_8x8 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_10x5 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_10x6 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_10x8 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_10x10 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_12x10 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR - QOpenGLTexture.TextureFormat.SRGB8_Alpha8_ASTC_12x12 - Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR - QOpenGLTexture.TextureFormat.SRGB8 - Equivalent to GL_SRGB8 - QOpenGLTexture.TextureFormat.SRGB8_Alpha8 - Equivalent to GL_SRGB8_ALPHA8 - QOpenGLTexture.TextureFormat.SRGB_DXT1 - Equivalent to GL_COMPRESSED_SRGB_S3TC_DXT1_EXT - QOpenGLTexture.TextureFormat.SRGB_Alpha_DXT1 - Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT - QOpenGLTexture.TextureFormat.SRGB_Alpha_DXT3 - Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT - QOpenGLTexture.TextureFormat.SRGB_Alpha_DXT5 - Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT - QOpenGLTexture.TextureFormat.SRGB_BP_UNorm - Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB - QOpenGLTexture.TextureFormat.DepthFormat - Equivalent to GL_DEPTH_COMPONENT (only OpenGL ES 3 or ES 2 with OES_depth_texture) - QOpenGLTexture.TextureFormat.AlphaFormat - Equivalent to GL_ALPHA (OpenGL ES 2 only) - QOpenGLTexture.TextureFormat.RGBFormat - Equivalent to GL_RGB (OpenGL ES 2 only) - QOpenGLTexture.TextureFormat.RGBAFormat - Equivalent to GL_RGBA (OpenGL ES 2 only) - QOpenGLTexture.TextureFormat.LuminanceFormat - Equivalent to GL_LUMINANCE (OpenGL ES 2 only) - QOpenGLTexture.TextureFormat.LuminanceAlphaFormat - Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only) 
 - class TextureFormatClass¶
 - class CubeMapFace¶
- This enum defines the possible CubeMap faces. - Constant - Description - QOpenGLTexture.CubeMapFace.CubeMapPositiveX - Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_X - QOpenGLTexture.CubeMapFace.CubeMapNegativeX - Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_X - QOpenGLTexture.CubeMapFace.CubeMapPositiveY - Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Y - QOpenGLTexture.CubeMapFace.CubeMapNegativeY - Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Y - QOpenGLTexture.CubeMapFace.CubeMapPositiveZ - Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Z - QOpenGLTexture.CubeMapFace.CubeMapNegativeZ - Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 
 - class PixelFormat¶
- This enum defines the possible client-side pixel formats for a pixel transfer operation. - Constant - Description - QOpenGLTexture.PixelFormat.NoSourceFormat - Equivalent to GL_NONE - QOpenGLTexture.PixelFormat.Red - Equivalent to GL_RED - QOpenGLTexture.PixelFormat.RG - Equivalent to GL_RG - QOpenGLTexture.PixelFormat.RGB - Equivalent to GL_RGB - QOpenGLTexture.PixelFormat.BGR - Equivalent to GL_BGR - QOpenGLTexture.PixelFormat.RGBA - Equivalent to GL_RGBA - QOpenGLTexture.PixelFormat.BGRA - Equivalent to GL_BGRA - QOpenGLTexture.PixelFormat.Red_Integer - Equivalent to GL_RED_INTEGER - QOpenGLTexture.PixelFormat.RG_Integer - Equivalent to GL_RG_INTEGER - QOpenGLTexture.PixelFormat.RGB_Integer - Equivalent to GL_RGB_INTEGER - QOpenGLTexture.PixelFormat.BGR_Integer - Equivalent to GL_BGR_INTEGER - QOpenGLTexture.PixelFormat.RGBA_Integer - Equivalent to GL_RGBA_INTEGER - QOpenGLTexture.PixelFormat.BGRA_Integer - Equivalent to GL_BGRA_INTEGER - QOpenGLTexture.PixelFormat.Stencil - Equivalent to GL_STENCIL_INDEX. Introduced in Qt 5.4 - QOpenGLTexture.PixelFormat.Depth - Equivalent to GL_DEPTH_COMPONENT - QOpenGLTexture.PixelFormat.DepthStencil - Equivalent to GL_DEPTH_STENCIL - QOpenGLTexture.PixelFormat.Alpha - Equivalent to GL_ALPHA (OpenGL ES 2 only) - QOpenGLTexture.PixelFormat.Luminance - Equivalent to GL_LUMINANCE (OpenGL ES 2 only) - QOpenGLTexture.PixelFormat.LuminanceAlpha - Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only) 
 - class PixelType¶
- This enum defines the possible pixel data types for a pixel transfer operation - Constant - Description - QOpenGLTexture.PixelType.NoPixelType - Equivalent to GL_NONE - QOpenGLTexture.PixelType.Int8 - Equivalent to GL_BYTE - QOpenGLTexture.PixelType.UInt8 - Equivalent to GL_UNSIGNED_BYTE - QOpenGLTexture.PixelType.Int16 - Equivalent to GL_SHORT - QOpenGLTexture.PixelType.UInt16 - Equivalent to GL_UNSIGNED_SHORT - QOpenGLTexture.PixelType.Int32 - Equivalent to GL_INT - QOpenGLTexture.PixelType.UInt32 - Equivalent to GL_UNSIGNED_INT - QOpenGLTexture.PixelType.Float16 - Equivalent to GL_HALF_FLOAT - QOpenGLTexture.PixelType.Float16OES - Equivalent to GL_HALF_FLOAT_OES - QOpenGLTexture.PixelType.Float32 - Equivalent to GL_FLOAT - QOpenGLTexture.PixelType.UInt32_RGB9_E5 - Equivalent to GL_UNSIGNED_INT_5_9_9_9_REV - QOpenGLTexture.PixelType.UInt32_RG11B10F - Equivalent to GL_UNSIGNED_INT_10F_11F_11F_REV - QOpenGLTexture.PixelType.UInt8_RG3B2 - Equivalent to GL_UNSIGNED_BYTE_3_3_2 - QOpenGLTexture.PixelType.UInt8_RG3B2_Rev - Equivalent to GL_UNSIGNED_BYTE_2_3_3_REV - QOpenGLTexture.PixelType.UInt16_RGB5A1 - Equivalent to GL_UNSIGNED_SHORT_5_5_5_1 - QOpenGLTexture.PixelType.UInt16_RGB5A1_Rev - Equivalent to GL_UNSIGNED_SHORT_1_5_5_5_REV - QOpenGLTexture.PixelType.UInt16_R5G6B5 - Equivalent to GL_UNSIGNED_SHORT_5_6_5 - QOpenGLTexture.PixelType.UInt16_R5G6B5_Rev - Equivalent to GL_UNSIGNED_SHORT_5_6_5_REV - QOpenGLTexture.PixelType.UInt16_RGBA4 - Equivalent to GL_UNSIGNED_SHORT_4_4_4_4 - QOpenGLTexture.PixelType.UInt16_RGBA4_Rev - Equivalent to GL_UNSIGNED_SHORT_4_4_4_4_REV - QOpenGLTexture.PixelType.UInt32_RGBA8 - Equivalent to GL_UNSIGNED_INT_8_8_8_8 - QOpenGLTexture.PixelType.UInt32_RGBA8_Rev - Equivalent to GL_UNSIGNED_INT_8_8_8_8_REV - QOpenGLTexture.PixelType.UInt32_RGB10A2 - Equivalent to GL_UNSIGNED_INT_10_10_10_2 - QOpenGLTexture.PixelType.UInt32_RGB10A2_Rev - Equivalent to GL_UNSIGNED_INT_2_10_10_10_REV - QOpenGLTexture.PixelType.UInt32_D24S8 - Equivalent to GL_UNSIGNED_INT_24_8. Introduced in Qt 5.4 - QOpenGLTexture.PixelType.Float32_D32_UInt32_S8_X24 - Equivalent to GL_FLOAT_32_UNSIGNED_INT_24_8_REV. Introduced in Qt 5.4 
 - class SwizzleComponent¶
- This enum defines the texture color components that can be assigned a swizzle mask. - Constant - Description - QOpenGLTexture.SwizzleComponent.SwizzleRed - The red component. Equivalent to GL_TEXTURE_SWIZZLE_R - QOpenGLTexture.SwizzleComponent.SwizzleGreen - The green component. Equivalent to GL_TEXTURE_SWIZZLE_G - QOpenGLTexture.SwizzleComponent.SwizzleBlue - The blue component. Equivalent to GL_TEXTURE_SWIZZLE_B - QOpenGLTexture.SwizzleComponent.SwizzleAlpha - The alpha component. Equivalent to GL_TEXTURE_SWIZZLE_A 
 - class SwizzleValue¶
- This enum defines the possible mask values for texture swizzling. - Constant - Description - QOpenGLTexture.SwizzleValue.RedValue - Maps the component to the red channel. Equivalent to GL_RED - QOpenGLTexture.SwizzleValue.GreenValue - Maps the component to the green channel. Equivalent to GL_GREEN - QOpenGLTexture.SwizzleValue.BlueValue - Maps the component to the blue channel. Equivalent to GL_BLUE - QOpenGLTexture.SwizzleValue.AlphaValue - Maps the component to the alpha channel. Equivalent to GL_ALPHA - QOpenGLTexture.SwizzleValue.ZeroValue - Maps the component to a fixed value of 0. Equivalent to GL_ZERO - QOpenGLTexture.SwizzleValue.OneValue - Maps the component to a fixed value of 1. Equivalent to GL_ONE 
 - class WrapMode¶
- This enum defines the possible texture coordinate wrapping modes. - Constant - Description - QOpenGLTexture.WrapMode.Repeat - Texture coordinate is repeated. Equivalent to GL_REPEAT - QOpenGLTexture.WrapMode.MirroredRepeat - Texture coordinate is reflected about 0 and 1. Equivalent to GL_MIRRORED_REPEAT - QOpenGLTexture.WrapMode.ClampToEdge - Clamps the texture coordinates to [0,1]. Equivalent to GL_CLAMP_TO_EDGE - QOpenGLTexture.WrapMode.ClampToBorder - As for ClampToEdge but also blends samples at 0 and 1 with a fixed border color. Equivalent to GL_CLAMP_TO_BORDER 
 - class CoordinateDirection¶
- This enum defines the possible texture coordinate directions - Constant - Description - QOpenGLTexture.CoordinateDirection.DirectionS - The horizontal direction. Equivalent to GL_TEXTURE_WRAP_S - QOpenGLTexture.CoordinateDirection.DirectionT - The vertical direction. Equivalent to GL_TEXTURE_WRAP_T - QOpenGLTexture.CoordinateDirection.DirectionR - The depth direction. Equivalent to GL_TEXTURE_WRAP_R 
 - class Feature¶
- (inherits - enum.Flag) This enum defines the OpenGL texture-related features that can be tested for.- Constant - Description - QOpenGLTexture.Feature.ImmutableStorage - Support for immutable texture storage - QOpenGLTexture.Feature.ImmutableMultisampleStorage - Support for immutable texture storage with multisample targets - QOpenGLTexture.Feature.TextureRectangle - Support for the GL_TEXTURE_RECTANGLE target - QOpenGLTexture.Feature.TextureArrays - Support for texture targets with array layers - QOpenGLTexture.Feature.Texture3D - Support for the 3 dimensional texture target - QOpenGLTexture.Feature.TextureMultisample - Support for texture targets that have multisample capabilities - QOpenGLTexture.Feature.TextureBuffer - Support for textures that use OpenGL buffer objects as their data source - QOpenGLTexture.Feature.TextureCubeMapArrays - Support for cubemap array texture target - QOpenGLTexture.Feature.Swizzle - Support for texture component swizzle masks - QOpenGLTexture.Feature.StencilTexturing - Support for stencil texturing (i.e. looking up depth or stencil components of a combined depth/stencil format texture in GLSL shaders). - QOpenGLTexture.Feature.AnisotropicFiltering - Support for anisotropic texture filtering - QOpenGLTexture.Feature.NPOTTextures - Basic support for non-power-of-two textures - QOpenGLTexture.Feature.NPOTTextureRepeat - Full support for non-power-of-two textures including texture repeat modes - QOpenGLTexture.Feature.Texture1D - Support for the 1 dimensional texture target - QOpenGLTexture.Feature.TextureComparisonOperators - Support for texture comparison operators - QOpenGLTexture.Feature.TextureMipMapLevel - Support for setting the base and maximum mipmap levels 
 - class DepthStencilMode¶
- This enum specifies which component of a depth/stencil texture is accessed when the texture is sampled. - Constant - Description - QOpenGLTexture.DepthStencilMode.DepthMode - Equivalent to GL_DEPTH_COMPONENT. - QOpenGLTexture.DepthStencilMode.StencilMode - Equivalent to GL_STENCIL_INDEX. 
 - class ComparisonFunction¶
- This enum specifies which comparison operator is used when texture comparison is enabled on this texture. - Constant - Description - QOpenGLTexture.ComparisonFunction.CompareLessEqual - Equivalent to GL_LEQUAL. - QOpenGLTexture.ComparisonFunction.CompareGreaterEqual - Equivalent to GL_GEQUAL. - QOpenGLTexture.ComparisonFunction.CompareLess - Equivalent to GL_LESS. - QOpenGLTexture.ComparisonFunction.CompareGreater - Equivalent to GL_GREATER. - QOpenGLTexture.ComparisonFunction.CompareEqual - Equivalent to GL_EQUAL. - QOpenGLTexture.ComparisonFunction.CompareNotEqual - Equivalent to GL_NOTEQUAL. - QOpenGLTexture.ComparisonFunction.CompareAlways - Equivalent to GL_ALWAYS. - QOpenGLTexture.ComparisonFunction.CompareNever - Equivalent to GL_NEVER. 
 - class ComparisonMode¶
- This enum specifies which comparison mode is used when sampling this texture. - Constant - Description - QOpenGLTexture.ComparisonMode.CompareRefToTexture - Equivalent to GL_COMPARE_REF_TO_TEXTURE. - QOpenGLTexture.ComparisonMode.CompareNone - Equivalent to GL_NONE. 
 - class Filter¶
- This enum defines the filtering parameters for a - QOpenGLTextureobject.- Constant - Description - QOpenGLTexture.Filter.Nearest - Equivalent to GL_NEAREST - QOpenGLTexture.Filter.Linear - Equivalent to GL_LINEAR - QOpenGLTexture.Filter.NearestMipMapNearest - Equivalent to GL_NEAREST_MIPMAP_NEAREST - QOpenGLTexture.Filter.NearestMipMapLinear - Equivalent to GL_NEAREST_MIPMAP_LINEAR - QOpenGLTexture.Filter.LinearMipMapNearest - Equivalent to GL_LINEAR_MIPMAP_NEAREST - QOpenGLTexture.Filter.LinearMipMapLinear - Equivalent to GL_LINEAR_MIPMAP_LINEAR 
 - Creates a - QOpenGLTextureobject that can later be bound to- target.- This does not create the underlying OpenGL texture object. Therefore, construction using this constructor does not require a valid current OpenGL context. - __init__(image[, genMipMaps=QOpenGLTexture.MipMapGeneration.GenerateMipMaps])
- Parameters:
- image – - QImage
- genMipMaps – - MipMapGeneration
 
 
 - Creates a - QOpenGLTextureobject that can later be bound to the 2D texture target and contains the pixel data contained in- image. If you wish to have a chain of mipmaps generated then set- genMipMapsto- true(this is the default).- This does create the underlying OpenGL texture object. Therefore, construction using this constructor does require a valid current OpenGL context. - Note - imageis automatically converted to QImage::Format_RGBA8888 which may have performance implications for large images with a different format.- allocateStorage()¶
 - Allocates server-side storage for this texture object taking into account, the format, dimensions, mipmap levels, array layers and cubemap faces. - Once storage has been allocated it is no longer possible to change these properties. - If supported - QOpenGLTexturemakes use of immutable texture storage.- Once storage has been allocated for the texture then pixel data can be uploaded via one of the - setData()overloads.- Note - If immutable texture storage is not available, then a default pixel format and pixel type will be used to create the mutable storage. You can use the other allocateStorage() overload to specify exactly the pixel format and the pixel type to use when allocating mutable storage; this is particularly useful under certain OpenGL ES implementations (notably, OpenGL ES 2), where the pixel format and the pixel type used at allocation time must perfectly match the format and the type passed to any subsequent - setData()call.- See also - allocateStorage(pixelFormat, pixelType)
- Parameters:
- pixelFormat – - PixelFormat
- pixelType – - PixelType
 
 
 - Allocates server-side storage for this texture object taking into account, the format, dimensions, mipmap levels, array layers and cubemap faces. - Once storage has been allocated it is no longer possible to change these properties. - If supported - QOpenGLTexturemakes use of immutable texture storage. However, if immutable texture storage is not available, then the specified- pixelFormatand- pixelTypewill be used to allocate mutable storage; note that in certain OpenGL implementations (notably, OpenGL ES 2) they must perfectly match the format and the type passed to any subsequent- setData()call.- Once storage has been allocated for the texture then pixel data can be uploaded via one of the - setData()overloads.- See also - bind()¶
 - Binds this texture to the currently active texture unit ready for rendering. Note that you do not need to bind - QOpenGLTextureobjects in order to modify them as the implementation makes use of the EXT_direct_state_access extension where available and simulates it where it is not.- See also - bind(unit[, reset=QOpenGLTexture.TextureUnitReset.DontResetTextureUnit])
- Parameters:
- unit – int 
- reset – - TextureUnitReset
 
 
 - Binds this texture to texture unit - unitready for rendering. Note that you do not need to bind- QOpenGLTextureobjects in order to modify them as the implementation makes use of the EXT_direct_state_access extension where available and simulates it where it is not.- If parameter - resetis- truethen this function will restore the active unit to the texture unit that was active upon entry.- See also - Returns the borderColor of this texture. - See also - static boundTextureId(target)¶
- Parameters:
- target – - BindingTarget
- Return type:
- int 
 
 - Returns the - textureIdof the texture that is bound to the- targetof the currently active texture unit.- static boundTextureId(unit, target)
- Parameters:
- unit – int 
- target – - BindingTarget
 
- Return type:
- int 
 
 - Returns the - textureIdof the texture that is bound to the- targetof the texture unit- unit.- comparisonFunction()¶
- Return type:
 
 - Returns the texture comparison operator set on this texture. By default, a texture has a - CompareLessEqualcomparison function.- See also - comparisonMode()¶
- Return type:
 
 - Returns the texture comparison mode set on this texture. By default, a texture has a - CompareNonecomparison mode (i.e. comparisons are disabled).- See also - create()¶
- Return type:
- bool 
 
 - Creates the underlying OpenGL texture object. This requires a current valid OpenGL context. If the texture object already exists, this function does nothing. - Once the texture object is created you can obtain the object name from the - textureId()function. This may be useful if you wish to make some raw OpenGL calls related to this texture.- Normally it should not be necessary to call this function directly as all functions that set properties of the texture object implicitly call create() on your behalf. - Returns - trueif the creation succeeded, otherwise returns- false.- See also - createTextureView(target, viewFormat, minimumMipmapLevel, maximumMipmapLevel, minimumLayer, maximumLayer)¶
- Parameters:
- target – - Target
- viewFormat – - TextureFormat
- minimumMipmapLevel – int 
- maximumMipmapLevel – int 
- minimumLayer – int 
- maximumLayer – int 
 
- Return type:
 
 - Attempts to create a texture view onto this texture. A texture view is somewhat analogous to a view in SQL in that it presents a restricted or reinterpreted view of the original data. Texture views do not allocate any more server-side storage, instead relying on the storage buffer of the source texture. - Texture views are only available when using immutable storage. For more information on texture views see http://www.opengl.org/wiki/Texture_Storage#Texture_views. - The - targetargument specifies the target to use for the view. Only some targets can be used depending upon the target of the original target. For e.g. a view onto a- Target1DArraytexture can specify either- Target1DArrayor- Target1Dbut for the latter the number of array layers specified with- minimumLayerand- maximumLayermust be exactly 1.- Simpliar constraints apply for the - viewFormat. See the above link and the specification for more details.- The - minimumMipmapLevel,- maximumMipmapLevel,- minimumLayer, and- maximumLayerarguments serve to restrict the parts of the texture accessible by the texture view.- If creation of the texture view fails this function will return 0. If the function succeeds it will return a pointer to a new - QOpenGLTextureobject that will return- truefrom its- isTextureView()function.- See also - depth()¶
- Return type:
- int 
 
 - Returns the depth of a 3D texture. - depthStencilMode()¶
- Return type:
 
 - Returns the depth stencil mode for textures using a combined depth/stencil format. - See also - destroy()¶
 - Destroys the underlying OpenGL texture object. This requires a current valid OpenGL context. - See also - faces()¶
- Return type:
- int 
 
 - Returns the number of faces for this texture. For cubemap and cubemap array type targets this will be 6. - For non-cubemap type targets this will return 1. - format()¶
- Return type:
 
 - Returns the format of this texture object. - See also - generateMipMaps()¶
 - Generates mipmaps for this texture object from mipmap level 0. If you are using a texture target and filtering option that requires mipmaps and you have disabled automatic mipmap generation then you need to call this function or the overload to create the mipmap chain. - Note - Mipmap generation is not supported for compressed textures with OpenGL ES. - generateMipMaps(baseLevel[, resetBaseLevel=true])
- Parameters:
- baseLevel – int 
- resetBaseLevel – bool 
 
 
 - Generates mipmaps for this texture object from mipmap level - baseLevel. If you are using a texture target and filtering option that requires mipmaps and you have disabled automatic mipmap generation then you need to call this function or the overload to create the mipmap chain.- The generation of mipmaps to above - baseLevelis achieved by setting the mipmap base level to- baseLeveland then generating the mipmap chain. If- resetBaseLevelis- true, then the baseLevel of the texture will be reset to its previous value.- Returns - trueif your OpenGL implementation and version supports the texture feature- feature.- height()¶
- Return type:
- int 
 
 - Returns the height of a 2D or 3D texture. - isAutoMipMapGenerationEnabled()¶
- Return type:
- bool 
 
 - Returns whether auto mipmap generation is enabled for this texture object. - isBound()¶
- Return type:
- bool 
 
 - Returns - trueif this texture is bound to the corresponding target of the currently active texture unit.- isBound(unit)
- Parameters:
- unit – int 
- Return type:
- bool 
 
 - Returns - trueif this texture is bound to the corresponding target of texture unit- unit.- isCreated()¶
- Return type:
- bool 
 
 - Returns - trueif the underlying OpenGL texture object has been created.- See also - isFixedSamplePositions()¶
- Return type:
- bool 
 
 - Returns whether this texture uses a fixed pattern of multisample samples. If storage has not yet been allocated for this texture then this function returns the requested fixed sample position setting. - For texture targets that do not support multisampling this will return - true.- isStorageAllocated()¶
- Return type:
- bool 
 
 - Returns - trueif server-side storage for this texture as been allocated.- The texture format, dimensions, mipmap levels and array layers cannot be altered once storage ihas been allocated. - isTextureView()¶
- Return type:
- bool 
 
 - Returns - trueif this texture object is actually a view onto another texture object.- See also - layers()¶
- Return type:
- int 
 
 - Returns the number of array layers for this texture. If storage has not yet been allocated for this texture then this function returns the requested number of array layers. - For texture targets that do not support array layers this will return 1. - See also - levelOfDetailRange()¶
- Return type:
- .std.pairfloat,float 
 
 - Returns the minimum and maximum level of detail parameters. - levelofDetailBias()¶
- Return type:
- float 
 
 - Returns the level of detail bias parameter. - See also - Returns the magnification filter. - See also - maximumAnisotropy()¶
- Return type:
- float 
 
 - Returns the maximum level of anisotropy to be accounted for when performing texture lookups. This requires the GL_EXT_texture_filter_anisotropic extension. - See also - maximumLevelOfDetail()¶
- Return type:
- float 
 
 - Returns the maximum level of detail parameter. - maximumMipLevels()¶
- Return type:
- int 
 
 - Returns the maximum number of mipmap levels that this texture can have given the current dimensions. - See also - minMagFilters()¶
- Return type:
- .std.pairQOpenGLTexture.Filter,QOpenGLTexture.Filter 
 
 - Returns the current minification and magnification filters. - See also - Returns the minification filter. - See also - minimumLevelOfDetail()¶
- Return type:
- float 
 
 - Returns the minimum level of detail parameter. - mipBaseLevel()¶
- Return type:
- int 
 
 - Returns the mipmap base level used for all texture lookups with this texture. The default is 0. - mipLevelRange()¶
- Return type:
- .std.pairint,int 
 
 - Returns the range of mipmap levels that can be used for texture lookups with this texture. - mipLevels()¶
- Return type:
- int 
 
 - Returns the number of mipmap levels for this texture. If storage has not yet been allocated for this texture it returns the requested number of mipmap levels. - mipMaxLevel()¶
- Return type:
- int 
 
 - Returns the mipmap maximum level used for all texture lookups with this texture. - release()¶
 - Unbinds this texture from the currently active texture unit. - See also - release(unit[, reset=QOpenGLTexture.TextureUnitReset.DontResetTextureUnit])
- Parameters:
- unit – int 
- reset – - TextureUnitReset
 
 
 - Unbinds this texture from texture unit - unit.- If parameter - resetis- truethen this function will restore the active unit to the texture unit that was active upon entry.- samples()¶
- Return type:
- int 
 
 - Returns the number of multisample sample points for this texture. If storage has not yet been allocated for this texture then this function returns the requested number of samples. - For texture targets that do not support multisampling this will return 0. - See also - setAutoMipMapGenerationEnabled(enabled)¶
- Parameters:
- enabled – bool 
 
 - If - enabledis- true, enables automatic mipmap generation for this texture object to occur whenever the level 0 mipmap data is set via- setData().- The automatic mipmap generation is enabled by default. - Note - Mipmap generation is not supported for compressed textures with OpenGL ES 2.0. - Sets the border color of the texture to - color.- setBorderColor(r, g, b, a)
- Parameters:
- r – float 
- g – float 
- b – float 
- a – float 
 
 
 - Sets the color red to - r, green to- g, blue to- b, and- ato the alpha value.- setBorderColor(r, g, b, a)
- Parameters:
- r – int 
- g – int 
- b – int 
- a – int 
 
 
 - Sets the color red to - r, green to- g, blue to- b, and the alpha value to- a.- setBorderColor(r, g, b, a)
- Parameters:
- r – int 
- g – int 
- b – int 
- a – int 
 
 
 - Sets the color red to - r, green to- g, blue to- b, and the alpha value to- a.- setComparisonFunction(function)¶
- Parameters:
- function – - ComparisonFunction
 
 - Sets the texture comparison function on this texture to - function. The texture comparison function is used by shadow samplers when sampling a depth texture.- See also - setComparisonMode(mode)¶
- Parameters:
- mode – - ComparisonMode
 
 - Sets the texture comparison mode on this texture to - mode. The texture comparison mode is used by shadow samplers when sampling a depth texture.- See also - setCompressedData(dataSize, data[, options=None])¶
- Parameters:
- dataSize – int 
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setCompressedData(mipLevel, dataSize, data[, options=None])
- Parameters:
- mipLevel – int 
- dataSize – int 
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setCompressedData(mipLevel, layer, dataSize, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- dataSize – int 
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setCompressedData(mipLevel, layer, cubeFace, dataSize, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- cubeFace – - CubeMapFace
- dataSize – int 
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - Uploads compressed pixel - datato- mipLevel, array- layer, and- cubeFace. The pixel transfer can optionally be controlled with- options. The- dataSizeargument should specify the size of the data pointed to by- data.- If not using a compressed - format()then you should use- setData()instead of this function.- setCompressedData(mipLevel, layer, layerCount, cubeFace, dataSize, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- layerCount – int 
- cubeFace – - CubeMapFace
- dataSize – int 
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - Parameter - layerCountis the number of layers in a texture array that are being uploaded/populated by this call.- setData(image[, genMipMaps=QOpenGLTexture.MipMapGeneration.GenerateMipMaps])¶
- Parameters:
- image – - QImage
- genMipMaps – - MipMapGeneration
 
 
 - This overload of - setData()will allocate storage for you. The pixel data is contained in- image. Mipmaps are generated by default. Set- genMipMapsto- DontGenerateMipMapsto turn off mipmap generation.- Note - imageis automatically converted to QImage::Format_RGBA8888 which may have performance implications for large images with a different format.- setData(sourceFormat, sourceType, data[, options=None])
- Parameters:
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setData(mipLevel, sourceFormat, sourceType, data[, options=None])
- Parameters:
- mipLevel – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setData(mipLevel, layer, sourceFormat, sourceType, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - setData(mipLevel, layer, cubeFace, sourceFormat, sourceType, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- cubeFace – - CubeMapFace
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - Uploads pixel - datafor this texture object- mipLevel, array- layer, and- cubeFace. Storage must have been allocated before uploading pixel data. Some overloads of setData() will set appropriate dimensions, mipmap levels, and array layers and then allocate storage for you if they have enough information to do so. This will be noted in the function documentation.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- If using a compressed - format()then you should use- setCompressedData()instead of this function.- See also - setData(mipLevel, layer, layerCount, cubeFace, sourceFormat, sourceType, data[, options=None])
- Parameters:
- mipLevel – int 
- layer – int 
- layerCount – int 
- cubeFace – - CubeMapFace
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - Parameter - layerCountis the number of layers in a texture array that are being uploaded/populated by this call.- setData(xOffset, yOffset, zOffset, width, height, depth, sourceFormat, sourceType, data[, options=None])
- Parameters:
- xOffset – int 
- yOffset – int 
- zOffset – int 
- width – int 
- height – int 
- depth – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - This overload is to be used to update a part of the texture. Parameters - xOffset,- yOffset,- zOffsetspecify the texel offsets within the texture. Parameters- width,- heightand- depthspecify the dimensions of the sub image.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- setData(xOffset, yOffset, zOffset, width, height, depth, mipLevel, sourceFormat, sourceType, data[, options=None])
- Parameters:
- xOffset – int 
- yOffset – int 
- zOffset – int 
- width – int 
- height – int 
- depth – int 
- mipLevel – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - This overload is to be used to update a part of the texture. Parameters - xOffset,- yOffset,- zOffsetspecify the texel offsets within the texture. Parameters- width,- heightand- depthspecify the dimensions of the sub image. The mip map level the sub image we want to update is specified with- mipLevel.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- setData(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, sourceFormat, sourceType, data[, options=None])
- Parameters:
- xOffset – int 
- yOffset – int 
- zOffset – int 
- width – int 
- height – int 
- depth – int 
- mipLevel – int 
- layer – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - This overload is to be used to update a part of the texture. Parameters - xOffset,- yOffset,- zOffsetspecify the texel offsets within the texture. Parameters- width,- heightand- depthspecify the dimensions of the sub image. The mip map level and layerof the sub image we want to update are specified with- mipLeveland- layer.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- setData(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, cubeFace, sourceFormat, sourceType, data[, options=None])
- Parameters:
- xOffset – int 
- yOffset – int 
- zOffset – int 
- width – int 
- height – int 
- depth – int 
- mipLevel – int 
- layer – int 
- cubeFace – - CubeMapFace
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - This overload is to be used to update a part of the texture. Parameters - xOffset,- yOffset,- zOffsetspecify the texel offsets within the texture. Parameters- width,- heightand- depthspecify the dimensions of the sub image.The mip map level, layer and cube map face of the sub image we want to update are specified with- mipLevel,- layerand- face.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- setData(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, cubeFace, layerCount, sourceFormat, sourceType, data[, options=None])
- Parameters:
- xOffset – int 
- yOffset – int 
- zOffset – int 
- width – int 
- height – int 
- depth – int 
- mipLevel – int 
- layer – int 
- cubeFace – - CubeMapFace
- layerCount – int 
- sourceFormat – - PixelFormat
- sourceType – - PixelType
- data – - void
- options – - QOpenGLPixelTransferOptions
 
 
 - This overload is to be used to update a part of the texture. Parameters - xOffset,- yOffset,- zOffsetspecify the texel offsets within the texture. Parameters- width,- heightand- depthspecify the dimensions of the sub image.The mip map level, starting layer, cube map face and number of layers of the sub image we want to update are specified with- mipLevel,- layer,- faceand- layerCount.- The structure of the pixel data pointed to by - datais specified by- sourceFormatand- sourceType. The pixel data upload can optionally be controlled by- options.- setDepthStencilMode(mode)¶
- Parameters:
- mode – - DepthStencilMode
 
 - If using a texture that has a combined depth/stencil format this function sets which component of the texture is accessed to - mode.- When the parameter is set to - DepthMode, then accessing it from the shader will access the depth component as a single float, as normal. But when the parameter is set to- StencilMode, the shader will access the stencil component.- setFixedSamplePositions(fixed)¶
- Parameters:
- fixed – bool 
 
 - Sets whether the sample positions and number of samples used with a multisample capable texture target to - fixed. If set to- truethe sample positions and number of samples used are the same for all texels in the image and will not depend upon the image size or internal format. This function should be called before storage is allocated for the texture.- For targets that do not support multisampling this function has no effect. - The default value is - true.- setFormat(format)¶
- Parameters:
- format – - TextureFormat
 
 - Sets the format of this texture object to - format. This function must be called before texture storage is allocated.- Note that all formats may not be supported. The exact set of supported formats is dependent upon your OpenGL implementation and version. - See also - setLayers(layers)¶
- Parameters:
- layers – int 
 
 - Sets the number of array - layersto allocate storage for. This function should be called before storage is allocated for the texture.- For targets that do not support array layers this function has no effect. - See also - setLevelOfDetailRange(min, max)¶
- Parameters:
- min – float 
- max – float 
 
 
 - Sets the minimum level of detail parameters to - minand the maximum level to- max.- Note - This function has no effect on Qt built for OpenGL ES 2. - setLevelofDetailBias(bias)¶
- Parameters:
- bias – float 
 
 - Sets the level of detail bias to - bias. Level of detail bias affects the point at which mipmapping levels change. Increasing values for level of detail bias makes the overall images blurrier or smoother. Decreasing values make the overall images sharper.- Sets the magnification filter to - filter.- setMaximumAnisotropy(anisotropy)¶
- Parameters:
- anisotropy – float 
 
 - If your OpenGL implementation supports the GL_EXT_texture_filter_anisotropic extension this function sets the maximum anisotropy level to - anisotropy.- See also - setMaximumLevelOfDetail(value)¶
- Parameters:
- value – float 
 
 - Sets the maximum level of detail to - value. This limits the selection of lowest resolution mipmap (highest mipmap level). The default value is 1000.- Note - This function has no effect on Qt built for OpenGL ES 2. - setMinMagFilters(minificationFilter, magnificationFilter)¶
 - Sets the minification filter to - minificationFilterand the magnification filter to- magnificationFilter.- Sets the filter used for minification to - filter.- setMinimumLevelOfDetail(value)¶
- Parameters:
- value – float 
 
 - Sets the minimum level of detail to - value. This limits the selection of highest resolution mipmap (lowest mipmap level). The default value is -1000.- Note - This function has no effect on Qt built for OpenGL ES 2. - setMipBaseLevel(baseLevel)¶
- Parameters:
- baseLevel – int 
 
 - Sets the base mipmap level used for all texture lookups with this texture to - baseLevel.- Note - This function has no effect on Qt built for OpenGL ES 2. - setMipLevelRange(baseLevel, maxLevel)¶
- Parameters:
- baseLevel – int 
- maxLevel – int 
 
 
 - Sets the range of mipmap levels that can be used for texture lookups with this texture to range from - baseLevelto- maxLevel.- Note - This function has no effect on Qt built for OpenGL ES 2. - setMipLevels(levels)¶
- Parameters:
- levels – int 
 
 - For texture targets that support mipmaps, this function sets the requested number of mipmap - levelsto allocate storage for. This function should be called before storage is allocated for the texture.- If the texture target does not support mipmaps this function has no effect. - setMipMaxLevel(maxLevel)¶
- Parameters:
- maxLevel – int 
 
 - Sets the maximum mipmap level used for all texture lookups with this texture to - maxLevel.- Note - This function has no effect on Qt built for OpenGL ES 2. - setSamples(samples)¶
- Parameters:
- samples – int 
 
 - Sets the number of - samplesto allocate storage for when rendering to a multisample capable texture target. This function should be called before storage is allocated for the texture.- For targets that do not support multisampling this function has no effect. - See also - setSize(width[, height=1[, depth=1]])¶
- Parameters:
- width – int 
- height – int 
- depth – int 
 
 
 - Sets the dimensions of this texture object to - width,- height, and- depth. The default for each dimension is 1. The maximum allowable texture size is dependent upon your OpenGL implementation. Allocating storage for a texture less than the maximum size can still fail if your system is low on resources.- If a non-power-of-two - width,- heightor- depthis provided and your OpenGL implementation doesn’t have support for repeating non-power-of-two textures, then the wrap mode is automatically set to- ClampToEdge.- setSwizzleMask(component, value)¶
- Parameters:
- component – - SwizzleComponent
- value – - SwizzleValue
 
 
 - GLSL shaders are able to reorder the components of the vec4 returned by texture functions. It is also desirable to be able to control this reordering from CPU side code. This is made possible by swizzle masks since OpenGL 3.3. - Each component of the texture can be mapped to one of the - SwizzleValueoptions.- This function maps - componentto the output- value.- setSwizzleMask(r, g, b, a)
- Parameters:
- r – - SwizzleValue
- g – - SwizzleValue
- b – - SwizzleValue
- a – - SwizzleValue
 
 
 - Parameters - r,- g,- b, and- aare values used for setting the colors red, green, blue, and the alpha value.- Sets the wrap (or repeat mode) for all texture dimensions to - mode.- See also - setWrapMode(direction, mode)
- Parameters:
- direction – - CoordinateDirection
- mode – - WrapMode
 
 
 - Sets the wrap (or repeat mode) for the texture dimension - directionto- mode.- swizzleMask(component)¶
- Parameters:
- component – - SwizzleComponent
- Return type:
 
 - Returns the swizzle mask for texture - component.- See also - Returns the binding target of this texture. - textureId()¶
- Return type:
- int 
 
 - Returns the name of the underlying OpenGL texture object or 0 if it has not yet been created. - See also - width()¶
- Return type:
- int 
 
 - Returns the width of a 1D, 2D or 3D texture. - wrapMode(direction)¶
- Parameters:
- direction – - CoordinateDirection
- Return type:
 
 - Returns the wrap mode for the texture dimension - direction.- See also