// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15 #pragma once #ifndef WINRT_Windows_Media_Ocr_H #define WINRT_Windows_Media_Ocr_H #include "winrt/base.h" static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers."); #define CPPWINRT_VERSION "2.0.240405.15" #include "winrt/Windows.Media.h" #include "winrt/impl/Windows.Foundation.2.h" #include "winrt/impl/Windows.Foundation.Collections.2.h" #include "winrt/impl/Windows.Globalization.2.h" #include "winrt/impl/Windows.Graphics.Imaging.2.h" #include "winrt/impl/Windows.Media.Ocr.2.h" namespace winrt::impl { template auto consume_Windows_Media_Ocr_IOcrEngine::RecognizeAsync(winrt::Windows::Graphics::Imaging::SoftwareBitmap const& bitmap) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngine)->RecognizeAsync(*(void**)(&bitmap), &result)); return winrt::Windows::Foundation::IAsyncOperation{ result, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrEngine::RecognizerLanguage() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngine)->get_RecognizerLanguage(&value)); return winrt::Windows::Globalization::Language{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrEngineStatics::MaxImageDimension() const { uint32_t value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngineStatics)->get_MaxImageDimension(&value)); return value; } template auto consume_Windows_Media_Ocr_IOcrEngineStatics::AvailableRecognizerLanguages() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngineStatics)->get_AvailableRecognizerLanguages(&value)); return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrEngineStatics::IsLanguageSupported(winrt::Windows::Globalization::Language const& language) const { bool result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngineStatics)->IsLanguageSupported(*(void**)(&language), &result)); return result; } template auto consume_Windows_Media_Ocr_IOcrEngineStatics::TryCreateFromLanguage(winrt::Windows::Globalization::Language const& language) const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngineStatics)->TryCreateFromLanguage(*(void**)(&language), &result)); return winrt::Windows::Media::Ocr::OcrEngine{ result, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrEngineStatics::TryCreateFromUserProfileLanguages() const { void* result{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrEngineStatics)->TryCreateFromUserProfileLanguages(&result)); return winrt::Windows::Media::Ocr::OcrEngine{ result, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrLine::Words() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrLine)->get_Words(&value)); return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrLine::Text() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrLine)->get_Text(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrResult::Lines() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrResult)->get_Lines(&value)); return winrt::Windows::Foundation::Collections::IVectorView{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrResult::TextAngle() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrResult)->get_TextAngle(&value)); return winrt::Windows::Foundation::IReference{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrResult::Text() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrResult)->get_Text(&value)); return hstring{ value, take_ownership_from_abi }; } template auto consume_Windows_Media_Ocr_IOcrWord::BoundingRect() const { winrt::Windows::Foundation::Rect value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrWord)->get_BoundingRect(put_abi(value))); return value; } template auto consume_Windows_Media_Ocr_IOcrWord::Text() const { void* value{}; check_hresult(WINRT_IMPL_SHIM(winrt::Windows::Media::Ocr::IOcrWord)->get_Text(&value)); return hstring{ value, take_ownership_from_abi }; } #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall RecognizeAsync(void* bitmap, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from>(this->shim().RecognizeAsync(*reinterpret_cast(&bitmap))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_RecognizerLanguage(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().RecognizerLanguage()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_MaxImageDimension(uint32_t* value) noexcept final try { typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().MaxImageDimension()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_AvailableRecognizerLanguages(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().AvailableRecognizerLanguages()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall IsLanguageSupported(void* language, bool* result) noexcept final try { typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().IsLanguageSupported(*reinterpret_cast(&language))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall TryCreateFromLanguage(void* language, void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryCreateFromLanguage(*reinterpret_cast(&language))); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall TryCreateFromUserProfileLanguages(void** result) noexcept final try { clear_abi(result); typename D::abi_guard guard(this->shim()); *result = detach_from(this->shim().TryCreateFromUserProfileLanguages()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Words(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Words()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_Lines(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().Lines()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_TextAngle(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from>(this->shim().TextAngle()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } }; #endif #ifndef WINRT_LEAN_AND_MEAN template struct produce : produce_base { int32_t __stdcall get_BoundingRect(winrt::Windows::Foundation::Rect* value) noexcept final try { zero_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().BoundingRect()); return 0; } catch (...) { return to_hresult(); } int32_t __stdcall get_Text(void** value) noexcept final try { clear_abi(value); typename D::abi_guard guard(this->shim()); *value = detach_from(this->shim().Text()); return 0; } catch (...) { return to_hresult(); } }; #endif } WINRT_EXPORT namespace winrt::Windows::Media::Ocr { inline auto OcrEngine::MaxImageDimension() { return impl::call_factory_cast([](IOcrEngineStatics const& f) { return f.MaxImageDimension(); }); } inline auto OcrEngine::AvailableRecognizerLanguages() { return impl::call_factory_cast(*)(IOcrEngineStatics const&), OcrEngine, IOcrEngineStatics>([](IOcrEngineStatics const& f) { return f.AvailableRecognizerLanguages(); }); } inline auto OcrEngine::IsLanguageSupported(winrt::Windows::Globalization::Language const& language) { return impl::call_factory([&](IOcrEngineStatics const& f) { return f.IsLanguageSupported(language); }); } inline auto OcrEngine::TryCreateFromLanguage(winrt::Windows::Globalization::Language const& language) { return impl::call_factory([&](IOcrEngineStatics const& f) { return f.TryCreateFromLanguage(language); }); } inline auto OcrEngine::TryCreateFromUserProfileLanguages() { return impl::call_factory_cast([](IOcrEngineStatics const& f) { return f.TryCreateFromUserProfileLanguages(); }); } } namespace std { #ifndef WINRT_LEAN_AND_MEAN template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; template<> struct hash : winrt::impl::hash_base {}; #endif #ifdef __cpp_lib_format #endif } #endif