QOpenGLTextureclass encapsulates an OpenGL texture object. 更多 …
New in version 5.2.
def
allocateStorage
()
def
allocateStorage
(pixelFormat, pixelType)
def
bind
()
def
bind
(unit[, reset=DontResetTextureUnit])
def
borderColor
()
def
comparisonFunction
()
def
comparisonMode
()
def
create
()
def
createTextureView
(target, viewFormat, minimumMipmapLevel, maximumMipmapLevel, minimumLayer, maximumLayer)
def
depth
()
def
depthStencilMode
()
def
destroy
()
def
faces
()
def
format
()
def
generateMipMaps
()
def
generateMipMaps
(baseLevel[, resetBaseLevel=true])
def
height
()
def
isBound
()
def
isBound
(unit)
def
isCreated
()
def
isFixedSamplePositions
()
def
isStorageAllocated
()
def
isTextureView
()
def
layers
()
def
levelOfDetailRange
()
def
levelofDetailBias
()
def
magnificationFilter
()
def
maximumAnisotropy
()
def
maximumLevelOfDetail
()
def
maximumMipLevels
()
def
minMagFilters
()
def
minificationFilter
()
def
minimumLevelOfDetail
()
def
mipBaseLevel
()
def
mipLevelRange
()
def
mipLevels
()
def
mipMaxLevel
()
def
release
()
def
release
(unit[, reset=DontResetTextureUnit])
def
samples
()
def
setAutoMipMapGenerationEnabled
(enabled)
def
setBorderColor
(color)
def
setBorderColor
(r, g, b, a)
def
setBorderColor
(r, g, b, a)
def
setBorderColor
(r, g, b, a)
def
setComparisonFunction
(function)
def
setComparisonMode
(mode)
def
setCompressedData
(dataSize, data[, options=None])
def
setCompressedData
(dataSize, data[, options=None])
def
setCompressedData
(mipLevel, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, layer, cubeFace, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, layer, cubeFace, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, layer, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, layer, dataSize, data[, options=None])
def
setCompressedData
(mipLevel, layer, layerCount, cubeFace, dataSize, data[, options=None])
def
setData
(image[, genMipMaps=GenerateMipMaps])
def
setData
(mipLevel, layer, cubeFace, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, layer, cubeFace, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, layer, layerCount, cubeFace, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, layer, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, layer, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, sourceFormat, sourceType, data[, options=None])
def
setData
(mipLevel, sourceFormat, sourceType, data[, options=None])
def
setData
(sourceFormat, sourceType, data[, options=None])
def
setData
(sourceFormat, sourceType, data[, options=None])
def
setData
(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, cubeFace, layerCount, sourceFormat, sourceType, data[, options=None])
def
setData
(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, cubeFace, sourceFormat, sourceType, data[, options=None])
def
setData
(xOffset, yOffset, zOffset, width, height, depth, mipLevel, layer, sourceFormat, sourceType, data[, options=None])
def
setData
(xOffset, yOffset, zOffset, width, height, depth, sourceFormat, sourceType, data[, options=None])
def
setDepthStencilMode
(mode)
def
setFixedSamplePositions
(fixed)
def
setFormat
(format)
def
setLayers
(layers)
def
setLevelOfDetailRange
(min, max)
def
setLevelofDetailBias
(bias)
def
setMagnificationFilter
(filter)
def
setMaximumAnisotropy
(anisotropy)
def
setMaximumLevelOfDetail
(value)
def
setMinMagFilters
(minificationFilter, magnificationFilter)
def
setMinificationFilter
(filter)
def
setMinimumLevelOfDetail
(value)
def
setMipBaseLevel
(baseLevel)
def
setMipLevelRange
(baseLevel, maxLevel)
def
setMipLevels
(levels)
def
setMipMaxLevel
(maxLevel)
def
setSamples
(samples)
def
setSize
(width[, height=1[, depth=1]])
def
setSwizzleMask
(component, value)
def
setSwizzleMask
(r, g, b, a)
def
setWrapMode
(direction, mode)
def
setWrapMode
(mode)
def
swizzleMask
(component)
def
target
()
def
textureId
()
def
width
()
def
wrapMode
(direction)
def
boundTextureId
(target)
def
boundTextureId
(unit, target)
def
hasFeature
(feature)
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
QImageas 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(...);注意:
QImageis mirrored vertically to account for the fact that OpenGL andQImageuse opposite directions for the y axis. Another option would be to transform your texture coordinates.
QOpenGLTexture
(
target
)
¶
QOpenGLTexture(image[, genMipMaps=GenerateMipMaps])
- param image
- param target
Target- param genMipMaps
MipMapGeneration
创建
QOpenGLTexture
object 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.
创建
QOpenGLTexture
object 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
genMipMaps
to
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.
PySide2.QtGui.QOpenGLTexture.
Target
¶
This enum defines the texture target of a
QOpenGLTexture
object. For more information on creating array textures, see Array Texture.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.Target1D |
A 1-dimensional texture. Equivalent to GL_TEXTURE_1D. |
|
QOpenGLTexture.Target1DArray |
An array of 1-dimensional textures. Equivalent to GL_TEXTURE_1D_ARRAY |
|
QOpenGLTexture.Target2D |
A 2-dimensional texture. Equivalent to GL_TEXTURE_2D |
|
QOpenGLTexture.Target2DArray |
An array of 2-dimensional textures. Equivalent to GL_TEXTURE_2D_ARRAY |
|
QOpenGLTexture.Target3D |
A 3-dimensional texture. Equivalent to GL_TEXTURE_3D |
|
QOpenGLTexture.TargetCubeMap |
A cubemap texture. Equivalent to GL_TEXTURE_CUBE_MAP |
|
QOpenGLTexture.TargetCubeMapArray |
An array of cubemap textures. Equivalent to GL_TEXTURE_CUBE_MAP_ARRAY |
|
QOpenGLTexture.Target2DMultisample |
A 2-dimensional texture with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE |
|
QOpenGLTexture.Target2DMultisampleArray |
An array of 2-dimensional textures with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE_ARRAY |
|
QOpenGLTexture.TargetRectangle |
A rectangular 2-dimensional texture. Equivalent to GL_TEXTURE_RECTANGLE |
|
QOpenGLTexture.TargetBuffer |
A texture with data from an OpenGL buffer object. Equivalent to GL_TEXTURE_BUFFER |
PySide2.QtGui.QOpenGLTexture.
BindingTarget
¶
此枚举定义纹理单元的可能绑定目标。
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.BindingTarget1D |
相当于 GL_TEXTURE_BINDING_1D |
|
QOpenGLTexture.BindingTarget1DArray |
相当于 GL_TEXTURE_BINDING_1D_ARRAY |
|
QOpenGLTexture.BindingTarget2D |
相当于 GL_TEXTURE_BINDING_2D |
|
QOpenGLTexture.BindingTarget2DArray |
相当于 GL_TEXTURE_BINDING_2D_ARRAY |
|
QOpenGLTexture.BindingTarget3D |
相当于 GL_TEXTURE_BINDING_3D |
|
QOpenGLTexture.BindingTargetCubeMap |
相当于 GL_TEXTURE_BINDING_CUBE_MAP |
|
QOpenGLTexture.BindingTargetCubeMapArray |
相当于 GL_TEXTURE_BINDING_CUBE_MAP_ARRAY |
|
QOpenGLTexture.BindingTarget2DMultisample |
相当于 GL_TEXTURE_BINDING_2D_MULTISAMPLE |
|
QOpenGLTexture.BindingTarget2DMultisampleArray |
相当于 GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY |
|
QOpenGLTexture.BindingTargetRectangle |
相当于 GL_TEXTURE_BINDING_RECTANGLE |
|
QOpenGLTexture.BindingTargetBuffer |
相当于 GL_TEXTURE_BINDING_BUFFER |
PySide2.QtGui.QOpenGLTexture.
MipMapGeneration
¶
This enum defines the options to control mipmap generation.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.GenerateMipMaps |
Mipmaps should be generated |
|
QOpenGLTexture.DontGenerateMipMaps |
Mipmaps should not be generated |
PySide2.QtGui.QOpenGLTexture.
TextureUnitReset
¶
This enum defines options ot control texture unit activation.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.ResetTextureUnit |
The previous active texture unit will be reset |
|
QOpenGLTexture.DontResetTextureUnit |
The previous active texture unit will not be rest |
PySide2.QtGui.QOpenGLTexture.
TextureFormat
¶
This enum defines the possible texture formats. Depending upon your OpenGL implementation only a subset of these may be supported.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.NoFormat |
Equivalent to GL_NONE |
|
QOpenGLTexture.R8_UNorm |
Equivalent to GL_R8 |
|
QOpenGLTexture.RG8_UNorm |
Equivalent to GL_RG8 |
|
QOpenGLTexture.RGB8_UNorm |
Equivalent to GL_RGB8 |
|
QOpenGLTexture.RGBA8_UNorm |
Equivalent to GL_RGBA8 |
|
QOpenGLTexture.R16_UNorm |
Equivalent to GL_R16 |
|
QOpenGLTexture.RG16_UNorm |
Equivalent to GL_RG16 |
|
QOpenGLTexture.RGB16_UNorm |
Equivalent to GL_RGB16 |
|
QOpenGLTexture.RGBA16_UNorm |
Equivalent to GL_RGBA16 |
|
QOpenGLTexture.R8_SNorm |
Equivalent to GL_R8_SNORM |
|
QOpenGLTexture.RG8_SNorm |
Equivalent to GL_RG8_SNORM |
|
QOpenGLTexture.RGB8_SNorm |
Equivalent to GL_RGB8_SNORM |
|
QOpenGLTexture.RGBA8_SNorm |
Equivalent to GL_RGBA8_SNORM |
|
QOpenGLTexture.R16_SNorm |
Equivalent to GL_R16_SNORM |
|
QOpenGLTexture.RG16_SNorm |
Equivalent to GL_RG16_SNORM |
|
QOpenGLTexture.RGB16_SNorm |
Equivalent to GL_RGB16_SNORM |
|
QOpenGLTexture.RGBA16_SNorm |
Equivalent to GL_RGBA16_SNORM |
|
QOpenGLTexture.R8U |
Equivalent to GL_R8UI |
|
QOpenGLTexture.RG8U |
Equivalent to GL_RG8UI |
|
QOpenGLTexture.RGB8U |
Equivalent to GL_RGB8UI |
|
QOpenGLTexture.RGBA8U |
Equivalent to GL_RGBA8UI |
|
QOpenGLTexture.R16U |
Equivalent to GL_R16UI |
|
QOpenGLTexture.RG16U |
Equivalent to GL_RG16UI |
|
QOpenGLTexture.RGB16U |
Equivalent to GL_RGB16UI |
|
QOpenGLTexture.RGBA16U |
Equivalent to GL_RGBA16UI |
|
QOpenGLTexture.R32U |
Equivalent to GL_R32UI |
|
QOpenGLTexture.RG32U |
Equivalent to GL_RG32UI |
|
QOpenGLTexture.RGB32U |
Equivalent to GL_RGB32UI |
|
QOpenGLTexture.RGBA32U |
Equivalent to GL_RGBA32UI |
|
QOpenGLTexture.R8I |
Equivalent to GL_R8I |
|
QOpenGLTexture.RG8I |
Equivalent to GL_RG8I |
|
QOpenGLTexture.RGB8I |
Equivalent to GL_RGB8I |
|
QOpenGLTexture.RGBA8I |
Equivalent to GL_RGBA8I |
|
QOpenGLTexture.R16I |
Equivalent to GL_R16I |
|
QOpenGLTexture.RG16I |
Equivalent to GL_RG16I |
|
QOpenGLTexture.RGB16I |
Equivalent to GL_RGB16I |
|
QOpenGLTexture.RGBA16I |
Equivalent to GL_RGBA16I |
|
QOpenGLTexture.R32I |
Equivalent to GL_R32I |
|
QOpenGLTexture.RG32I |
Equivalent to GL_RG32I |
|
QOpenGLTexture.RGB32I |
Equivalent to GL_RGB32I |
|
QOpenGLTexture.RGBA32I |
Equivalent to GL_RGBA32I |
|
QOpenGLTexture.R16F |
Equivalent to GL_R16F |
|
QOpenGLTexture.RG16F |
Equivalent to GL_RG16F |
|
QOpenGLTexture.RGB16F |
Equivalent to GL_RGB16F |
|
QOpenGLTexture.RGBA16F |
Equivalent to GL_RGBA16F |
|
QOpenGLTexture.R32F |
Equivalent to GL_R32F |
|
QOpenGLTexture.RG32F |
Equivalent to GL_RG32F |
|
QOpenGLTexture.RGB32F |
Equivalent to GL_RGB32F |
|
QOpenGLTexture.RGBA32F |
Equivalent to GL_RGBA32F |
|
QOpenGLTexture.RGB9E5 |
Equivalent to GL_RGB9_E5 |
|
QOpenGLTexture.RG11B10F |
Equivalent to GL_R11F_G11F_B10F |
|
QOpenGLTexture.RG3B2 |
Equivalent to GL_R3_G3_B2 |
|
QOpenGLTexture.R5G6B5 |
Equivalent to GL_RGB565 |
|
QOpenGLTexture.RGB5A1 |
Equivalent to GL_RGB5_A1 |
|
QOpenGLTexture.RGBA4 |
Equivalent to GL_RGBA4 |
|
QOpenGLTexture.RGB10A2 |
Equivalent to GL_RGB10_A2UI |
|
QOpenGLTexture.D16 |
Equivalent to GL_DEPTH_COMPONENT16 |
|
QOpenGLTexture.D24 |
Equivalent to GL_DEPTH_COMPONENT24 |
|
QOpenGLTexture.D24S8 |
Equivalent to GL_DEPTH24_STENCIL8 |
|
QOpenGLTexture.D32 |
Equivalent to GL_DEPTH_COMPONENT32 |
|
QOpenGLTexture.D32F |
Equivalent to GL_DEPTH_COMPONENT32F |
|
QOpenGLTexture.D32FS8X24 |
Equivalent to GL_DEPTH32F_STENCIL8 |
|
QOpenGLTexture.S8 |
Equivalent to GL_STENCIL_INDEX8. Introduced in Qt 5.4 |
|
QOpenGLTexture.RGB_DXT1 |
Equivalent to GL_COMPRESSED_RGB_S3TC_DXT1_EXT |
|
QOpenGLTexture.RGBA_DXT1 |
Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT1_EXT |
|
QOpenGLTexture.RGBA_DXT3 |
Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT3_EXT |
|
QOpenGLTexture.RGBA_DXT5 |
Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT5_EXT |
|
QOpenGLTexture.R_ATI1N_UNorm |
Equivalent to GL_COMPRESSED_RED_RGTC1 |
|
QOpenGLTexture.R_ATI1N_SNorm |
Equivalent to GL_COMPRESSED_SIGNED_RED_RGTC1 |
|
QOpenGLTexture.RG_ATI2N_UNorm |
Equivalent to GL_COMPRESSED_RG_RGTC2 |
|
QOpenGLTexture.RG_ATI2N_SNorm |
Equivalent to GL_COMPRESSED_SIGNED_RG_RGTC2 |
|
QOpenGLTexture.RGB_BP_UNSIGNED_FLOAT |
Equivalent to GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB |
|
QOpenGLTexture.RGB_BP_SIGNED_FLOAT |
Equivalent to GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB |
|
QOpenGLTexture.RGB_BP_UNorm |
Equivalent to GL_COMPRESSED_RGBA_BPTC_UNORM_ARB |
|
QOpenGLTexture.R11_EAC_UNorm |
Equivalent to GL_COMPRESSED_R11_EAC |
|
QOpenGLTexture.R11_EAC_SNorm |
Equivalent to GL_COMPRESSED_SIGNED_R11_EAC |
|
QOpenGLTexture.RG11_EAC_UNorm |
Equivalent to GL_COMPRESSED_RG11_EAC |
|
QOpenGLTexture.RG11_EAC_SNorm |
Equivalent to GL_COMPRESSED_SIGNED_RG11_EAC |
|
QOpenGLTexture.RGB8_ETC2 |
Equivalent to GL_COMPRESSED_RGB8_ETC2 |
|
QOpenGLTexture.SRGB8_ETC2 |
Equivalent to GL_COMPRESSED_SRGB8_ETC2 |
|
QOpenGLTexture.RGB8_PunchThrough_Alpha1_ETC2 |
Equivalent to GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 |
|
QOpenGLTexture.SRGB8_PunchThrough_Alpha1_ETC2 |
Equivalent to GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 |
|
QOpenGLTexture.RGBA8_ETC2_EAC |
Equivalent to GL_COMPRESSED_RGBA8_ETC2_EAC |
|
QOpenGLTexture.SRGB8_Alpha8_ETC2_EAC |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC |
|
QOpenGLTexture.RGB8_ETC1 |
Equivalent to GL_ETC1_RGB8_OES |
|
QOpenGLTexture.RGBA_ASTC_4x4 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_4x4_KHR |
|
QOpenGLTexture.RGBA_ASTC_5x4 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_5x4_KHR |
|
QOpenGLTexture.RGBA_ASTC_5x5 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_5x5_KHR |
|
QOpenGLTexture.RGBA_ASTC_6x5 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_6x5_KHR |
|
QOpenGLTexture.RGBA_ASTC_6x6 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_6x6_KHR |
|
QOpenGLTexture.RGBA_ASTC_8x5 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_8x5_KHR |
|
QOpenGLTexture.RGBA_ASTC_8x6 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_8x6_KHR |
|
QOpenGLTexture.RGBA_ASTC_8x8 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_8x8_KHR |
|
QOpenGLTexture.RGBA_ASTC_10x5 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_10x5_KHR |
|
QOpenGLTexture.RGBA_ASTC_10x6 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_10x6_KHR |
|
QOpenGLTexture.RGBA_ASTC_10x8 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_10x8_KHR |
|
QOpenGLTexture.RGBA_ASTC_10x10 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_10x10_KHR |
|
QOpenGLTexture.RGBA_ASTC_12x10 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_12x10_KHR |
|
QOpenGLTexture.RGBA_ASTC_12x12 |
Equivalent to GL_COMPRESSED_RGBA_ASTC_12x12_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_4x4 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_5x4 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_5x5 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_6x5 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_6x6 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_8x5 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_8x6 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_8x8 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_10x5 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_10x6 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_10x8 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_10x10 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_12x10 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR |
|
QOpenGLTexture.SRGB8_Alpha8_ASTC_12x12 |
Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR |
|
QOpenGLTexture.SRGB8 |
Equivalent to GL_SRGB8 |
|
QOpenGLTexture.SRGB8_Alpha8 |
Equivalent to GL_SRGB8_ALPHA8 |
|
QOpenGLTexture.SRGB_DXT1 |
Equivalent to GL_COMPRESSED_SRGB_S3TC_DXT1_EXT |
|
QOpenGLTexture.SRGB_Alpha_DXT1 |
Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT |
|
QOpenGLTexture.SRGB_Alpha_DXT3 |
Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT |
|
QOpenGLTexture.SRGB_Alpha_DXT5 |
Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT |
|
QOpenGLTexture.SRGB_BP_UNorm |
Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB |
|
QOpenGLTexture.DepthFormat |
Equivalent to GL_DEPTH_COMPONENT (only OpenGL ES 3 or ES 2 with OES_depth_texture) |
|
QOpenGLTexture.AlphaFormat |
Equivalent to GL_ALPHA (OpenGL ES 2 only) |
|
QOpenGLTexture.RGBFormat |
Equivalent to GL_RGB (OpenGL ES 2 only) |
|
QOpenGLTexture.RGBAFormat |
Equivalent to GL_RGBA (OpenGL ES 2 only) |
|
QOpenGLTexture.LuminanceFormat |
Equivalent to GL_LUMINANCE (OpenGL ES 2 only) |
|
QOpenGLTexture.LuminanceAlphaFormat |
Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only) |
PySide2.QtGui.QOpenGLTexture.
TextureFormatClass
¶
PySide2.QtGui.QOpenGLTexture.
CubeMapFace
¶
This enum defines the possible CubeMap faces.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.CubeMapPositiveX |
Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_X |
|
QOpenGLTexture.CubeMapNegativeX |
Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_X |
|
QOpenGLTexture.CubeMapPositiveY |
Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Y |
|
QOpenGLTexture.CubeMapNegativeY |
Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Y |
|
QOpenGLTexture.CubeMapPositiveZ |
Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Z |
|
QOpenGLTexture.CubeMapNegativeZ |
Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Z |
PySide2.QtGui.QOpenGLTexture.
PixelFormat
¶
This enum defines the possible client-side pixel formats for a pixel transfer operation.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.NoSourceFormat |
Equivalent to GL_NONE |
|
QOpenGLTexture.Red |
Equivalent to GL_RED |
|
QOpenGLTexture.RG |
Equivalent to GL_RG |
|
QOpenGLTexture.RGB |
Equivalent to GL_RGB |
|
QOpenGLTexture.BGR |
Equivalent to GL_BGR |
|
QOpenGLTexture.RGBA |
Equivalent to GL_RGBA |
|
QOpenGLTexture.BGRA |
Equivalent to GL_BGRA |
|
QOpenGLTexture.Red_Integer |
Equivalent to GL_RED_INTEGER |
|
QOpenGLTexture.RG_Integer |
Equivalent to GL_RG_INTEGER |
|
QOpenGLTexture.RGB_Integer |
Equivalent to GL_RGB_INTEGER |
|
QOpenGLTexture.BGR_Integer |
Equivalent to GL_BGR_INTEGER |
|
QOpenGLTexture.RGBA_Integer |
Equivalent to GL_RGBA_INTEGER |
|
QOpenGLTexture.BGRA_Integer |
Equivalent to GL_BGRA_INTEGER |
|
QOpenGLTexture.Stencil |
Equivalent to GL_STENCIL_INDEX. Introduced in Qt 5.4 |
|
QOpenGLTexture.Depth |
Equivalent to GL_DEPTH_COMPONENT |
|
QOpenGLTexture.DepthStencil |
Equivalent to GL_DEPTH_STENCIL |
|
QOpenGLTexture.Alpha |
Equivalent to GL_ALPHA (OpenGL ES 2 only) |
|
QOpenGLTexture.Luminance |
Equivalent to GL_LUMINANCE (OpenGL ES 2 only) |
|
QOpenGLTexture.LuminanceAlpha |
Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only) |
PySide2.QtGui.QOpenGLTexture.
PixelType
¶
This enum defines the possible pixel data types for a pixel transfer operation
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.NoPixelType |
Equivalent to GL_NONE |
|
QOpenGLTexture.Int8 |
Equivalent to GL_BYTE |
|
QOpenGLTexture.UInt8 |
Equivalent to GL_UNSIGNED_BYTE |
|
QOpenGLTexture.Int16 |
Equivalent to GL_SHORT |
|
QOpenGLTexture.UInt16 |
Equivalent to GL_UNSIGNED_SHORT |
|
QOpenGLTexture.Int32 |
Equivalent to GL_INT |
|
QOpenGLTexture.UInt32 |
Equivalent to GL_UNSIGNED_INT |
|
QOpenGLTexture.Float16 |
Equivalent to GL_HALF_FLOAT |
|
QOpenGLTexture.Float16OES |
Equivalent to GL_HALF_FLOAT_OES |
|
QOpenGLTexture.Float32 |
Equivalent to GL_FLOAT |
|
QOpenGLTexture.UInt32_RGB9_E5 |
Equivalent to GL_UNSIGNED_INT_5_9_9_9_REV |
|
QOpenGLTexture.UInt32_RG11B10F |
Equivalent to GL_UNSIGNED_INT_10F_11F_11F_REV |
|
QOpenGLTexture.UInt8_RG3B2 |
Equivalent to GL_UNSIGNED_BYTE_3_3_2 |
|
QOpenGLTexture.UInt8_RG3B2_Rev |
Equivalent to GL_UNSIGNED_BYTE_2_3_3_REV |
|
QOpenGLTexture.UInt16_RGB5A1 |
Equivalent to GL_UNSIGNED_SHORT_5_5_5_1 |
|
QOpenGLTexture.UInt16_RGB5A1_Rev |
Equivalent to GL_UNSIGNED_SHORT_1_5_5_5_REV |
|
QOpenGLTexture.UInt16_R5G6B5 |
Equivalent to GL_UNSIGNED_SHORT_5_6_5 |
|
QOpenGLTexture.UInt16_R5G6B5_Rev |
Equivalent to GL_UNSIGNED_SHORT_5_6_5_REV |
|
QOpenGLTexture.UInt16_RGBA4 |
Equivalent to GL_UNSIGNED_SHORT_4_4_4_4 |
|
QOpenGLTexture.UInt16_RGBA4_Rev |
Equivalent to GL_UNSIGNED_SHORT_4_4_4_4_REV |
|
QOpenGLTexture.UInt32_RGBA8 |
Equivalent to GL_UNSIGNED_INT_8_8_8_8 |
|
QOpenGLTexture.UInt32_RGBA8_Rev |
Equivalent to GL_UNSIGNED_INT_8_8_8_8_REV |
|
QOpenGLTexture.UInt32_RGB10A2 |
Equivalent to GL_UNSIGNED_INT_10_10_10_2 |
|
QOpenGLTexture.UInt32_RGB10A2_Rev |
Equivalent to GL_UNSIGNED_INT_2_10_10_10_REV |
|
QOpenGLTexture.UInt32_D24S8 |
Equivalent to GL_UNSIGNED_INT_24_8. Introduced in Qt 5.4 |
|
QOpenGLTexture.Float32_D32_UInt32_S8_X24 |
Equivalent to GL_FLOAT_32_UNSIGNED_INT_24_8_REV. Introduced in Qt 5.4 |
PySide2.QtGui.QOpenGLTexture.
SwizzleComponent
¶
This enum defines the texture color components that can be assigned a swizzle mask.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.SwizzleRed |
The red component. Equivalent to GL_TEXTURE_SWIZZLE_R |
|
QOpenGLTexture.SwizzleGreen |
The green component. Equivalent to GL_TEXTURE_SWIZZLE_G |
|
QOpenGLTexture.SwizzleBlue |
The blue component. Equivalent to GL_TEXTURE_SWIZZLE_B |
|
QOpenGLTexture.SwizzleAlpha |
The alpha component. Equivalent to GL_TEXTURE_SWIZZLE_A |
PySide2.QtGui.QOpenGLTexture.
SwizzleValue
¶
This enum defines the possible mask values for texture swizzling.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.RedValue |
Maps the component to the red channel. Equivalent to GL_RED |
|
QOpenGLTexture.GreenValue |
Maps the component to the green channel. Equivalent to GL_GREEN |
|
QOpenGLTexture.BlueValue |
Maps the component to the blue channel. Equivalent to GL_BLUE |
|
QOpenGLTexture.AlphaValue |
Maps the component to the alpha channel. Equivalent to GL_ALPHA |
|
QOpenGLTexture.ZeroValue |
Maps the component to a fixed value of 0. Equivalent to GL_ZERO |
|
QOpenGLTexture.OneValue |
Maps the component to a fixed value of 1. Equivalent to GL_ONE |
PySide2.QtGui.QOpenGLTexture.
WrapMode
¶
This enum defines the possible texture coordinate wrapping modes.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.Repeat |
Texture coordinate is repeated. Equivalent to GL_REPEAT |
|
QOpenGLTexture.MirroredRepeat |
Texture coordinate is reflected about 0 and 1. Equivalent to GL_MIRRORED_REPEAT |
|
QOpenGLTexture.ClampToEdge |
Clamps the texture coordinates to [0,1]. Equivalent to GL_CLAMP_TO_EDGE |
|
QOpenGLTexture.ClampToBorder |
As for but also blends samples at 0 and 1 with a fixed border color. Equivalent to GL_CLAMP_TO_BORDER |
PySide2.QtGui.QOpenGLTexture.
CoordinateDirection
¶
此枚举定义可能的纹理坐标方向
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.DirectionS |
The horizontal direction. Equivalent to GL_TEXTURE_WRAP_S |
|
QOpenGLTexture.DirectionT |
The vertical direction. Equivalent to GL_TEXTURE_WRAP_T |
|
QOpenGLTexture.DirectionR |
The depth direction. Equivalent to GL_TEXTURE_WRAP_R |
PySide2.QtGui.QOpenGLTexture.
Feature
¶
This enum defines the OpenGL texture-related features that can be tested for.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.ImmutableStorage |
Support for immutable texture storage |
|
QOpenGLTexture.ImmutableMultisampleStorage |
Support for immutable texture storage with multisample targets |
|
QOpenGLTexture.TextureRectangle |
Support for the GL_TEXTURE_RECTANGLE target |
|
QOpenGLTexture.TextureArrays |
Support for texture targets with array layers |
|
QOpenGLTexture.Texture3D |
Support for the 3 dimensional texture target |
|
QOpenGLTexture.TextureMultisample |
Support for texture targets that have multisample capabilities |
|
QOpenGLTexture.TextureBuffer |
Support for textures that use OpenGL buffer objects as their data source |
|
QOpenGLTexture.TextureCubeMapArrays |
Support for cubemap array texture target |
|
QOpenGLTexture.Swizzle |
Support for texture component swizzle masks |
|
QOpenGLTexture.StencilTexturing |
Support for stencil texturing (i.e. looking up depth or stencil components of a combined depth/stencil format texture in GLSL shaders). |
|
QOpenGLTexture.AnisotropicFiltering |
Support for anisotropic texture filtering |
|
QOpenGLTexture.NPOTTextures |
Basic support for non-power-of-two textures |
|
QOpenGLTexture.NPOTTextureRepeat |
Full support for non-power-of-two textures including texture repeat modes |
|
QOpenGLTexture.Texture1D |
Support for the 1 dimensional texture target |
|
QOpenGLTexture.TextureComparisonOperators |
Support for texture comparison operators |
|
QOpenGLTexture.TextureMipMapLevel |
Support for setting the base and maximum mipmap levels |
PySide2.QtGui.QOpenGLTexture.
DepthStencilMode
¶
This enum specifies which component of a depth/stencil texture is accessed when the texture is sampled.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.DepthMode |
Equivalent to GL_DEPTH_COMPONENT. |
|
QOpenGLTexture.StencilMode |
Equivalent to GL_STENCIL_INDEX. |
PySide2.QtGui.QOpenGLTexture.
ComparisonFunction
¶
This enum specifies which comparison operator is used when texture comparison is enabled on this texture.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.CompareLessEqual |
相当于 GL_LEQUAL。 |
|
QOpenGLTexture.CompareGreaterEqual |
相当于 GL_GEQUAL。 |
|
QOpenGLTexture.CompareLess |
相当于 GL_LESS。 |
|
QOpenGLTexture.CompareGreater |
相当于 GL_GREATER。 |
|
QOpenGLTexture.CompareEqual |
相当于 GL_EQUAL。 |
|
QOpenGLTexture.CommpareNotEqual |
相当于 GL_NOTEQUAL。 |
|
QOpenGLTexture.CompareAlways |
相当于 GL_ALWAYS。 |
|
QOpenGLTexture.CompareNever |
相当于 GL_NEVER。 |
PySide2.QtGui.QOpenGLTexture.
ComparisonMode
¶
This enum specifies which comparison mode is used when sampling this texture.
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.CompareRefToTexture |
相当于 GL_COMPARE_REF_TO_TEXTURE。 |
|
QOpenGLTexture.CompareNone |
相当于 GL_NONE。 |
PySide2.QtGui.QOpenGLTexture.
Filter
¶
This enum defines the filtering parameters for a
QOpenGLTexture
对象。
|
常量 |
描述 |
|---|---|
|
QOpenGLTexture.Nearest |
Equivalent to GL_NEAREST |
|
QOpenGLTexture.Linear |
Equivalent to GL_LINEAR |
|
QOpenGLTexture.NearestMipMapNearest |
Equivalent to GL_NEAREST_MIPMAP_NEAREST |
|
QOpenGLTexture.NearestMipMapLinear |
Equivalent to GL_NEAREST_MIPMAP_LINEAR |
|
QOpenGLTexture.LinearMipMapNearest |
Equivalent to GL_LINEAR_MIPMAP_NEAREST |
|
QOpenGLTexture.LinearMipMapLinear |
Equivalent to GL_LINEAR_MIPMAP_LINEAR |
PySide2.QtGui.QOpenGLTexture.
allocateStorage
(
pixelFormat
,
pixelType
)
¶
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
QOpenGLTexture
makes use of immutable texture storage. However, if immutable texture storage is not available, then the specified
pixelFormat
and
pixelType
will 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()
调用。
Once storage has been allocated for the texture then pixel data can be uploaded via one of the
setData()
overloads.
PySide2.QtGui.QOpenGLTexture.
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
QOpenGLTexture
makes 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.
注意
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 overload to specify exactly the pixel format and the pixel type to use when allocating mutable storage; this is particulary 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()
调用。
PySide2.QtGui.QOpenGLTexture.
bind
(
)
¶
Binds this texture to the currently active texture unit ready for rendering. Note that you do not need to bind
QOpenGLTexture
objects 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.
另请参阅
PySide2.QtGui.QOpenGLTexture.
bind
(
unit
[
,
reset=DontResetTextureUnit
]
)
¶
unit
–
uint
reset
–
TextureUnitReset
Binds this texture to texture unit
unit
ready for rendering. Note that you do not need to bind
QOpenGLTexture
objects 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
reset
is
true
then this function will restore the active unit to the texture unit that was active upon entry.
另请参阅
PySide2.QtGui.QOpenGLTexture.
borderColor
(
)
¶
Returns the of this texture.
另请参阅
PySide2.QtGui.QOpenGLTexture.
boundTextureId
(
target
)
¶
target
–
BindingTarget
GLuint
返回
textureId
of the texture that is bound to the
target
of the currently active texture unit.
PySide2.QtGui.QOpenGLTexture.
boundTextureId
(
unit
,
target
)
¶
unit
–
uint
target
–
BindingTarget
GLuint
返回
textureId
of the texture that is bound to the
target
of the texture unit
unit
.
PySide2.QtGui.QOpenGLTexture.
comparisonFunction
(
)
¶
Returns the texture comparison operator set on this texture. By default, a texture has a
CompareLessEqual
comparison function.
PySide2.QtGui.QOpenGLTexture.
comparisonMode
(
)
¶
Returns the texture comparison mode set on this texture. By default, a texture has a
CompareNone
comparison mode (i.e. comparisons are disabled).
另请参阅
PySide2.QtGui.QOpenGLTexture.
create
(
)
¶
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 on your behalf.
返回
true
if the creation succeeded, otherwise returns
false
.
PySide2.QtGui.QOpenGLTexture.
createTextureView
(
target
,
viewFormat
,
minimumMipmapLevel
,
maximumMipmapLevel
,
minimumLayer
,
maximumLayer
)
¶
target
–
Target
viewFormat
–
TextureFormat
minimumMipmapLevel
–
int
maximumMipmapLevel
–
int
minimumLayer
–
int
maximumLayer
–
int
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, insted 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 .
target
argument 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
Target1DArray
texture can specify either
Target1DArray
or
Target1D
but for the latter the number of array layers specified with
minimumLayer
and
maximumLayer
must be exactly 1.
Simpliar constraints apply for the
viewFormat
. See the above link and the specification for more details.
minimumMipmapLevel
,
maximumMipmapLevel
,
minimumLayer
,和
maximumLayer
arguments 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
QOpenGLTexture
object that will return
true
从其
isTextureView()
函数。
另请参阅
PySide2.QtGui.QOpenGLTexture.
depth
(
)
¶
int
Returns the depth of a 3D texture.
PySide2.QtGui.QOpenGLTexture.
depthStencilMode
(
)
¶
Returns the depth stencil mode for textures using a combined depth/stencil format.
PySide2.QtGui.QOpenGLTexture.
destroy
(
)
¶
Destroys the underlying OpenGL texture object. This requires a current valid OpenGL context.
PySide2.QtGui.QOpenGLTexture.
faces
(
)
¶
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.
PySide2.QtGui.QOpenGLTexture.
format
(
)
¶
Returns the format of this texture object.
另请参阅
PySide2.QtGui.QOpenGLTexture.
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.
注意
Mipmap generation is not supported for compressed textures with OpenGL ES.
PySide2.QtGui.QOpenGLTexture.
generateMipMaps
(
baseLevel
[
,
resetBaseLevel=true
]
)
¶
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
baseLevel
is achieved by setting the mipmap base level to
baseLevel
and then generating the mipmap chain. If
resetBaseLevel
is
true
, then the baseLevel of the texture will be reset to its previous value.
PySide2.QtGui.QOpenGLTexture.
hasFeature
(
feature
)
¶
feature
–
Feature
bool
返回
true
if your OpenGL implementation and version supports the texture feature
feature
.
PySide2.QtGui.QOpenGLTexture.
height
(
)
¶
int
Returns the height of a 2D or 3D texture.
PySide2.QtGui.QOpenGLTexture.
isAutoMipMapGenerationEnabled
(
)
¶
bool
Returns whether auto mipmap generation is enabled for this texture object.
PySide2.QtGui.QOpenGLTexture.
isBound
(
)
¶
bool
返回
true
if this texture is bound to the corresponding target of the currently active texture unit.
PySide2.QtGui.QOpenGLTexture.
isBound
(
unit
)
¶
unit
–
uint
bool
返回
true
if this texture is bound to the corresponding target of texture unit
unit
.
PySide2.QtGui.QOpenGLTexture.
isCreated
(
)
¶
bool
返回
true
if the underlying OpenGL texture object has been created.
另请参阅
PySide2.QtGui.QOpenGLTexture.
isFixedSamplePositions
(
)
¶
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
.
PySide2.QtGui.QOpenGLTexture.
isStorageAllocated
(
)
¶
bool
返回
true
if 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.
PySide2.QtGui.QOpenGLTexture.
isTextureView
(
)
¶
bool
返回
true
if this texture object is actually a view onto another texture object.
另请参阅
PySide2.QtGui.QOpenGLTexture.
layers
(
)
¶
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.
PySide2.QtGui.QOpenGLTexture.
levelOfDetailRange
(
)
¶
Returns the minimum and maximum level of detail parameters.
PySide2.QtGui.QOpenGLTexture.
levelofDetailBias
(
)
¶
float
Returns the level of detail bias parameter.
PySide2.QtGui.QOpenGLTexture.
magnificationFilter
(
)
¶
Returns the magnification filter.
PySide2.QtGui.QOpenGLTexture.
maximumAnisotropy
(
)
¶
float
Returns the maximum level of anisotropy to be accounted for when performing texture lookups. This requires the GL_EXT_texture_filter_anisotropic extension.
PySide2.QtGui.QOpenGLTexture.
maximumLevelOfDetail
(
)
¶
float
Returns the maximum level of detail parameter.
PySide2.QtGui.QOpenGLTexture.
maximumMipLevels
(
)
¶
int
Returns the maximum number of mipmap levels that this texture can have given the current dimensions.
PySide2.QtGui.QOpenGLTexture.
minMagFilters
(
)
¶
Returns the current minification and magnification filters.
另请参阅
PySide2.QtGui.QOpenGLTexture.
minimumLevelOfDetail
(
)
¶
float
Returns the minimum level of detail parameter.
PySide2.QtGui.QOpenGLTexture.
mipBaseLevel
(
)
¶
int
Returns the mipmap base level used for all texture lookups with this texture. The default is 0.
PySide2.QtGui.QOpenGLTexture.
mipLevelRange
(
)
¶
Returns the range of mipmap levels that can be used for texture lookups with this texture.
PySide2.QtGui.QOpenGLTexture.
mipLevels
(
)
¶
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.
PySide2.QtGui.QOpenGLTexture.
mipMaxLevel
(
)
¶
int
Returns the mipmap maximum level used for all texture lookups with this texture.
PySide2.QtGui.QOpenGLTexture.
release
(
)
¶
Unbinds this texture from the currently active texture unit.
另请参阅
PySide2.QtGui.QOpenGLTexture.
release
(
unit
[
,
reset=DontResetTextureUnit
]
)
¶
unit
–
uint
reset
–
TextureUnitReset
Unbinds this texture from texture unit
unit
.
If parameter
reset
is
true
then this function will restore the active unit to the texture unit that was active upon entry.
PySide2.QtGui.QOpenGLTexture.
samples
(
)
¶
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.
PySide2.QtGui.QOpenGLTexture.
setAutoMipMapGenerationEnabled
(
enabled
)
¶
enabled
–
bool
若
enabled
is
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.
注意
Mipmap generation is not supported for compressed textures with OpenGL ES 2.0.
PySide2.QtGui.QOpenGLTexture.
setBorderColor
(
r
,
g
,
b
,
a
)
¶
r
–
uint
g
–
uint
b
–
uint
a
–
uint
Sets the color red to
r
, green to
g
, blue to
b
, and the alpha value to
a
. This is an overloaded function.
PySide2.QtGui.QOpenGLTexture.
setBorderColor
(
r
,
g
,
b
,
a
)
¶
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
. This is an overloaded function.
PySide2.QtGui.QOpenGLTexture.
setBorderColor
(
color
)
¶
color
–
QColor
Sets the border color of the texture to
color
.
注意
This function has no effect on Mac and Qt built for OpenGL ES 2.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setBorderColor
(
r
,
g
,
b
,
a
)
¶
r
–
float
g
–
float
b
–
float
a
–
float
Sets the color red to
r
, green to
g
, blue to
b
,和
a
to the alpha value. This is an overloaded function.
PySide2.QtGui.QOpenGLTexture.
setComparisonFunction
(
function
)
¶
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.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setComparisonMode
(
mode
)
¶
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.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
layer
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
layer
,
layerCount
,
cubeFace
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
layerCount
–
int
cubeFace
–
CubeMapFace
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
这是重载函数。
Parameter
layerCount
is the number of layers in a texture array that are being uploaded/populated by this call.
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
layer
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
layer
,
cubeFace
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
cubeFace
–
CubeMapFace
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
layer
,
cubeFace
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
cubeFace
–
CubeMapFace
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
mipLevel
,
dataSize
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
dataSize
,
data
[
,
options=None
]
)
¶
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setCompressedData
(
dataSize
,
data
[
,
options=None
]
)
¶
dataSize
–
int
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setData
(
xOffset
,
yOffset
,
zOffset
,
width
,
height
,
depth
,
mipLevel
,
layer
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
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
,
zOffset
specify the texel offsets within the texture. Parameters
width
,
height
and
depth
specify the dimensions of the sub image. The mip map level and layerof the sub image we want to update are specified with
mipLevel
and
layer
.
The structure of the pixel data pointed to by
data
is specified by
sourceFormat
and
sourceType
. The pixel data upload can optionally be controlled by
options
.
PySide2.QtGui.QOpenGLTexture.
setData
(
xOffset
,
yOffset
,
zOffset
,
width
,
height
,
depth
,
mipLevel
,
layer
,
cubeFace
,
layerCount
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
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
,
zOffset
specify the texel offsets within the texture. Parameters
width
,
height
and
depth
specify 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
,
face
and
layerCount
.
The structure of the pixel data pointed to by
data
is specified by
sourceFormat
and
sourceType
. The pixel data upload can optionally be controlled by
options
.
PySide2.QtGui.QOpenGLTexture.
setData
(
xOffset
,
yOffset
,
zOffset
,
width
,
height
,
depth
,
mipLevel
,
layer
,
cubeFace
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
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
,
zOffset
specify the texel offsets within the texture. Parameters
width
,
height
and
depth
specify 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
,
layer
and
face
.
The structure of the pixel data pointed to by
data
is specified by
sourceFormat
and
sourceType
. The pixel data upload can optionally be controlled by
options
.
PySide2.QtGui.QOpenGLTexture.
setData
(
xOffset
,
yOffset
,
zOffset
,
width
,
height
,
depth
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
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
,
zOffset
specify the texel offsets within the texture. Parameters
width
,
height
and
depth
specify the dimensions of the sub image.
The structure of the pixel data pointed to by
data
is specified by
sourceFormat
and
sourceType
. The pixel data upload can optionally be controlled by
options
.
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
layer
,
layerCount
,
cubeFace
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
layerCount
–
int
cubeFace
–
CubeMapFace
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
这是重载函数。
Parameter
layerCount
is the number of layers in a texture array that are being uploaded/populated by this call.
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
layer
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
layer
,
cubeFace
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
cubeFace
–
CubeMapFace
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
layer
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setData
(
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setData
(
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setData
(
image
[
,
genMipMaps=GenerateMipMaps
]
)
¶
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
genMipMaps
to
DontGenerateMipMaps
to turn off mipmap generation.
这是重载函数。
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
注意
此函数被弃用。
PySide2.QtGui.QOpenGLTexture.
setData
(
mipLevel
,
layer
,
cubeFace
,
sourceFormat
,
sourceType
,
data
[
,
options=None
]
)
¶
mipLevel
–
int
layer
–
int
cubeFace
–
CubeMapFace
sourceFormat
–
PixelFormat
sourceType
–
PixelType
data
–
void
options
–
QOpenGLPixelTransferOptions
PySide2.QtGui.QOpenGLTexture.
setDepthStencilMode
(
mode
)
¶
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.
注意
This function has no effect on Mac and Qt built for OpenGL ES 2.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setFixedSamplePositions
(
fixed
)
¶
fixed
–
bool
Sets whether the sample positions and number of samples used with a multisample capable texture target to
fixed
。若设为
true
the 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.
默认值为
true
.
PySide2.QtGui.QOpenGLTexture.
setFormat
(
format
)
¶
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.
PySide2.QtGui.QOpenGLTexture.
setLayers
(
layers
)
¶
layers
–
int
Sets the number of array
layers
to 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.
PySide2.QtGui.QOpenGLTexture.
setLevelOfDetailRange
(
min
,
max
)
¶
min
–
float
max
–
float
Sets the minimum level of detail parameters to
min
and the maximum level to
max
.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setLevelofDetailBias
(
bias
)
¶
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.
注意
This function has no effect on Qt built for OpenGL ES 2.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setMagnificationFilter
(
filter
)
¶
filter
–
Filter
Sets the magnification filter to
filter
.
PySide2.QtGui.QOpenGLTexture.
setMaximumAnisotropy
(
anisotropy
)
¶
anisotropy
–
float
If your OpenGL implementation supports the GL_EXT_texture_filter_anisotropic extension this function sets the maximum anisotropy level to
anisotropy
.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setMaximumLevelOfDetail
(
value
)
¶
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.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setMinMagFilters
(
minificationFilter
,
magnificationFilter
)
¶
Sets the minification filter to
minificationFilter
and the magnification filter to
magnificationFilter
.
PySide2.QtGui.QOpenGLTexture.
setMinificationFilter
(
filter
)
¶
filter
–
Filter
Sets the filter used for minification to
filter
.
PySide2.QtGui.QOpenGLTexture.
setMinimumLevelOfDetail
(
value
)
¶
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.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setMipBaseLevel
(
baseLevel
)
¶
baseLevel
–
int
Sets the base mipmap level used for all texture lookups with this texture to
baseLevel
.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setMipLevelRange
(
baseLevel
,
maxLevel
)
¶
baseLevel
–
int
maxLevel
–
int
Sets the range of mipmap levels that can be used for texture lookups with this texture to range from
baseLevel
to
maxLevel
.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setMipLevels
(
levels
)
¶
levels
–
int
For texture targets that support mipmaps, this function sets the requested number of mipmap
levels
to 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.
PySide2.QtGui.QOpenGLTexture.
setMipMaxLevel
(
maxLevel
)
¶
maxLevel
–
int
Sets the maximum mipmap level used for all texture lookups with this texture to
maxLevel
.
注意
This function has no effect on Qt built for OpenGL ES 2.
PySide2.QtGui.QOpenGLTexture.
setSamples
(
samples
)
¶
samples
–
int
Sets the number of
samples
to 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.
PySide2.QtGui.QOpenGLTexture.
setSize
(
width
[
,
height=1
[
,
depth=1
]
]
)
¶
width
–
int
height
–
int
depth
–
int
Sets the dimensions of this texture object to
width
,
height
,和
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
,
height
or
depth
is 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
.
PySide2.QtGui.QOpenGLTexture.
setSwizzleMask
(
component
,
value
)
¶
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
SwizzleValue
选项。
This function maps
component
to the output
value
.
注意
This function has no effect on Mac and Qt built for OpenGL ES 2.
另请参阅
PySide2.QtGui.QOpenGLTexture.
setSwizzleMask
(
r
,
g
,
b
,
a
)
¶
r
–
SwizzleValue
g
–
SwizzleValue
b
–
SwizzleValue
a
–
SwizzleValue
参数
r
,
g
,
b
,和
a
are values used for setting the colors red, green, blue, and the alpha value. This is an overloaded function.
PySide2.QtGui.QOpenGLTexture.
setWrapMode
(
direction
,
mode
)
¶
direction
–
CoordinateDirection
mode
–
WrapMode
Holds the texture dimension
direction
. This is an overloaded function.
PySide2.QtGui.QOpenGLTexture.
setWrapMode
(
mode
)
¶
mode
–
WrapMode
Sets the wrap (or repeat mode) for all texture dimentions to
mode
.
另请参阅
PySide2.QtGui.QOpenGLTexture.
swizzleMask
(
component
)
¶
component
–
SwizzleComponent
Returns the swizzle mask for texture
component
.
另请参阅
PySide2.QtGui.QOpenGLTexture.
textureId
(
)
¶
GLuint
Returns the name of the underlying OpenGL texture object or 0 if it has not yet been created.
另请参阅
PySide2.QtGui.QOpenGLTexture.
width
(
)
¶
int
Returns the width of a 1D, 2D or 3D texture.
PySide2.QtGui.QOpenGLTexture.
wrapMode
(
direction
)
¶
direction
–
CoordinateDirection
Returns the wrap mode for the texture dimension
direction
.
另请参阅