Skip to content

FlipRotate

Chuck Walbourn edited this page May 13, 2023 · 7 revisions
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 degrees
  • TEX_FR_ROTATE180 Rotate by 180 degrees
  • TEX_FR_ROTATE270 Rotate by 270 degrees

Optionally a flip

  • TEX_FR_FLIP_HORIZONTAL Horizonal flip
  • TEX_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

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

DirectXTex Rust bindings

DirectX Tool Kit for DirectX 11

DirectX Tool Kit for DirectX 12

DirectXMesh

DirectXMath

Tools

Test Suite

Content Exporter

DxCapsViewer

See also

DirectX Landing Page

Clone this wiki locally