Table of Contents
DirectXTex |
---|
Flip and/or rotate an image.
HRESULT FlipRotate( const Image& srcImage, TEX_FR_FLAGS flags, ScratchImage& image );
HRESULT FlipRotate( const Image* srcImages, size_t nimages,
const TexMetadata& metadata
TEX_FR_FLAGS flags, ScratchImage& result );
WIC is not supported on Linux or Windows Subsystem for Linux, so these functions are not supported for non-Win32 platforms. WIC2 is supported on Xbox One and Xbox Series X|S.
Parameters
flags: Combination of options to apply
Optionally a rotation
TEX_FR_ROTATE0
Rotate by 0 degrees (no-op)TEX_FR_ROTATE90
Rotate by 90 degreesTEX_FR_ROTATE180
Rotate by 180 degreesTEX_FR_ROTATE270
Rotate by 270 degrees
Optionally a flip
TEX_FR_FLIP_HORIZONTAL
Horizonal flipTEX_FR_FLIP_VERTICAL
Vertical flip
Example
ScratchImage srcImage;
...
ScratchImage destImage;
hr = FlipRotate( srcImage.GetImages(), srcImage.GetImageCount(),
srcImage.GetMetadata(),
TEX_FR_FLIP_HORIZONTAL, destImage );
if ( FAILED(hr) )
...
Remarks
This function does not operate directly on block compressed images. See Decompress and Compress.
This function cannot operate directly on a planar format image. See ConvertToSinglePlane for a method for converting planar data to a format that is supported by this routine.
For Use
- Universal Windows Platform apps
- Windows desktop apps
- Windows 11
- Windows 10
- Windows 8.1
- Windows 7 Service Pack 1
- Xbox One
- Xbox Series X|S
- Windows Subsystem for Linux
Architecture
- x86
- x64
- ARM64
For Development
- Visual Studio 2022
- Visual Studio 2019 (16.11)
- clang/LLVM v12 - v18
- GCC 10.5, 11.4, 12.3
- MinGW 12.2, 13.2
- CMake 3.20
Related Projects
DirectX Tool Kit for DirectX 11
DirectX Tool Kit for DirectX 12
Tools
See also
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 opencode@microsoft.com with any additional questions or comments.