-
Notifications
You must be signed in to change notification settings - Fork 466
Filter Flags
| DirectXTex |
|---|
enum TEX_FILTER_FLAGS : uint32_tTEX_FILTER_DEFAULT Default flags.
This selects the filtering mode used for resizing and mipmap generation. In most cases it defaults to using "Fant" (aka "Box").
-
TEX_FILTER_POINTNearest neighbhor -
TEX_FILTER_LINEARBilinear/Trilinear interpolation -
TEX_FILTER_CUBICBicubic/Tricubic interpoloation -
TEX_FILTER_FANTFant which is equivalent to a box filter for down-scaling. -
TEX_FILTER_BOXBox filter (alias for Fant since they are equivalent for down-scaling). When using the non-WIC codepaths, Box filter fails if the texture is not a power of 2 in width & height. -
TEX_FILTER_TRIANGLEFinite low-pass triangle filter. This is not supported by WIC so always uses custom filtering paths.
The legacy D3DX library implemented Point, Linear, Box, and Triangle.
This selects the use of dithering for format conversions. By default it uses no dithering.
-
TEX_FILTER_DITHER4x4 ordered dithering -
TEX_FILTER_DITHER_DIFFUSIONError-diffusion dithering (aka Floyd–Steinberg dithering)
This controls how edge pixels are filtered. It defaults to CLAMP which is the only one supported by the WIC code paths. These have no impact on POINT or BOX filtering methods.
-
TEX_FILTER_WRAP_U -
TEX_FILTER_WRAP_V -
TEX_FILTER_WRAP_W -
TEX_FILTER_WRAPThese indicates the texture will be used with wrap texture addressing modesD3D11_TEXTURE_ADDRESS_WRAPin U, V, and/or W. This affects Linear, Cubic, and Triangle filtering. -
TEX_FILTER_MIRROR_U -
TEX_FILTER_MIRROR_V -
TEX_FILTER_MIRROR_W -
TEX_FILTER_MIRRORThese indicates the texture will be used with mirror texture addressing modesD3D11_TEXTURE_ADDRESS_MIRRORin U, V, and/or W. This affects Cubic filtering. For Linear and Triangle filtering, MIRROR and the default of clamp give the same result.
This controls color space transformation for conversions.
-
TEX_FILTER_SRGB_INIndicates the input format is the sRGB format. This is implied if using aDXGI_FORMAT_*_SRGBformat -
TEX_FILTER_SRGB_OUTIndicates the output format is the sRGB format. This is implied if using aDXGI_FORMAT_*_SRGBformat -
TEX_FILTER_SRGBThis is the same as setting bothTEX_FILTER_SRGB_INandTEX_FILTER_SRGB_OUT
The sRGB color space overall is approximately equivalent to gamma 2.2. It's actually linear below a threshold, and gamma 2.4 beyond that.
When both WIC-based and non-WIC based codepaths are in place, these flags can influence the standard logic choice. These are primarily used for testing and debugging purposes.
TEX_FILTER_FORCE_NON_WICTEX_FILTER_FORCE_WIC
TEX_FILTER_SEPARATE_ALPHA WIC makes use of pre-multiplied alpha when resizing images, which works fine for standard transparency data. If the alpha channel, however, contains some other kind of value then the resulting image can have 'holes' in it. Use of this flag uses an alternative algorithm which resizes the RGB and alpha channels independantly and then recombines the result. This flag is not used by the non-WIC code paths, but will cause the Convert() function to use non-WIC paths.
For Convert operations, these flags control special-case logic in the non-WIC paths. Without these flags, RGB to R conversions default to converting to a luminance value and RGB to RG conversion defaults to copying the RED and GREEN channels. These are implemented in the non-WIC code paths.
-
TEX_FILTER_RGB_COPY_REDWhen converting from RGB to R formats, this indicates that the RED channel could be copied. For RGB to RG conversions, it can be combined with GREEN or BLUE to control which channels end up in the output. -
TEX_FILTER_RGB_COPY_GREENWhen converting from RGB to R formats, this indicates that the GREEN channel could be copied. For RGB to RG conversions, it can be combined with RED or BLUE to control which channels end up in the output. -
TEX_FILTER_RGB_COPY_BLUEWhen converting from RGB to R formats, this indicates that the BLUE channel could be copied. For RGB to RG conversions, it can be combined with RED or GREEN to control which channels end up in the output. -
TEX_FILTER_RGB_COPY_ALPHAWhen converting from RGB(A) to R formats, this indicates that the ALPHA channel could be copied. For RGB(A) to RG conversions, it can be combined with RED or GREEN or BLUE to control which channels end up in the output.
For Convert operations, these flags enable special-case logic in the non-WIC paths.
-
TEX_FILTER_FLOAT_X2BIASEnables special*2 -1conversion cases for converting unorm <-> float, and positive-only-floats <-> float/snorm. These are typically used with normal maps.
All content and source code for this package are subject to the terms of the MIT License.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
- x86
- x64
- ARM64
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v20
- GCC 10.5, 11.4, 12.3, 13.3, 14.2
- MinGW 12.2, 13.2
- CMake 3.21
DirectX Tool Kit for DirectX 11