![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\inmodule QtGui More...
#include <qopengltexture.h>
Public Types | |
enum | Target { Target1D = 0x0DE0 , Target1DArray = 0x8C18 , Target2D = 0x0DE1 , Target2DArray = 0x8C1A , Target3D = 0x806F , TargetCubeMap = 0x8513 , TargetCubeMapArray = 0x9009 , Target2DMultisample = 0x9100 , Target2DMultisampleArray = 0x9102 , TargetRectangle = 0x84F5 , TargetBuffer = 0x8C2A } |
This enum defines the texture target of a QOpenGLTexture object. More... | |
enum | BindingTarget { BindingTarget1D = 0x8068 , BindingTarget1DArray = 0x8C1C , BindingTarget2D = 0x8069 , BindingTarget2DArray = 0x8C1D , BindingTarget3D = 0x806A , BindingTargetCubeMap = 0x8514 , BindingTargetCubeMapArray = 0x900A , BindingTarget2DMultisample = 0x9104 , BindingTarget2DMultisampleArray = 0x9105 , BindingTargetRectangle = 0x84F6 , BindingTargetBuffer = 0x8C2C } |
This enum defines the possible binding targets of texture units. More... | |
enum | MipMapGeneration { GenerateMipMaps , DontGenerateMipMaps } |
This enum defines the options to control mipmap generation. More... | |
enum | TextureUnitReset { ResetTextureUnit , DontResetTextureUnit } |
This enum defines options ot control texture unit activation. More... | |
enum | TextureFormat { NoFormat = 0 , R8_UNorm = 0x8229 , RG8_UNorm = 0x822B , RGB8_UNorm = 0x8051 , RGBA8_UNorm = 0x8058 , R16_UNorm = 0x822A , RG16_UNorm = 0x822C , RGB16_UNorm = 0x8054 , RGBA16_UNorm = 0x805B , R8_SNorm = 0x8F94 , RG8_SNorm = 0x8F95 , RGB8_SNorm = 0x8F96 , RGBA8_SNorm = 0x8F97 , R16_SNorm = 0x8F98 , RG16_SNorm = 0x8F99 , RGB16_SNorm = 0x8F9A , RGBA16_SNorm = 0x8F9B , R8U = 0x8232 , RG8U = 0x8238 , RGB8U = 0x8D7D , RGBA8U = 0x8D7C , R16U = 0x8234 , RG16U = 0x823A , RGB16U = 0x8D77 , RGBA16U = 0x8D76 , R32U = 0x8236 , RG32U = 0x823C , RGB32U = 0x8D71 , RGBA32U = 0x8D70 , R8I = 0x8231 , RG8I = 0x8237 , RGB8I = 0x8D8F , RGBA8I = 0x8D8E , R16I = 0x8233 , RG16I = 0x8239 , RGB16I = 0x8D89 , RGBA16I = 0x8D88 , R32I = 0x8235 , RG32I = 0x823B , RGB32I = 0x8D83 , RGBA32I = 0x8D82 , R16F = 0x822D , RG16F = 0x822F , RGB16F = 0x881B , RGBA16F = 0x881A , R32F = 0x822E , RG32F = 0x8230 , RGB32F = 0x8815 , RGBA32F = 0x8814 , RGB9E5 = 0x8C3D , RG11B10F = 0x8C3A , RG3B2 = 0x2A10 , R5G6B5 = 0x8D62 , RGB5A1 = 0x8057 , RGBA4 = 0x8056 , RGB10A2 = 0x906F , D16 = 0x81A5 , D24 = 0x81A6 , D24S8 = 0x88F0 , D32 = 0x81A7 , D32F = 0x8CAC , D32FS8X24 = 0x8CAD , S8 = 0x8D48 , RGB_DXT1 = 0x83F0 , RGBA_DXT1 = 0x83F1 , RGBA_DXT3 = 0x83F2 , RGBA_DXT5 = 0x83F3 , R_ATI1N_UNorm = 0x8DBB , R_ATI1N_SNorm = 0x8DBC , RG_ATI2N_UNorm = 0x8DBD , RG_ATI2N_SNorm = 0x8DBE , RGB_BP_UNSIGNED_FLOAT = 0x8E8F , RGB_BP_SIGNED_FLOAT = 0x8E8E , RGB_BP_UNorm = 0x8E8C , R11_EAC_UNorm = 0x9270 , R11_EAC_SNorm = 0x9271 , RG11_EAC_UNorm = 0x9272 , RG11_EAC_SNorm = 0x9273 , RGB8_ETC2 = 0x9274 , SRGB8_ETC2 = 0x9275 , RGB8_PunchThrough_Alpha1_ETC2 = 0x9276 , SRGB8_PunchThrough_Alpha1_ETC2 = 0x9277 , RGBA8_ETC2_EAC = 0x9278 , SRGB8_Alpha8_ETC2_EAC = 0x9279 , RGB8_ETC1 = 0x8D64 , RGBA_ASTC_4x4 = 0x93B0 , RGBA_ASTC_5x4 = 0x93B1 , RGBA_ASTC_5x5 = 0x93B2 , RGBA_ASTC_6x5 = 0x93B3 , RGBA_ASTC_6x6 = 0x93B4 , RGBA_ASTC_8x5 = 0x93B5 , RGBA_ASTC_8x6 = 0x93B6 , RGBA_ASTC_8x8 = 0x93B7 , RGBA_ASTC_10x5 = 0x93B8 , RGBA_ASTC_10x6 = 0x93B9 , RGBA_ASTC_10x8 = 0x93BA , RGBA_ASTC_10x10 = 0x93BB , RGBA_ASTC_12x10 = 0x93BC , RGBA_ASTC_12x12 = 0x93BD , SRGB8_Alpha8_ASTC_4x4 = 0x93D0 , SRGB8_Alpha8_ASTC_5x4 = 0x93D1 , SRGB8_Alpha8_ASTC_5x5 = 0x93D2 , SRGB8_Alpha8_ASTC_6x5 = 0x93D3 , SRGB8_Alpha8_ASTC_6x6 = 0x93D4 , SRGB8_Alpha8_ASTC_8x5 = 0x93D5 , SRGB8_Alpha8_ASTC_8x6 = 0x93D6 , SRGB8_Alpha8_ASTC_8x8 = 0x93D7 , SRGB8_Alpha8_ASTC_10x5 = 0x93D8 , SRGB8_Alpha8_ASTC_10x6 = 0x93D9 , SRGB8_Alpha8_ASTC_10x8 = 0x93DA , SRGB8_Alpha8_ASTC_10x10 = 0x93DB , SRGB8_Alpha8_ASTC_12x10 = 0x93DC , SRGB8_Alpha8_ASTC_12x12 = 0x93DD , SRGB8 = 0x8C41 , SRGB8_Alpha8 = 0x8C43 , SRGB_DXT1 = 0x8C4C , SRGB_Alpha_DXT1 = 0x8C4D , SRGB_Alpha_DXT3 = 0x8C4E , SRGB_Alpha_DXT5 = 0x8C4F , SRGB_BP_UNorm = 0x8E8D , DepthFormat = 0x1902 , AlphaFormat = 0x1906 , RGBFormat = 0x1907 , RGBAFormat = 0x1908 , LuminanceFormat = 0x1909 , LuminanceAlphaFormat = 0x190A } |
This enum defines the possible texture formats. More... | |
enum | TextureFormatClass { NoFormatClass , FormatClass_128Bit , FormatClass_96Bit , FormatClass_64Bit , FormatClass_48Bit , FormatClass_32Bit , FormatClass_24Bit , FormatClass_16Bit , FormatClass_8Bit , FormatClass_RGTC1_R , FormatClass_RGTC2_RG , FormatClass_BPTC_Unorm , FormatClass_BPTC_Float , FormatClass_S3TC_DXT1_RGB , FormatClass_S3TC_DXT1_RGBA , FormatClass_S3TC_DXT3_RGBA , FormatClass_S3TC_DXT5_RGBA , FormatClass_Unique } |
enum | CubeMapFace { CubeMapPositiveX = 0x8515 , CubeMapNegativeX = 0x8516 , CubeMapPositiveY = 0x8517 , CubeMapNegativeY = 0x8518 , CubeMapPositiveZ = 0x8519 , CubeMapNegativeZ = 0x851A } |
This enum defines the possible CubeMap faces. More... | |
enum | PixelFormat { NoSourceFormat = 0 , Red = 0x1903 , RG = 0x8227 , RGB = 0x1907 , BGR = 0x80E0 , RGBA = 0x1908 , BGRA = 0x80E1 , Red_Integer = 0x8D94 , RG_Integer = 0x8228 , RGB_Integer = 0x8D98 , BGR_Integer = 0x8D9A , RGBA_Integer = 0x8D99 , BGRA_Integer = 0x8D9B , Stencil = 0x1901 , Depth = 0x1902 , DepthStencil = 0x84F9 , Alpha = 0x1906 , Luminance = 0x1909 , LuminanceAlpha = 0x190A } |
This enum defines the possible client-side pixel formats for a pixel transfer operation. More... | |
enum | PixelType { NoPixelType = 0 , Int8 = 0x1400 , UInt8 = 0x1401 , Int16 = 0x1402 , UInt16 = 0x1403 , Int32 = 0x1404 , UInt32 = 0x1405 , Float16 = 0x140B , Float16OES = 0x8D61 , Float32 = 0x1406 , UInt32_RGB9_E5 = 0x8C3E , UInt32_RG11B10F = 0x8C3B , UInt8_RG3B2 = 0x8032 , UInt8_RG3B2_Rev = 0x8362 , UInt16_RGB5A1 = 0x8034 , UInt16_RGB5A1_Rev = 0x8366 , UInt16_R5G6B5 = 0x8363 , UInt16_R5G6B5_Rev = 0x8364 , UInt16_RGBA4 = 0x8033 , UInt16_RGBA4_Rev = 0x8365 , UInt32_RGBA8 = 0x8035 , UInt32_RGBA8_Rev = 0x8367 , UInt32_RGB10A2 = 0x8036 , UInt32_RGB10A2_Rev = 0x8368 , UInt32_D24S8 = 0x84FA , Float32_D32_UInt32_S8_X24 = 0x8DAD } |
This enum defines the possible pixel data types for a pixel transfer operation. More... | |
enum | SwizzleComponent { SwizzleRed = 0x8E42 , SwizzleGreen = 0x8E43 , SwizzleBlue = 0x8E44 , SwizzleAlpha = 0x8E45 } |
This enum defines the texture color components that can be assigned a swizzle mask. More... | |
enum | SwizzleValue { RedValue = 0x1903 , GreenValue = 0x1904 , BlueValue = 0x1905 , AlphaValue = 0x1906 , ZeroValue = 0 , OneValue = 1 } |
This enum defines the possible mask values for texture swizzling. More... | |
enum | WrapMode { Repeat = 0x2901 , MirroredRepeat = 0x8370 , ClampToEdge = 0x812F , ClampToBorder = 0x812D } |
This enum defines the possible texture coordinate wrapping modes. More... | |
enum | CoordinateDirection { DirectionS = 0x2802 , DirectionT = 0x2803 , DirectionR = 0x8072 } |
This enum defines the possible texture coordinate directions. More... | |
enum | Feature { ImmutableStorage = 0x00000001 , ImmutableMultisampleStorage = 0x00000002 , TextureRectangle = 0x00000004 , TextureArrays = 0x00000008 , Texture3D = 0x00000010 , TextureMultisample = 0x00000020 , TextureBuffer = 0x00000040 , TextureCubeMapArrays = 0x00000080 , Swizzle = 0x00000100 , StencilTexturing = 0x00000200 , AnisotropicFiltering = 0x00000400 , NPOTTextures = 0x00000800 , NPOTTextureRepeat = 0x00001000 , Texture1D = 0x00002000 , TextureComparisonOperators = 0x00004000 , TextureMipMapLevel = 0x00008000 , MaxFeatureFlag = 0x00010000 } |
This enum defines the OpenGL texture-related features that can be tested for. More... | |
enum | DepthStencilMode { DepthMode = 0x1902 , StencilMode = 0x1901 } |
enum | ComparisonFunction { CompareLessEqual = 0x0203 , CompareGreaterEqual = 0x0206 , CompareLess = 0x0201 , CompareGreater = 0x0204 , CompareEqual = 0x0202 , CompareNotEqual = 0x0205 , CompareAlways = 0x0207 , CompareNever = 0x0200 } |
enum | ComparisonMode { CompareRefToTexture = 0x884E , CompareNone = 0x0000 } |
enum | Filter { Nearest = 0x2600 , Linear = 0x2601 , NearestMipMapNearest = 0x2700 , NearestMipMapLinear = 0x2702 , LinearMipMapNearest = 0x2701 , LinearMipMapLinear = 0x2703 } |
This enum defines the filtering parameters for a QOpenGLTexture object. More... | |
Public Member Functions | |
QOpenGLTexture (Target target) | |
Creates a QOpenGLTexture object that can later be bound to target. | |
QOpenGLTexture (const QImage &image, MipMapGeneration genMipMaps=GenerateMipMaps) | |
Creates a QOpenGLTexture object that can later be bound to the 2D texture target and contains the pixel data contained in image. | |
~QOpenGLTexture () | |
Target | target () const |
Returns the binding target of this texture. | |
bool | create () |
Creates the underlying OpenGL texture object. | |
void | destroy () |
Destroys the underlying OpenGL texture object. | |
bool | isCreated () const |
Returns true if the underlying OpenGL texture object has been created. | |
GLuint | textureId () const |
Returns the name of the underlying OpenGL texture object or 0 if it has not yet been created. | |
void | bind () |
Binds this texture to the currently active texture unit ready for rendering. | |
void | bind (uint unit, TextureUnitReset reset=DontResetTextureUnit) |
Binds this texture to texture unit unit ready for rendering. | |
void | release () |
Unbinds this texture from the currently active texture unit. | |
void | release (uint unit, TextureUnitReset reset=DontResetTextureUnit) |
Unbinds this texture from texture unit unit. | |
bool | isBound () const |
Returns true if this texture is bound to the corresponding target of the currently active texture unit. | |
bool | isBound (uint unit) |
Returns true if this texture is bound to the corresponding target of texture unit unit. | |
void | setFormat (TextureFormat format) |
Sets the format of this texture object to format. | |
TextureFormat | format () const |
Returns the format of this texture object. | |
void | setSize (int width, int height=1, int depth=1) |
Sets the dimensions of this texture object to width, height, and depth. | |
int | width () const |
Returns the width of a 1D, 2D or 3D texture. | |
int | height () const |
Returns the height of a 2D or 3D texture. | |
int | depth () const |
Returns the depth of a 3D texture. | |
void | setMipLevels (int levels) |
For texture targets that support mipmaps, this function sets the requested number of mipmap levels to allocate storage for. | |
int | mipLevels () const |
Returns the number of mipmap levels for this texture. | |
int | maximumMipLevels () const |
Returns the maximum number of mipmap levels that this texture can have given the current dimensions. | |
void | setLayers (int layers) |
Sets the number of array layers to allocate storage for. | |
int | layers () const |
Returns the number of array layers for this texture. | |
int | faces () const |
Returns the number of faces for this texture. | |
void | setSamples (int samples) |
Sets the number of samples to allocate storage for when rendering to a multisample capable texture target. | |
int | samples () const |
Returns the number of multisample sample points for this texture. | |
void | setFixedSamplePositions (bool fixed) |
Sets whether the sample positions and number of samples used with a multisample capable texture target to fixed. | |
bool | isFixedSamplePositions () const |
Returns whether this texture uses a fixed pattern of multisample samples. | |
void | allocateStorage () |
Allocates server-side storage for this texture object taking into account, the format, dimensions, mipmap levels, array layers and cubemap faces. | |
void | allocateStorage (PixelFormat pixelFormat, PixelType pixelType) |
bool | isStorageAllocated () const |
Returns true if server-side storage for this texture as been allocated. | |
QOpenGLTexture * | createTextureView (Target target, TextureFormat viewFormat, int minimumMipmapLevel, int maximumMipmapLevel, int minimumLayer, int maximumLayer) const |
Attempts to create a texture view onto this texture. | |
bool | isTextureView () const |
Returns true if this texture object is actually a view onto another texture object. | |
void | setData (int mipLevel, int layer, CubeMapFace cubeFace, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
Uploads pixel data for this texture object mipLevel, array layer, and cubeFace. | |
void | setData (int mipLevel, int layer, int layerCount, CubeMapFace cubeFace, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int mipLevel, int layer, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int mipLevel, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int xOffset, int yOffset, int zOffset, int width, int height, int depth, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, CubeMapFace cubeFace, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setData (int xOffset, int yOffset, int zOffset, int width, int height, int depth, int mipLevel, int layer, CubeMapFace cubeFace, int layerCount, PixelFormat sourceFormat, PixelType sourceType, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setCompressedData (int mipLevel, int layer, CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
Uploads compressed pixel data to mipLevel, array layer, and cubeFace. | |
void | setCompressedData (int mipLevel, int layer, int layerCount, CubeMapFace cubeFace, int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
void | setCompressedData (int mipLevel, int layer, int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setCompressedData (int mipLevel, int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setCompressedData (int dataSize, const void *data, const QOpenGLPixelTransferOptions *const options=nullptr) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | setData (const QImage &image, MipMapGeneration genMipMaps=GenerateMipMaps) |
This overload of setData() will allocate storage for you. | |
void | setMipBaseLevel (int baseLevel) |
Sets the base mipmap level used for all texture lookups with this texture to baseLevel. | |
int | mipBaseLevel () const |
Returns the mipmap base level used for all texture lookups with this texture. | |
void | setMipMaxLevel (int maxLevel) |
Sets the maximum mipmap level used for all texture lookups with this texture to maxLevel. | |
int | mipMaxLevel () const |
Returns the mipmap maximum level used for all texture lookups with this texture. | |
void | setMipLevelRange (int baseLevel, int maxLevel) |
Sets the range of mipmap levels that can be used for texture lookups with this texture to range from baseLevel to maxLevel. | |
std::pair< int, int > | mipLevelRange () const |
Returns the range of mipmap levels that can be used for texture lookups with this texture. | |
void | setAutoMipMapGenerationEnabled (bool enabled) |
If enabled is true , enables automatic mipmap generation for this texture object to occur whenever the level 0 mipmap data is set via setData(). | |
bool | isAutoMipMapGenerationEnabled () const |
Returns whether auto mipmap generation is enabled for this texture object. | |
void | generateMipMaps () |
Generates mipmaps for this texture object from mipmap level 0. | |
void | generateMipMaps (int baseLevel, bool resetBaseLevel=true) |
Generates mipmaps for this texture object from mipmap level baseLevel. | |
void | setSwizzleMask (SwizzleComponent component, SwizzleValue value) |
GLSL shaders are able to reorder the components of the vec4 returned by texture functions. | |
void | setSwizzleMask (SwizzleValue r, SwizzleValue g, SwizzleValue b, SwizzleValue a) |
Parameters {r}, {g}, {b}, and {a} are values used for setting the colors red, green, blue, and the alpha value. | |
SwizzleValue | swizzleMask (SwizzleComponent component) const |
Returns the swizzle mask for texture component. | |
void | setDepthStencilMode (DepthStencilMode mode) |
If using a texture that has a combined depth/stencil format this function sets which component of the texture is accessed to mode. | |
DepthStencilMode | depthStencilMode () const |
Returns the depth stencil mode for textures using a combined depth/stencil format. | |
void | setComparisonFunction (ComparisonFunction function) |
ComparisonFunction | comparisonFunction () const |
void | setComparisonMode (ComparisonMode mode) |
ComparisonMode | comparisonMode () const |
void | setMinificationFilter (Filter filter) |
Sets the filter used for minification to filter. | |
Filter | minificationFilter () const |
Returns the minification filter. | |
void | setMagnificationFilter (Filter filter) |
Sets the magnification filter to filter. | |
Filter | magnificationFilter () const |
Returns the magnification filter. | |
void | setMinMagFilters (Filter minificationFilter, Filter magnificationFilter) |
Sets the minification filter to minificationFilter and the magnification filter to magnificationFilter. | |
std::pair< Filter, Filter > | minMagFilters () const |
Returns the current minification and magnification filters. | |
void | setMaximumAnisotropy (float anisotropy) |
If your OpenGL implementation supports the GL_EXT_texture_filter_anisotropic extension this function sets the maximum anisotropy level to anisotropy. | |
float | maximumAnisotropy () const |
Returns the maximum level of anisotropy to be accounted for when performing texture lookups. | |
void | setWrapMode (WrapMode mode) |
Sets the wrap (or repeat mode) for all texture dimensions to mode. | |
void | setWrapMode (CoordinateDirection direction, WrapMode mode) |
Sets the wrap (or repeat mode) for the texture dimension direction to mode. | |
WrapMode | wrapMode (CoordinateDirection direction) const |
Returns the wrap mode for the texture dimension direction. | |
void | setBorderColor (const QColor &color) |
Sets the border color of the texture to color. | |
void | setBorderColor (float r, float g, float b, float a) |
Sets the color red to {r}, green to {g}, blue to {b}, and {a} to the alpha value. | |
void | setBorderColor (int r, int g, int b, int a) |
Sets the color red to {r}, green to {g}, blue to {b}, and the alpha value to {a}. | |
void | setBorderColor (uint r, uint g, uint b, uint a) |
Sets the color red to {r}, green to {g}, blue to {b}, and the alpha value to {a}. | |
QColor | borderColor () const |
Returns the borderColor of this texture. | |
void | borderColor (float *border) const |
Writes the texture border color into the first four elements of the array pointed to by border. | |
void | borderColor (int *border) const |
Writes the texture border color into the first four elements of the array pointed to by border. | |
void | borderColor (unsigned int *border) const |
Writes the texture border color into the first four elements of the array pointed to by border. | |
void | setMinimumLevelOfDetail (float value) |
Sets the minimum level of detail to value. | |
float | minimumLevelOfDetail () const |
Returns the minimum level of detail parameter. | |
void | setMaximumLevelOfDetail (float value) |
Sets the maximum level of detail to value. | |
float | maximumLevelOfDetail () const |
Returns the maximum level of detail parameter. | |
void | setLevelOfDetailRange (float min, float max) |
Sets the minimum level of detail parameters to min and the maximum level to max. | |
std::pair< float, float > | levelOfDetailRange () const |
Returns the minimum and maximum level of detail parameters. | |
void | setLevelofDetailBias (float bias) |
Sets the level of detail bias to bias. | |
float | levelofDetailBias () const |
Returns the level of detail bias parameter. | |
Static Public Member Functions | |
static GLuint | boundTextureId (BindingTarget target) |
Returns the textureId of the texture that is bound to the target of the currently active texture unit. | |
static GLuint | boundTextureId (uint unit, BindingTarget target) |
Returns the textureId of the texture that is bound to the target of the texture unit unit. | |
static bool | hasFeature (Feature feature) |
Returns true if your OpenGL implementation and version supports the texture feature feature. | |
Friends | |
Q_OPENGL_EXPORT QDebug | operator<< (QDebug dbg, const QOpenGLTexture *t) |
\inmodule QtGui
The QOpenGLTexture class encapsulates an OpenGL texture object.
QOpenGLTexture makes it easy to work with OpenGL textures and the myriad features and targets that they offer depending upon the capabilities of your OpenGL implementation.
The typical usage pattern for QOpenGLTexture is \list
In the common case of simply using a QImage as the source of texture pixel data most of the above steps are performed automatically.
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.
Definition at line 21 of file qopengltexture.h.
This enum defines the possible binding targets of texture units.
\value BindingTarget1D Equivalent to GL_TEXTURE_BINDING_1D \value BindingTarget1DArray Equivalent to GL_TEXTURE_BINDING_1D_ARRAY \value BindingTarget2D Equivalent to GL_TEXTURE_BINDING_2D \value BindingTarget2DArray Equivalent to GL_TEXTURE_BINDING_2D_ARRAY \value BindingTarget3D Equivalent to GL_TEXTURE_BINDING_3D \value BindingTargetCubeMap Equivalent to GL_TEXTURE_BINDING_CUBE_MAP \value BindingTargetCubeMapArray Equivalent to GL_TEXTURE_BINDING_CUBE_MAP_ARRAY \value BindingTarget2DMultisample Equivalent to GL_TEXTURE_BINDING_2D_MULTISAMPLE \value BindingTarget2DMultisampleArray Equivalent to GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY \value BindingTargetRectangle Equivalent to GL_TEXTURE_BINDING_RECTANGLE \value BindingTargetBuffer Equivalent to GL_TEXTURE_BINDING_BUFFER
Definition at line 40 of file qopengltexture.h.
\value CompareLessEqual Equivalent to GL_LEQUAL. \value CompareGreaterEqual Equivalent to GL_GEQUAL. \value CompareLess Equivalent to GL_LESS. \value CompareGreater Equivalent to GL_GREATER. \value CompareEqual Equivalent to GL_EQUAL. \value CompareNotEqual Equivalent to GL_NOTEQUAL. \value CompareAlways Equivalent to GL_ALWAYS. \value CompareNever Equivalent to GL_NEVER.
\omitvalue CommpareNotEqual
Enumerator | |
---|---|
CompareLessEqual | |
CompareGreaterEqual | |
CompareLess | |
CompareGreater | |
CompareEqual | |
CompareNotEqual | |
CompareAlways | |
CompareNever |
Definition at line 511 of file qopengltexture.h.
\value CompareRefToTexture Equivalent to GL_COMPARE_REF_TO_TEXTURE. \value CompareNone Equivalent to GL_NONE.
Enumerator | |
---|---|
CompareRefToTexture | |
CompareNone |
Definition at line 531 of file qopengltexture.h.
This enum defines the possible texture coordinate directions.
\value DirectionS The horizontal direction. Equivalent to GL_TEXTURE_WRAP_S \value DirectionT The vertical direction. Equivalent to GL_TEXTURE_WRAP_T \value DirectionR The depth direction. Equivalent to GL_TEXTURE_WRAP_R
Enumerator | |
---|---|
DirectionS | |
DirectionT | |
DirectionR |
Definition at line 339 of file qopengltexture.h.
This enum defines the possible CubeMap faces.
\value CubeMapPositiveX Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_X \value CubeMapNegativeX Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_X \value CubeMapPositiveY Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Y \value CubeMapNegativeY Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Y \value CubeMapPositiveZ Equivalent to GL_TEXTURE_CUBE_MAP_POSITIVE_Z \value CubeMapNegativeZ Equivalent to GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
Enumerator | |
---|---|
CubeMapPositiveX | |
CubeMapNegativeX | |
CubeMapPositiveY | |
CubeMapNegativeY | |
CubeMapPositiveZ | |
CubeMapNegativeZ |
Definition at line 250 of file qopengltexture.h.
\value DepthMode Equivalent to GL_DEPTH_COMPONENT. \value StencilMode Equivalent to GL_STENCIL_INDEX.
Enumerator | |
---|---|
DepthMode | |
StencilMode |
Definition at line 502 of file qopengltexture.h.
This enum defines the OpenGL texture-related features that can be tested for.
\value ImmutableStorage Support for immutable texture storage \value ImmutableMultisampleStorage Support for immutable texture storage with multisample targets \value TextureRectangle Support for the GL_TEXTURE_RECTANGLE target \value TextureArrays Support for texture targets with array layers \value Texture3D Support for the 3 dimensional texture target \value TextureMultisample Support for texture targets that have multisample capabilities \value TextureBuffer Support for textures that use OpenGL buffer objects as their data source \value TextureCubeMapArrays Support for cubemap array texture target \value Swizzle Support for texture component swizzle masks \value StencilTexturing Support for stencil texturing (i.e. looking up depth or stencil components of a combined depth/stencil format texture in GLSL shaders). \value AnisotropicFiltering Support for anisotropic texture filtering \value NPOTTextures Basic support for non-power-of-two textures \value NPOTTextureRepeat Full support for non-power-of-two textures including texture repeat modes \value Texture1D Support for the 1 dimensional texture target \value TextureComparisonOperators Support for texture comparison operators \value TextureMipMapLevel Support for setting the base and maximum mipmap levels
Definition at line 347 of file qopengltexture.h.
This enum defines the filtering parameters for a QOpenGLTexture object.
\value Nearest Equivalent to GL_NEAREST \value Linear Equivalent to GL_LINEAR \value NearestMipMapNearest Equivalent to GL_NEAREST_MIPMAP_NEAREST \value NearestMipMapLinear Equivalent to GL_NEAREST_MIPMAP_LINEAR \value LinearMipMapNearest Equivalent to GL_LINEAR_MIPMAP_NEAREST \value LinearMipMapLinear Equivalent to GL_LINEAR_MIPMAP_LINEAR
Enumerator | |
---|---|
Nearest | |
Linear | |
NearestMipMapNearest | |
NearestMipMapLinear | |
LinearMipMapNearest | |
LinearMipMapLinear |
Definition at line 540 of file qopengltexture.h.
This enum defines the options to control mipmap generation.
\value GenerateMipMaps Mipmaps should be generated \value DontGenerateMipMaps Mipmaps should not be generated
Enumerator | |
---|---|
GenerateMipMaps | |
DontGenerateMipMaps |
Definition at line 55 of file qopengltexture.h.
This enum defines the possible client-side pixel formats for a pixel transfer operation.
\value NoSourceFormat Equivalent to GL_NONE \value Red Equivalent to GL_RED \value RG Equivalent to GL_RG \value RGB Equivalent to GL_RGB \value BGR Equivalent to GL_BGR \value RGBA Equivalent to GL_RGBA \value BGRA Equivalent to GL_BGRA \value Red_Integer Equivalent to GL_RED_INTEGER \value RG_Integer Equivalent to GL_RG_INTEGER \value RGB_Integer Equivalent to GL_RGB_INTEGER \value BGR_Integer Equivalent to GL_BGR_INTEGER \value RGBA_Integer Equivalent to GL_RGBA_INTEGER \value BGRA_Integer Equivalent to GL_BGRA_INTEGER \value Stencil Equivalent to GL_STENCIL_INDEX. Introduced in Qt 5.4 \value Depth Equivalent to GL_DEPTH_COMPONENT \value DepthStencil Equivalent to GL_DEPTH_STENCIL \value Alpha Equivalent to GL_ALPHA (OpenGL ES 2 only) \value Luminance Equivalent to GL_LUMINANCE (OpenGL ES 2 only) \value LuminanceAlpha Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
Enumerator | |
---|---|
NoSourceFormat | |
Red | |
RG | |
RGB | |
BGR | |
RGBA | |
BGRA | |
Red_Integer | |
RG_Integer | |
RGB_Integer | |
BGR_Integer | |
RGBA_Integer | |
BGRA_Integer | |
Stencil | |
Depth | |
DepthStencil | |
Alpha | |
Luminance | |
LuminanceAlpha |
Definition at line 260 of file qopengltexture.h.
This enum defines the possible pixel data types for a pixel transfer operation.
\value NoPixelType Equivalent to GL_NONE \value Int8 Equivalent to GL_BYTE \value UInt8 Equivalent to GL_UNSIGNED_BYTE \value Int16 Equivalent to GL_SHORT \value UInt16 Equivalent to GL_UNSIGNED_SHORT \value Int32 Equivalent to GL_INT \value UInt32 Equivalent to GL_UNSIGNED_INT \value Float16 Equivalent to GL_HALF_FLOAT \value Float16OES Equivalent to GL_HALF_FLOAT_OES \value Float32 Equivalent to GL_FLOAT \value UInt32_RGB9_E5 Equivalent to GL_UNSIGNED_INT_5_9_9_9_REV \value UInt32_RG11B10F Equivalent to GL_UNSIGNED_INT_10F_11F_11F_REV \value UInt8_RG3B2 Equivalent to GL_UNSIGNED_BYTE_3_3_2 \value UInt8_RG3B2_Rev Equivalent to GL_UNSIGNED_BYTE_2_3_3_REV \value UInt16_RGB5A1 Equivalent to GL_UNSIGNED_SHORT_5_5_5_1 \value UInt16_RGB5A1_Rev Equivalent to GL_UNSIGNED_SHORT_1_5_5_5_REV \value UInt16_R5G6B5 Equivalent to GL_UNSIGNED_SHORT_5_6_5 \value UInt16_R5G6B5_Rev Equivalent to GL_UNSIGNED_SHORT_5_6_5_REV \value UInt16_RGBA4 Equivalent to GL_UNSIGNED_SHORT_4_4_4_4 \value UInt16_RGBA4_Rev Equivalent to GL_UNSIGNED_SHORT_4_4_4_4_REV \value UInt32_RGBA8 Equivalent to GL_UNSIGNED_INT_8_8_8_8 \value UInt32_RGBA8_Rev Equivalent to GL_UNSIGNED_INT_8_8_8_8_REV \value UInt32_RGB10A2 Equivalent to GL_UNSIGNED_INT_10_10_10_2 \value UInt32_RGB10A2_Rev Equivalent to GL_UNSIGNED_INT_2_10_10_10_REV \value UInt32_D24S8 Equivalent to GL_UNSIGNED_INT_24_8. Introduced in Qt 5.4 \value Float32_D32_UInt32_S8_X24 Equivalent to GL_FLOAT_32_UNSIGNED_INT_24_8_REV. Introduced in Qt 5.4
Definition at line 283 of file qopengltexture.h.
This enum defines the texture color components that can be assigned a swizzle mask.
\value SwizzleRed The red component. Equivalent to GL_TEXTURE_SWIZZLE_R \value SwizzleGreen The green component. Equivalent to GL_TEXTURE_SWIZZLE_G \value SwizzleBlue The blue component. Equivalent to GL_TEXTURE_SWIZZLE_B \value SwizzleAlpha The alpha component. Equivalent to GL_TEXTURE_SWIZZLE_A
Enumerator | |
---|---|
SwizzleRed | |
SwizzleGreen | |
SwizzleBlue | |
SwizzleAlpha |
Definition at line 313 of file qopengltexture.h.
This enum defines the possible mask values for texture swizzling.
\value RedValue Maps the component to the red channel. Equivalent to GL_RED \value GreenValue Maps the component to the green channel. Equivalent to GL_GREEN \value BlueValue Maps the component to the blue channel. Equivalent to GL_BLUE \value AlphaValue Maps the component to the alpha channel. Equivalent to GL_ALPHA \value ZeroValue Maps the component to a fixed value of 0. Equivalent to GL_ZERO \value OneValue Maps the component to a fixed value of 1. Equivalent to GL_ONE
Enumerator | |
---|---|
RedValue | |
GreenValue | |
BlueValue | |
AlphaValue | |
ZeroValue | |
OneValue |
Definition at line 321 of file qopengltexture.h.
This enum defines the texture target of a QOpenGLTexture object.
For more information on creating array textures, see \l{Array Texture}.
\value Target1D A 1-dimensional texture. Equivalent to GL_TEXTURE_1D. \value Target1DArray An array of 1-dimensional textures. Equivalent to GL_TEXTURE_1D_ARRAY \value Target2D A 2-dimensional texture. Equivalent to GL_TEXTURE_2D \value Target2DArray An array of 2-dimensional textures. Equivalent to GL_TEXTURE_2D_ARRAY \value Target3D A 3-dimensional texture. Equivalent to GL_TEXTURE_3D \value TargetCubeMap A cubemap texture. Equivalent to GL_TEXTURE_CUBE_MAP \value TargetCubeMapArray An array of cubemap textures. Equivalent to GL_TEXTURE_CUBE_MAP_ARRAY \value Target2DMultisample A 2-dimensional texture with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE \value Target2DMultisampleArray An array of 2-dimensional textures with multisample support. Equivalent to GL_TEXTURE_2D_MULTISAMPLE_ARRAY \value TargetRectangle A rectangular 2-dimensional texture. Equivalent to GL_TEXTURE_RECTANGLE \value TargetBuffer A texture with data from an OpenGL buffer object. Equivalent to GL_TEXTURE_BUFFER
Enumerator | |
---|---|
Target1D | |
Target1DArray | |
Target2D | |
Target2DArray | |
Target3D | |
TargetCubeMap | |
TargetCubeMapArray | |
Target2DMultisample | |
Target2DMultisampleArray | |
TargetRectangle | |
TargetBuffer |
Definition at line 25 of file qopengltexture.h.
This enum defines the possible texture formats.
Depending upon your OpenGL implementation only a subset of these may be supported.
\value NoFormat Equivalent to GL_NONE
\value R8_UNorm Equivalent to GL_R8 \value RG8_UNorm Equivalent to GL_RG8 \value RGB8_UNorm Equivalent to GL_RGB8 \value RGBA8_UNorm Equivalent to GL_RGBA8
\value R16_UNorm Equivalent to GL_R16 \value RG16_UNorm Equivalent to GL_RG16 \value RGB16_UNorm Equivalent to GL_RGB16 \value RGBA16_UNorm Equivalent to GL_RGBA16
\value R8_SNorm Equivalent to GL_R8_SNORM \value RG8_SNorm Equivalent to GL_RG8_SNORM \value RGB8_SNorm Equivalent to GL_RGB8_SNORM \value RGBA8_SNorm Equivalent to GL_RGBA8_SNORM
\value R16_SNorm Equivalent to GL_R16_SNORM \value RG16_SNorm Equivalent to GL_RG16_SNORM \value RGB16_SNorm Equivalent to GL_RGB16_SNORM \value RGBA16_SNorm Equivalent to GL_RGBA16_SNORM
\value R8U Equivalent to GL_R8UI \value RG8U Equivalent to GL_RG8UI \value RGB8U Equivalent to GL_RGB8UI \value RGBA8U Equivalent to GL_RGBA8UI
\value R16U Equivalent to GL_R16UI \value RG16U Equivalent to GL_RG16UI \value RGB16U Equivalent to GL_RGB16UI \value RGBA16U Equivalent to GL_RGBA16UI
\value R32U Equivalent to GL_R32UI \value RG32U Equivalent to GL_RG32UI \value RGB32U Equivalent to GL_RGB32UI \value RGBA32U Equivalent to GL_RGBA32UI
\value R8I Equivalent to GL_R8I \value RG8I Equivalent to GL_RG8I \value RGB8I Equivalent to GL_RGB8I \value RGBA8I Equivalent to GL_RGBA8I
\value R16I Equivalent to GL_R16I \value RG16I Equivalent to GL_RG16I \value RGB16I Equivalent to GL_RGB16I \value RGBA16I Equivalent to GL_RGBA16I
\value R32I Equivalent to GL_R32I \value RG32I Equivalent to GL_RG32I \value RGB32I Equivalent to GL_RGB32I \value RGBA32I Equivalent to GL_RGBA32I
\value R16F Equivalent to GL_R16F \value RG16F Equivalent to GL_RG16F \value RGB16F Equivalent to GL_RGB16F \value RGBA16F Equivalent to GL_RGBA16F
\value R32F Equivalent to GL_R32F \value RG32F Equivalent to GL_RG32F \value RGB32F Equivalent to GL_RGB32F \value RGBA32F Equivalent to GL_RGBA32F
\value RGB9E5 Equivalent to GL_RGB9_E5 \value RG11B10F Equivalent to GL_R11F_G11F_B10F \value RG3B2 Equivalent to GL_R3_G3_B2 \value R5G6B5 Equivalent to GL_RGB565 \value RGB5A1 Equivalent to GL_RGB5_A1 \value RGBA4 Equivalent to GL_RGBA4 \value RGB10A2 Equivalent to GL_RGB10_A2UI
\value D16 Equivalent to GL_DEPTH_COMPONENT16 \value D24 Equivalent to GL_DEPTH_COMPONENT24 \value D24S8 Equivalent to GL_DEPTH24_STENCIL8 \value D32 Equivalent to GL_DEPTH_COMPONENT32 \value D32F Equivalent to GL_DEPTH_COMPONENT32F \value D32FS8X24 Equivalent to GL_DEPTH32F_STENCIL8 \value S8 Equivalent to GL_STENCIL_INDEX8. Introduced in Qt 5.4
\value RGB_DXT1 Equivalent to GL_COMPRESSED_RGB_S3TC_DXT1_EXT \value RGBA_DXT1 Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT1_EXT \value RGBA_DXT3 Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT3_EXT \value RGBA_DXT5 Equivalent to GL_COMPRESSED_RGBA_S3TC_DXT5_EXT \value R_ATI1N_UNorm Equivalent to GL_COMPRESSED_RED_RGTC1 \value R_ATI1N_SNorm Equivalent to GL_COMPRESSED_SIGNED_RED_RGTC1 \value RG_ATI2N_UNorm Equivalent to GL_COMPRESSED_RG_RGTC2 \value RG_ATI2N_SNorm Equivalent to GL_COMPRESSED_SIGNED_RG_RGTC2 \value RGB_BP_UNSIGNED_FLOAT Equivalent to GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB \value RGB_BP_SIGNED_FLOAT Equivalent to GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB \value RGB_BP_UNorm Equivalent to GL_COMPRESSED_RGBA_BPTC_UNORM_ARB \value R11_EAC_UNorm Equivalent to GL_COMPRESSED_R11_EAC \value R11_EAC_SNorm Equivalent to GL_COMPRESSED_SIGNED_R11_EAC \value RG11_EAC_UNorm Equivalent to GL_COMPRESSED_RG11_EAC \value RG11_EAC_SNorm Equivalent to GL_COMPRESSED_SIGNED_RG11_EAC \value RGB8_ETC2 Equivalent to GL_COMPRESSED_RGB8_ETC2 \value SRGB8_ETC2 Equivalent to GL_COMPRESSED_SRGB8_ETC2 \value RGB8_PunchThrough_Alpha1_ETC2 Equivalent to GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 \value SRGB8_PunchThrough_Alpha1_ETC2 Equivalent to GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 \value RGBA8_ETC2_EAC Equivalent to GL_COMPRESSED_RGBA8_ETC2_EAC \value SRGB8_Alpha8_ETC2_EAC Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC \value RGB8_ETC1 Equivalent to GL_ETC1_RGB8_OES \value RGBA_ASTC_4x4 Equivalent to GL_COMPRESSED_RGBA_ASTC_4x4_KHR \value RGBA_ASTC_5x4 Equivalent to GL_COMPRESSED_RGBA_ASTC_5x4_KHR \value RGBA_ASTC_5x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_5x5_KHR \value RGBA_ASTC_6x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_6x5_KHR \value RGBA_ASTC_6x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_6x6_KHR \value RGBA_ASTC_8x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x5_KHR \value RGBA_ASTC_8x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x6_KHR \value RGBA_ASTC_8x8 Equivalent to GL_COMPRESSED_RGBA_ASTC_8x8_KHR \value RGBA_ASTC_10x5 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x5_KHR \value RGBA_ASTC_10x6 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x6_KHR \value RGBA_ASTC_10x8 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x8_KHR \value RGBA_ASTC_10x10 Equivalent to GL_COMPRESSED_RGBA_ASTC_10x10_KHR \value RGBA_ASTC_12x10 Equivalent to GL_COMPRESSED_RGBA_ASTC_12x10_KHR \value RGBA_ASTC_12x12 Equivalent to GL_COMPRESSED_RGBA_ASTC_12x12_KHR \value SRGB8_Alpha8_ASTC_4x4 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR \value SRGB8_Alpha8_ASTC_5x4 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR \value SRGB8_Alpha8_ASTC_5x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR \value SRGB8_Alpha8_ASTC_6x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR \value SRGB8_Alpha8_ASTC_6x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR \value SRGB8_Alpha8_ASTC_8x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR \value SRGB8_Alpha8_ASTC_8x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR \value SRGB8_Alpha8_ASTC_8x8 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR \value SRGB8_Alpha8_ASTC_10x5 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR \value SRGB8_Alpha8_ASTC_10x6 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR \value SRGB8_Alpha8_ASTC_10x8 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR \value SRGB8_Alpha8_ASTC_10x10 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR \value SRGB8_Alpha8_ASTC_12x10 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR \value SRGB8_Alpha8_ASTC_12x12 Equivalent to GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
\value SRGB8 Equivalent to GL_SRGB8 \value SRGB8_Alpha8 Equivalent to GL_SRGB8_ALPHA8 \value SRGB_DXT1 Equivalent to GL_COMPRESSED_SRGB_S3TC_DXT1_EXT \value SRGB_Alpha_DXT1 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT \value SRGB_Alpha_DXT3 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT \value SRGB_Alpha_DXT5 Equivalent to GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT \value SRGB_BP_UNorm Equivalent to GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB
\value DepthFormat Equivalent to GL_DEPTH_COMPONENT (only OpenGL ES 3 or ES 2 with OES_depth_texture) \value AlphaFormat Equivalent to GL_ALPHA (OpenGL ES 2 only) \value RGBFormat Equivalent to GL_RGB (OpenGL ES 2 only) \value RGBAFormat Equivalent to GL_RGBA (OpenGL ES 2 only) \value LuminanceFormat Equivalent to GL_LUMINANCE (OpenGL ES 2 only) \value LuminanceAlphaFormat Equivalent to GL_LUMINANCE_ALPHA (OpenGL ES 2 only)
Definition at line 67 of file qopengltexture.h.
Definition at line 228 of file qopengltexture.h.
This enum defines options ot control texture unit activation.
\value ResetTextureUnit The previous active texture unit will be reset \value DontResetTextureUnit The previous active texture unit will not be rest
Enumerator | |
---|---|
ResetTextureUnit | |
DontResetTextureUnit |
Definition at line 61 of file qopengltexture.h.
This enum defines the possible texture coordinate wrapping modes.
\value Repeat Texture coordinate is repeated. Equivalent to GL_REPEAT \value MirroredRepeat Texture coordinate is reflected about 0 and 1. Equivalent to GL_MIRRORED_REPEAT \value ClampToEdge Clamps the texture coordinates to [0,1]. Equivalent to GL_CLAMP_TO_EDGE \value ClampToBorder As for ClampToEdge but also blends samples at 0 and 1 with a fixed border color. Equivalent to GL_CLAMP_TO_BORDER
Enumerator | |
---|---|
Repeat | |
MirroredRepeat | |
ClampToEdge | |
ClampToBorder |
Definition at line 331 of file qopengltexture.h.
|
explicit |
Creates a 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.
Definition at line 2445 of file qopengltexture.cpp.
|
explicit |
Creates a 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.
Definition at line 2463 of file qopengltexture.cpp.
QOpenGLTexture::~QOpenGLTexture | ( | ) |
Definition at line 2469 of file qopengltexture.cpp.
void 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.
Definition at line 3261 of file qopengltexture.cpp.
void QOpenGLTexture::allocateStorage | ( | QOpenGLTexture::PixelFormat | pixelFormat, |
QOpenGLTexture::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() call.
Once storage has been allocated for the texture then pixel data can be uploaded via one of the setData() overloads.
Definition at line 3293 of file qopengltexture.cpp.
void 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.
Definition at line 2551 of file qopengltexture.cpp.
void QOpenGLTexture::bind | ( | uint | unit, |
TextureUnitReset | reset = DontResetTextureUnit ) |
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.
Definition at line 2570 of file qopengltexture.cpp.
QColor QOpenGLTexture::borderColor | ( | ) | const |
Returns the borderColor of this texture.
Definition at line 4588 of file qopengltexture.cpp.
void QOpenGLTexture::borderColor | ( | float * | border | ) | const |
Writes the texture border color into the first four elements of the array pointed to by border.
Definition at line 4607 of file qopengltexture.cpp.
void QOpenGLTexture::borderColor | ( | int * | border | ) | const |
Writes the texture border color into the first four elements of the array pointed to by border.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4626 of file qopengltexture.cpp.
void QOpenGLTexture::borderColor | ( | unsigned int * | border | ) | const |
Writes the texture border color into the first four elements of the array pointed to by border.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4645 of file qopengltexture.cpp.
|
static |
Returns the textureId of the texture that is bound to the target of the currently active texture unit.
Definition at line 2631 of file qopengltexture.cpp.
|
static |
Returns the textureId of the texture that is bound to the target of the texture unit unit.
Definition at line 2648 of file qopengltexture.cpp.
QOpenGLTexture::ComparisonFunction QOpenGLTexture::comparisonFunction | ( | ) | const |
Returns the texture comparison operator set on this texture. By default, a texture has a CompareLessEqual comparison function.
Definition at line 4266 of file qopengltexture.cpp.
QOpenGLTexture::ComparisonMode QOpenGLTexture::comparisonMode | ( | ) | const |
Returns the texture comparison mode set on this texture. By default, a texture has a CompareNone comparison mode (i.e. comparisons are disabled).
Definition at line 4309 of file qopengltexture.cpp.
bool QOpenGLTexture::create | ( | ) |
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 true
if the creation succeeded, otherwise returns false
.
Definition at line 2501 of file qopengltexture.cpp.
QOpenGLTexture * QOpenGLTexture::createTextureView | ( | Target | target, |
TextureFormat | viewFormat, | ||
int | minimumMipmapLevel, | ||
int | maximumMipmapLevel, | ||
int | minimumLayer, | ||
int | maximumLayer ) const |
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 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.
The minimumMipmapLevel, maximumMipmapLevel, minimumLayer, and 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
true
from its isTextureView() function.Definition at line 3347 of file qopengltexture.cpp.
int QOpenGLTexture::depth | ( | ) | const |
Returns the depth of a 3D texture.
Definition at line 2977 of file qopengltexture.cpp.
QOpenGLTexture::DepthStencilMode QOpenGLTexture::depthStencilMode | ( | ) | const |
Returns the depth stencil mode for textures using a combined depth/stencil format.
Definition at line 4214 of file qopengltexture.cpp.
void QOpenGLTexture::destroy | ( | ) |
Destroys the underlying OpenGL texture object.
This requires a current valid OpenGL context.
Definition at line 2513 of file qopengltexture.cpp.
int QOpenGLTexture::faces | ( | ) | const |
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.
Definition at line 3110 of file qopengltexture.cpp.
QOpenGLTexture::TextureFormat QOpenGLTexture::format | ( | ) | const |
Returns the format of this texture object.
Definition at line 2878 of file qopengltexture.cpp.
void 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.
Definition at line 4041 of file qopengltexture.cpp.
void QOpenGLTexture::generateMipMaps | ( | int | baseLevel, |
bool | resetBaseLevel = true ) |
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.
Definition at line 4066 of file qopengltexture.cpp.
|
static |
Returns true
if your OpenGL implementation and version supports the texture feature feature.
Definition at line 3735 of file qopengltexture.cpp.
int QOpenGLTexture::height | ( | ) | const |
Returns the height of a 2D or 3D texture.
Definition at line 2966 of file qopengltexture.cpp.
bool QOpenGLTexture::isAutoMipMapGenerationEnabled | ( | ) | const |
Returns whether auto mipmap generation is enabled for this texture object.
Definition at line 4025 of file qopengltexture.cpp.
bool QOpenGLTexture::isBound | ( | ) | const |
Returns true
if this texture is bound to the corresponding target of the currently active texture unit.
Definition at line 2607 of file qopengltexture.cpp.
bool QOpenGLTexture::isBound | ( | uint | unit | ) |
Returns true
if this texture is bound to the corresponding target of texture unit unit.
Definition at line 2620 of file qopengltexture.cpp.
bool QOpenGLTexture::isCreated | ( | ) | const |
Returns true
if the underlying OpenGL texture object has been created.
Definition at line 2524 of file qopengltexture.cpp.
bool QOpenGLTexture::isFixedSamplePositions | ( | ) | const |
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
.
Definition at line 3229 of file qopengltexture.cpp.
bool QOpenGLTexture::isStorageAllocated | ( | ) | const |
Returns 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.
Definition at line 3309 of file qopengltexture.cpp.
bool QOpenGLTexture::isTextureView | ( | ) | const |
Returns true
if this texture object is actually a view onto another texture object.
Definition at line 3370 of file qopengltexture.cpp.
int QOpenGLTexture::layers | ( | ) | const |
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.
Definition at line 3098 of file qopengltexture.cpp.
float QOpenGLTexture::levelofDetailBias | ( | ) | const |
Returns the level of detail bias parameter.
Definition at line 4803 of file qopengltexture.cpp.
std::pair< float, float > QOpenGLTexture::levelOfDetailRange | ( | ) | const |
Returns the minimum and maximum level of detail parameters.
Definition at line 4765 of file qopengltexture.cpp.
QOpenGLTexture::Filter QOpenGLTexture::magnificationFilter | ( | ) | const |
Returns the magnification filter.
Definition at line 4361 of file qopengltexture.cpp.
float QOpenGLTexture::maximumAnisotropy | ( | ) | const |
Returns the maximum level of anisotropy to be accounted for when performing texture lookups.
This requires the GL_EXT_texture_filter_anisotropic extension.
Definition at line 4423 of file qopengltexture.cpp.
float QOpenGLTexture::maximumLevelOfDetail | ( | ) | const |
Returns the maximum level of detail parameter.
Definition at line 4726 of file qopengltexture.cpp.
int QOpenGLTexture::maximumMipLevels | ( | ) | const |
Returns the maximum number of mipmap levels that this texture can have given the current dimensions.
Definition at line 3043 of file qopengltexture.cpp.
QOpenGLTexture::Filter QOpenGLTexture::minificationFilter | ( | ) | const |
Returns the minification filter.
Definition at line 4335 of file qopengltexture.cpp.
float QOpenGLTexture::minimumLevelOfDetail | ( | ) | const |
Returns the minimum level of detail parameter.
Definition at line 4689 of file qopengltexture.cpp.
std::pair< QOpenGLTexture::Filter, QOpenGLTexture::Filter > QOpenGLTexture::minMagFilters | ( | ) | const |
Returns the current minification and magnification filters.
Definition at line 4391 of file qopengltexture.cpp.
int QOpenGLTexture::mipBaseLevel | ( | ) | const |
Returns the mipmap base level used for all texture lookups with this texture.
The default is 0.
Definition at line 3933 of file qopengltexture.cpp.
std::pair< int, int > QOpenGLTexture::mipLevelRange | ( | ) | const |
Returns the range of mipmap levels that can be used for texture lookups with this texture.
Definition at line 3998 of file qopengltexture.cpp.
int QOpenGLTexture::mipLevels | ( | ) | const |
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.
Definition at line 3031 of file qopengltexture.cpp.
int QOpenGLTexture::mipMaxLevel | ( | ) | const |
Returns the mipmap maximum level used for all texture lookups with this texture.
Definition at line 3965 of file qopengltexture.cpp.
void QOpenGLTexture::release | ( | ) |
Unbinds this texture from the currently active texture unit.
Definition at line 2582 of file qopengltexture.cpp.
void QOpenGLTexture::release | ( | uint | unit, |
TextureUnitReset | reset = DontResetTextureUnit ) |
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.
Definition at line 2595 of file qopengltexture.cpp.
int QOpenGLTexture::samples | ( | ) | const |
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.
Definition at line 3167 of file qopengltexture.cpp.
void QOpenGLTexture::setAutoMipMapGenerationEnabled | ( | bool | enabled | ) |
If 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.
Definition at line 4014 of file qopengltexture.cpp.
Sets the border color of the texture to color.
Definition at line 4474 of file qopengltexture.cpp.
void QOpenGLTexture::setBorderColor | ( | float | r, |
float | g, | ||
float | b, | ||
float | a ) |
Sets the color red to {r}, green to {g}, blue to {b}, and {a} to the alpha value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4485 of file qopengltexture.cpp.
void QOpenGLTexture::setBorderColor | ( | int | r, |
int | g, | ||
int | b, | ||
int | a ) |
Sets the color red to {r}, green to {g}, blue to {b}, and the alpha value to {a}.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4518 of file qopengltexture.cpp.
Sets the color red to {r}, green to {g}, blue to {b}, and the alpha value to {a}.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4553 of file qopengltexture.cpp.
void QOpenGLTexture::setComparisonFunction | ( | QOpenGLTexture::ComparisonFunction | function | ) |
Sets the texture comparison function on this texture to function. The texture comparison function is used by shadow samplers when sampling a depth texture.
Definition at line 4246 of file qopengltexture.cpp.
void QOpenGLTexture::setComparisonMode | ( | QOpenGLTexture::ComparisonMode | mode | ) |
Sets the texture comparison mode on this texture to mode. The texture comparison mode is used by shadow samplers when sampling a depth texture.
Definition at line 4289 of file qopengltexture.cpp.
void QOpenGLTexture::setCompressedData | ( | int | dataSize, |
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3723 of file qopengltexture.cpp.
void QOpenGLTexture::setCompressedData | ( | int | mipLevel, |
int | dataSize, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3712 of file qopengltexture.cpp.
void QOpenGLTexture::setCompressedData | ( | int | mipLevel, |
int | layer, | ||
CubeMapFace | cubeFace, | ||
int | dataSize, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Uploads compressed pixel data to mipLevel, array layer, and cubeFace.
The pixel transfer can optionally be controlled with options. The dataSize argument 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.
Definition at line 3665 of file qopengltexture.cpp.
void QOpenGLTexture::setCompressedData | ( | int | mipLevel, |
int | layer, | ||
int | dataSize, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3701 of file qopengltexture.cpp.
void QOpenGLTexture::setCompressedData | ( | int | mipLevel, |
int | layer, | ||
int | layerCount, | ||
QOpenGLTexture::CubeMapFace | cubeFace, | ||
int | dataSize, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Parameter layerCount is the number of layers in a texture array that are being uploaded/populated by this call.
Definition at line 3686 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | const QImage & | image, |
MipMapGeneration | genMipMaps = GenerateMipMaps ) |
This overload of setData() will allocate storage for you.
The pixel data is contained in image. Mipmaps are generated by default. Set genMipMaps to \l DontGenerateMipMaps to turn off mipmap generation.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3621 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | mipLevel, |
int | layer, | ||
CubeMapFace | cubeFace, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Uploads pixel data for 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 data is specified by sourceFormat and 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.
Definition at line 3393 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | mipLevel, |
int | layer, | ||
int | layerCount, | ||
QOpenGLTexture::CubeMapFace | cubeFace, | ||
QOpenGLTexture::PixelFormat | sourceFormat, | ||
QOpenGLTexture::PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Parameter layerCount is the number of layers in a texture array that are being uploaded/populated by this call.
Definition at line 3414 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | mipLevel, |
int | layer, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Definition at line 3430 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | mipLevel, |
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Definition at line 3443 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | xOffset, |
int | yOffset, | ||
int | zOffset, | ||
int | width, | ||
int | height, | ||
int | depth, | ||
int | mipLevel, | ||
int | layer, | ||
CubeMapFace | face, | ||
int | layerCount, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
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.
Definition at line 3595 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | xOffset, |
int | yOffset, | ||
int | zOffset, | ||
int | width, | ||
int | height, | ||
int | depth, | ||
int | mipLevel, | ||
int | layer, | ||
CubeMapFace | face, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
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.
Definition at line 3564 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | xOffset, |
int | yOffset, | ||
int | zOffset, | ||
int | width, | ||
int | height, | ||
int | depth, | ||
int | mipLevel, | ||
int | layer, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
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.
Definition at line 3534 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | xOffset, |
int | yOffset, | ||
int | zOffset, | ||
int | width, | ||
int | height, | ||
int | depth, | ||
int | mipLevel, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
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 the sub image we want to update is specified with mipLevel.
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.
Definition at line 3505 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | int | xOffset, |
int | yOffset, | ||
int | zOffset, | ||
int | width, | ||
int | height, | ||
int | depth, | ||
PixelFormat | sourceFormat, | ||
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
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.
Definition at line 3477 of file qopengltexture.cpp.
void QOpenGLTexture::setData | ( | PixelFormat | sourceFormat, |
PixelType | sourceType, | ||
const void * | data, | ||
const QOpenGLPixelTransferOptions *const | options = nullptr ) |
Definition at line 3456 of file qopengltexture.cpp.
void QOpenGLTexture::setDepthStencilMode | ( | QOpenGLTexture::DepthStencilMode | mode | ) |
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.
Definition at line 4186 of file qopengltexture.cpp.
void QOpenGLTexture::setFixedSamplePositions | ( | bool | fixed | ) |
Sets whether the sample positions and number of samples used with a multisample capable texture target to fixed.
If set to 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.
The default value is true
.
Definition at line 3188 of file qopengltexture.cpp.
void QOpenGLTexture::setFormat | ( | TextureFormat | format | ) |
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.
Definition at line 2679 of file qopengltexture.cpp.
void QOpenGLTexture::setLayers | ( | int | layers | ) |
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.
Definition at line 3058 of file qopengltexture.cpp.
void QOpenGLTexture::setLevelofDetailBias | ( | float | bias | ) |
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.
Definition at line 4780 of file qopengltexture.cpp.
void QOpenGLTexture::setLevelOfDetailRange | ( | float | min, |
float | max ) |
Sets the minimum level of detail parameters to min and the maximum level to max.
Definition at line 4738 of file qopengltexture.cpp.
void QOpenGLTexture::setMagnificationFilter | ( | QOpenGLTexture::Filter | filter | ) |
Sets the magnification filter to filter.
Definition at line 4346 of file qopengltexture.cpp.
void QOpenGLTexture::setMaximumAnisotropy | ( | float | anisotropy | ) |
If your OpenGL implementation supports the GL_EXT_texture_filter_anisotropic extension this function sets the maximum anisotropy level to anisotropy.
Definition at line 4403 of file qopengltexture.cpp.
void QOpenGLTexture::setMaximumLevelOfDetail | ( | float | value | ) |
Sets the maximum level of detail to value.
This limits the selection of lowest resolution mipmap (highest mipmap level). The default value is 1000.
Definition at line 4702 of file qopengltexture.cpp.
void QOpenGLTexture::setMinificationFilter | ( | QOpenGLTexture::Filter | filter | ) |
Sets the filter used for minification to filter.
Definition at line 4320 of file qopengltexture.cpp.
void QOpenGLTexture::setMinimumLevelOfDetail | ( | float | value | ) |
Sets the minimum level of detail to value.
This limits the selection of highest resolution mipmap (lowest mipmap level). The default value is -1000.
Definition at line 4665 of file qopengltexture.cpp.
void QOpenGLTexture::setMinMagFilters | ( | QOpenGLTexture::Filter | minificationFilter, |
QOpenGLTexture::Filter | magnificationFilter ) |
Sets the minification filter to minificationFilter and the magnification filter to magnificationFilter.
Definition at line 4373 of file qopengltexture.cpp.
void QOpenGLTexture::setMipBaseLevel | ( | int | baseLevel | ) |
Sets the base mipmap level used for all texture lookups with this texture to baseLevel.
Definition at line 3912 of file qopengltexture.cpp.
void QOpenGLTexture::setMipLevelRange | ( | int | baseLevel, |
int | maxLevel ) |
Sets the range of mipmap levels that can be used for texture lookups with this texture to range from baseLevel to maxLevel.
Definition at line 3978 of file qopengltexture.cpp.
void QOpenGLTexture::setMipLevels | ( | int | levels | ) |
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.
Definition at line 2994 of file qopengltexture.cpp.
void QOpenGLTexture::setMipMaxLevel | ( | int | maxLevel | ) |
Sets the maximum mipmap level used for all texture lookups with this texture to maxLevel.
Definition at line 3945 of file qopengltexture.cpp.
void QOpenGLTexture::setSamples | ( | int | samples | ) |
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.
Definition at line 3126 of file qopengltexture.cpp.
void QOpenGLTexture::setSize | ( | int | width, |
int | height = 1, | ||
int | depth = 1 ) |
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, 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.
Definition at line 2902 of file qopengltexture.cpp.
void QOpenGLTexture::setSwizzleMask | ( | SwizzleComponent | component, |
SwizzleValue | value ) |
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 options.
This function maps component to the output value.
Definition at line 4097 of file qopengltexture.cpp.
void QOpenGLTexture::setSwizzleMask | ( | SwizzleValue | r, |
SwizzleValue | g, | ||
SwizzleValue | b, | ||
SwizzleValue | a ) |
Parameters {r}, {g}, {b}, and {a} are values used for setting the colors red, green, blue, and the alpha value.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4125 of file qopengltexture.cpp.
void QOpenGLTexture::setWrapMode | ( | QOpenGLTexture::CoordinateDirection | direction, |
QOpenGLTexture::WrapMode | mode ) |
Sets the wrap (or repeat mode) for the texture dimension direction to mode.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4448 of file qopengltexture.cpp.
void QOpenGLTexture::setWrapMode | ( | QOpenGLTexture::WrapMode | mode | ) |
Sets the wrap (or repeat mode) for all texture dimensions to mode.
Definition at line 4434 of file qopengltexture.cpp.
QOpenGLTexture::SwizzleValue QOpenGLTexture::swizzleMask | ( | SwizzleComponent | component | ) | const |
Returns the swizzle mask for texture component.
Definition at line 4158 of file qopengltexture.cpp.
QOpenGLTexture::Target QOpenGLTexture::target | ( | ) | const |
Returns the binding target of this texture.
Definition at line 2478 of file qopengltexture.cpp.
GLuint QOpenGLTexture::textureId | ( | ) | const |
Returns the name of the underlying OpenGL texture object or 0 if it has not yet been created.
Definition at line 2536 of file qopengltexture.cpp.
int QOpenGLTexture::width | ( | ) | const |
Returns the width of a 1D, 2D or 3D texture.
Definition at line 2955 of file qopengltexture.cpp.
QOpenGLTexture::WrapMode QOpenGLTexture::wrapMode | ( | QOpenGLTexture::CoordinateDirection | direction | ) | const |
Returns the wrap mode for the texture dimension direction.
Definition at line 4462 of file qopengltexture.cpp.
|
friend |