onnxruntime/winml/test/image/imageTestHelper.h
Justin Chu 416dc2e84d
Fix clang-format comment indents on Windows for winml/ (#17144)
On Windows, clang-format has a bug when AlignTrailingComments.Kind is
set to `Leave`
(https://clang.llvm.org/docs/ClangFormatStyleOptions.html#aligntrailingcomments),
where it will keep adding indentation to comments after each formatting
runs.

This PR changes to always align comments so we do not hit the bug.

As a consequence of the options change we need to reformat some of the
files. Note that this option is aligned with the rest of the repository.
2023-08-14 23:50:14 -04:00

46 lines
1.1 KiB
C++

//-----------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
#pragma once
#include <winrt/Windows.Media.h>
#include <winrt/Windows.Graphics.Imaging.h>
enum OutputBindingStrategy {
Bound,
Unbound,
Empty
};
enum EvaluationStrategy {
Async,
Sync
};
enum ModelInputOutputType {
Image,
Tensor
};
enum InputImageSource {
FromVideoFrame,
FromImageFeatureValue,
FromCPUResource,
FromGPUResource
};
enum VideoFrameSource {
FromSoftwareBitmap,
FromDirect3DSurface,
FromUnsupportedD3DSurface
};
namespace ImageTestHelper {
wgi::BitmapPixelFormat GetPixelFormat(const std::wstring& inputPixelFormat);
winml::TensorFloat LoadInputImageFromCPU(wgi::SoftwareBitmap softwareBitmap, const std::wstring& modelPixelFormat);
winml::TensorFloat LoadInputImageFromGPU(wgi::SoftwareBitmap softwareBitmap, const std::wstring& modelPixelFormat);
bool VerifyHelper(wm::VideoFrame actual, wm::VideoFrame expected);
} // namespace ImageTestHelper