blob: 3da1ad0891c39fdf82b0625b55288bc24c8cfb40 [file] [log] [blame]
// chromeos/services/machine_learning/public/mojom/document_scanner.mojom-blink.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_DOCUMENT_SCANNER_MOJOM_BLINK_H_
#define CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_DOCUMENT_SCANNER_MOJOM_BLINK_H_
#include <stdint.h>
#include <limits>
#include <type_traits>
#include <utility>
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "mojo/public/cpp/bindings/clone_traits.h"
#include "mojo/public/cpp/bindings/equals_traits.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/struct_ptr.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/cpp/bindings/union_traits.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"
#include "chromeos/services/machine_learning/public/mojom/document_scanner.mojom-shared.h"
#include "chromeos/services/machine_learning/public/mojom/document_scanner.mojom-blink-forward.h"
#include "chromeos/services/machine_learning/public/mojom/document_scanner_param_types.mojom-blink-forward.h"
#include "mojo/public/mojom/base/file_path.mojom-blink.h"
#include "ui/gfx/geometry/mojom/geometry.mojom-blink.h"
#include "mojo/public/mojom/base/shared_memory.mojom-blink.h"
#include "mojo/public/cpp/bindings/lib/wtf_clone_equals_util.h"
#include "mojo/public/cpp/bindings/lib/wtf_hash_util.h"
#include "third_party/blink/renderer/platform/wtf/hash_functions.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "mojo/public/cpp/bindings/lib/control_message_handler.h"
#include "mojo/public/cpp/bindings/raw_ptr_impl_ref_traits.h"
#include "base/component_export.h"
#ifdef KYTHE_IS_RUNNING
#pragma kythe_inline_metadata "Metadata comment"
#endif
namespace WTF {
struct chromeos_machine_learning_mojom_internal_DocumentScannerResultStatus_DataHashFn {
static unsigned GetHash(const ::chromeos::machine_learning::mojom::DocumentScannerResultStatus& value) {
using utype = std::underlying_type<::chromeos::machine_learning::mojom::DocumentScannerResultStatus>::type;
return DefaultHash<utype>::Hash().GetHash(static_cast<utype>(value));
}
static bool Equal(const ::chromeos::machine_learning::mojom::DocumentScannerResultStatus& left, const ::chromeos::machine_learning::mojom::DocumentScannerResultStatus& right) {
return left == right;
}
static const bool safe_to_compare_to_empty_or_deleted = true;
};
template <>
struct HashTraits<::chromeos::machine_learning::mojom::DocumentScannerResultStatus>
: public GenericHashTraits<::chromeos::machine_learning::mojom::DocumentScannerResultStatus> {
static_assert(true,
"-1000000 is a reserved enum value");
static_assert(true,
"-1000001 is a reserved enum value");
static const bool kEmptyValueIsZero = false;
static ::chromeos::machine_learning::mojom::DocumentScannerResultStatus EmptyValue() { return static_cast<::chromeos::machine_learning::mojom::DocumentScannerResultStatus>(-1000000); }
static void ConstructDeletedValue(::chromeos::machine_learning::mojom::DocumentScannerResultStatus& slot, bool) {
slot = static_cast<::chromeos::machine_learning::mojom::DocumentScannerResultStatus>(-1000001);
}
static bool IsDeletedValue(const ::chromeos::machine_learning::mojom::DocumentScannerResultStatus& value) {
return value == static_cast<::chromeos::machine_learning::mojom::DocumentScannerResultStatus>(-1000001);
}
};
} // namespace WTF
namespace chromeos {
namespace machine_learning {
namespace mojom {
namespace blink {
class DocumentScannerProxy;
template <typename ImplRefTraits>
class DocumentScannerStub;
class DocumentScannerRequestValidator;
class DocumentScannerResponseValidator;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScanner
: public DocumentScannerInterfaceBase {
public:
static const char Name_[];
static std::pair<uint32_t, const void*> MessageToMethodInfo_(mojo::Message& message);
static const char* MessageToMethodName_(mojo::Message& message);
static constexpr uint32_t Version_ = 1;
static constexpr bool PassesAssociatedKinds_ = false;
static constexpr bool HasSyncMethods_ = false;
static constexpr bool HasUninterruptableMethods_ = false;
using Base_ = DocumentScannerInterfaceBase;
using Proxy_ = DocumentScannerProxy;
template <typename ImplRefTraits>
using Stub_ = DocumentScannerStub<ImplRefTraits>;
using RequestValidator_ = DocumentScannerRequestValidator;
using ResponseValidator_ = DocumentScannerResponseValidator;
enum MethodMinVersions : uint32_t {
kDetectCornersFromNV12ImageMinVersion = 0,
kDetectCornersFromJPEGImageMinVersion = 0,
kDoPostProcessingMinVersion = 0,
};
// crbug.com/1340245 - this causes binary size bloat on Fuchsia, and we're OK
// with not having this data in traces there.
#if !BUILDFLAG(IS_FUCHSIA)
struct DetectCornersFromNV12Image_Sym {
NOINLINE static void IPCSymbol();
};
struct DetectCornersFromJPEGImage_Sym {
NOINLINE static void IPCSymbol();
};
struct DoPostProcessing_Sym {
NOINLINE static void IPCSymbol();
};
#endif // !BUILDFLAG(IS_FUCHSIA)
virtual ~DocumentScanner() = default;
using DetectCornersFromNV12ImageCallback = base::OnceCallback<void(DetectCornersResultPtr)>;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DetectCornersFromNV12Image
virtual void DetectCornersFromNV12Image(::base::ReadOnlySharedMemoryRegion nv12_image, DetectCornersFromNV12ImageCallback callback) = 0;
using DetectCornersFromJPEGImageCallback = base::OnceCallback<void(DetectCornersResultPtr)>;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DetectCornersFromJPEGImage
virtual void DetectCornersFromJPEGImage(::base::ReadOnlySharedMemoryRegion jpeg_image, DetectCornersFromJPEGImageCallback callback) = 0;
using DoPostProcessingCallback = base::OnceCallback<void(DoPostProcessingResultPtr)>;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DoPostProcessing
virtual void DoPostProcessing(::base::ReadOnlySharedMemoryRegion jpeg_image, const WTF::Vector<::gfx::PointF>& corners, ::chromeos::machine_learning::mojom::blink::Rotation rotation, DoPostProcessingCallback callback) = 0;
};
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScannerProxy
: public DocumentScanner {
public:
using InterfaceType = DocumentScanner;
explicit DocumentScannerProxy(mojo::MessageReceiverWithResponder* receiver);
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DetectCornersFromNV12Image
void DetectCornersFromNV12Image(::base::ReadOnlySharedMemoryRegion nv12_image, DetectCornersFromNV12ImageCallback callback) final;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DetectCornersFromJPEGImage
void DetectCornersFromJPEGImage(::base::ReadOnlySharedMemoryRegion jpeg_image, DetectCornersFromJPEGImageCallback callback) final;
// @generated_from: chromeos.machine_learning.mojom.DocumentScanner.DoPostProcessing
void DoPostProcessing(::base::ReadOnlySharedMemoryRegion jpeg_image, const WTF::Vector<::gfx::PointF>& corners, ::chromeos::machine_learning::mojom::blink::Rotation rotation, DoPostProcessingCallback callback) final;
private:
mojo::MessageReceiverWithResponder* receiver_;
};
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScannerStubDispatch {
public:
static bool Accept(DocumentScanner* impl, mojo::Message* message);
static bool AcceptWithResponder(
DocumentScanner* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder);
};
template <typename ImplRefTraits =
mojo::RawPtrImplRefTraits<DocumentScanner>>
class DocumentScannerStub
: public mojo::MessageReceiverWithResponderStatus {
public:
using ImplPointerType = typename ImplRefTraits::PointerType;
DocumentScannerStub() = default;
~DocumentScannerStub() override = default;
void set_sink(ImplPointerType sink) { sink_ = std::move(sink); }
ImplPointerType& sink() { return sink_; }
bool Accept(mojo::Message* message) override {
if (ImplRefTraits::IsNull(sink_))
return false;
return DocumentScannerStubDispatch::Accept(
ImplRefTraits::GetRawPointer(&sink_), message);
}
bool AcceptWithResponder(
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) override {
if (ImplRefTraits::IsNull(sink_))
return false;
return DocumentScannerStubDispatch::AcceptWithResponder(
ImplRefTraits::GetRawPointer(&sink_), message, std::move(responder));
}
private:
ImplPointerType sink_;
};
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScannerRequestValidator : public mojo::MessageReceiver {
public:
bool Accept(mojo::Message* message) override;
};
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScannerResponseValidator : public mojo::MessageReceiver {
public:
bool Accept(mojo::Message* message) override;
};
// @generated_from: chromeos.machine_learning.mojom.DocumentScannerConfig
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DocumentScannerConfig {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<DocumentScannerConfig, T>::value>;
using DataView = DocumentScannerConfigDataView;
using Data_ = internal::DocumentScannerConfig_Data;
template <typename... Args>
static DocumentScannerConfigPtr New(Args&&... args) {
return DocumentScannerConfigPtr(
absl::in_place, std::forward<Args>(args)...);
}
template <typename U>
static DocumentScannerConfigPtr From(const U& u) {
return mojo::TypeConverter<DocumentScannerConfigPtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, DocumentScannerConfig>::Convert(*this);
}
DocumentScannerConfig();
explicit DocumentScannerConfig(
const WTF::String& deprecated_library_dlc_path);
DocumentScannerConfig(
const WTF::String& deprecated_library_dlc_path,
const absl::optional<::base::FilePath>& library_dlc_path);
~DocumentScannerConfig();
// Clone() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Clone() or copy
// constructor/assignment are available for members.
template <typename StructPtrType = DocumentScannerConfigPtr>
DocumentScannerConfigPtr Clone() const;
// Equals() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Equals() or == operator
// are available for members.
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
DocumentScannerConfig::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
DocumentScannerConfig::DataView>(input);
}
// The returned Message is serialized only if the message is moved
// cross-process or cross-language. Otherwise if the message is Deserialized
// as the same UserType |input| will just be moved to |output| in
// DeserializeFromMessage.
template <typename UserType>
static mojo::Message WrapAsMessage(UserType input) {
return mojo::Message(std::make_unique<
internal::DocumentScannerConfig_UnserializedMessageContext<
UserType, DocumentScannerConfig::DataView>>(0, 0, std::move(input)),
MOJO_CREATE_MESSAGE_FLAG_NONE);
}
template <typename UserType>
static bool Deserialize(const void* data,
size_t data_num_bytes,
UserType* output) {
mojo::Message message;
return mojo::internal::DeserializeImpl<DocumentScannerConfig::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return DocumentScannerConfig::Deserialize(
input.size() == 0 ? nullptr : &input.front(), input.size(), output);
}
template <typename UserType>
static bool DeserializeFromMessage(mojo::Message input,
UserType* output) {
auto context = input.TakeUnserializedContext<
internal::DocumentScannerConfig_UnserializedMessageContext<
UserType, DocumentScannerConfig::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<DocumentScannerConfig::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: chromeos.machine_learning.mojom.DocumentScannerConfig.deprecated_library_dlc_path
WTF::String deprecated_library_dlc_path;
// @generated_from: chromeos.machine_learning.mojom.DocumentScannerConfig.library_dlc_path
absl::optional<::base::FilePath> library_dlc_path;
// Serialise this struct into a trace.
void WriteIntoTrace(perfetto::TracedValue traced_context) const;
private:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
};
// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, DocumentScannerConfig::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
// @generated_from: chromeos.machine_learning.mojom.DetectCornersResult
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DetectCornersResult {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<DetectCornersResult, T>::value>;
using DataView = DetectCornersResultDataView;
using Data_ = internal::DetectCornersResult_Data;
template <typename... Args>
static DetectCornersResultPtr New(Args&&... args) {
return DetectCornersResultPtr(
absl::in_place, std::forward<Args>(args)...);
}
template <typename U>
static DetectCornersResultPtr From(const U& u) {
return mojo::TypeConverter<DetectCornersResultPtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, DetectCornersResult>::Convert(*this);
}
DetectCornersResult();
DetectCornersResult(
DocumentScannerResultStatus status,
WTF::Vector<::gfx::PointF> corners);
~DetectCornersResult();
// Clone() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Clone() or copy
// constructor/assignment are available for members.
template <typename StructPtrType = DetectCornersResultPtr>
DetectCornersResultPtr Clone() const;
// Equals() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Equals() or == operator
// are available for members.
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
DetectCornersResult::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
DetectCornersResult::DataView>(input);
}
// The returned Message is serialized only if the message is moved
// cross-process or cross-language. Otherwise if the message is Deserialized
// as the same UserType |input| will just be moved to |output| in
// DeserializeFromMessage.
template <typename UserType>
static mojo::Message WrapAsMessage(UserType input) {
return mojo::Message(std::make_unique<
internal::DetectCornersResult_UnserializedMessageContext<
UserType, DetectCornersResult::DataView>>(0, 0, std::move(input)),
MOJO_CREATE_MESSAGE_FLAG_NONE);
}
template <typename UserType>
static bool Deserialize(const void* data,
size_t data_num_bytes,
UserType* output) {
mojo::Message message;
return mojo::internal::DeserializeImpl<DetectCornersResult::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return DetectCornersResult::Deserialize(
input.size() == 0 ? nullptr : &input.front(), input.size(), output);
}
template <typename UserType>
static bool DeserializeFromMessage(mojo::Message input,
UserType* output) {
auto context = input.TakeUnserializedContext<
internal::DetectCornersResult_UnserializedMessageContext<
UserType, DetectCornersResult::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<DetectCornersResult::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: chromeos.machine_learning.mojom.DetectCornersResult.status
DocumentScannerResultStatus status;
// @generated_from: chromeos.machine_learning.mojom.DetectCornersResult.corners
WTF::Vector<::gfx::PointF> corners;
// Serialise this struct into a trace.
void WriteIntoTrace(perfetto::TracedValue traced_context) const;
private:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
};
// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, DetectCornersResult::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
// @generated_from: chromeos.machine_learning.mojom.DoPostProcessingResult
class COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) DoPostProcessingResult {
public:
template <typename T>
using EnableIfSame = std::enable_if_t<std::is_same<DoPostProcessingResult, T>::value>;
using DataView = DoPostProcessingResultDataView;
using Data_ = internal::DoPostProcessingResult_Data;
template <typename... Args>
static DoPostProcessingResultPtr New(Args&&... args) {
return DoPostProcessingResultPtr(
absl::in_place, std::forward<Args>(args)...);
}
template <typename U>
static DoPostProcessingResultPtr From(const U& u) {
return mojo::TypeConverter<DoPostProcessingResultPtr, U>::Convert(u);
}
template <typename U>
U To() const {
return mojo::TypeConverter<U, DoPostProcessingResult>::Convert(*this);
}
DoPostProcessingResult();
DoPostProcessingResult(
DocumentScannerResultStatus status,
WTF::Vector<uint8_t> processed_jpeg_image);
~DoPostProcessingResult();
// Clone() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Clone() or copy
// constructor/assignment are available for members.
template <typename StructPtrType = DoPostProcessingResultPtr>
DoPostProcessingResultPtr Clone() const;
// Equals() is a template so it is only instantiated if it is used. Thus, the
// bindings generator does not need to know whether Equals() or == operator
// are available for members.
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool Equals(const T& other) const;
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool operator==(const T& rhs) const { return Equals(rhs); }
template <typename UserType>
static WTF::Vector<uint8_t> Serialize(UserType* input) {
return mojo::internal::SerializeImpl<
DoPostProcessingResult::DataView, WTF::Vector<uint8_t>>(input);
}
template <typename UserType>
static mojo::Message SerializeAsMessage(UserType* input) {
return mojo::internal::SerializeAsMessageImpl<
DoPostProcessingResult::DataView>(input);
}
// The returned Message is serialized only if the message is moved
// cross-process or cross-language. Otherwise if the message is Deserialized
// as the same UserType |input| will just be moved to |output| in
// DeserializeFromMessage.
template <typename UserType>
static mojo::Message WrapAsMessage(UserType input) {
return mojo::Message(std::make_unique<
internal::DoPostProcessingResult_UnserializedMessageContext<
UserType, DoPostProcessingResult::DataView>>(0, 0, std::move(input)),
MOJO_CREATE_MESSAGE_FLAG_NONE);
}
template <typename UserType>
static bool Deserialize(const void* data,
size_t data_num_bytes,
UserType* output) {
mojo::Message message;
return mojo::internal::DeserializeImpl<DoPostProcessingResult::DataView>(
message, data, data_num_bytes, output, Validate);
}
template <typename UserType>
static bool Deserialize(const WTF::Vector<uint8_t>& input,
UserType* output) {
return DoPostProcessingResult::Deserialize(
input.size() == 0 ? nullptr : &input.front(), input.size(), output);
}
template <typename UserType>
static bool DeserializeFromMessage(mojo::Message input,
UserType* output) {
auto context = input.TakeUnserializedContext<
internal::DoPostProcessingResult_UnserializedMessageContext<
UserType, DoPostProcessingResult::DataView>>();
if (context) {
*output = std::move(context->TakeData());
return true;
}
input.SerializeIfNecessary();
return mojo::internal::DeserializeImpl<DoPostProcessingResult::DataView>(
input, input.payload(), input.payload_num_bytes(), output, Validate);
}
// @generated_from: chromeos.machine_learning.mojom.DoPostProcessingResult.status
DocumentScannerResultStatus status;
// @generated_from: chromeos.machine_learning.mojom.DoPostProcessingResult.processed_jpeg_image
WTF::Vector<uint8_t> processed_jpeg_image;
// Serialise this struct into a trace.
void WriteIntoTrace(perfetto::TracedValue traced_context) const;
private:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
};
// The comparison operators are templates, so they are only instantiated if they
// are used. Thus, the bindings generator does not need to know whether
// comparison operators are available for members.
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool operator<(const T& lhs, const T& rhs);
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool operator<=(const T& lhs, const T& rhs) {
return !(rhs < lhs);
}
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool operator>(const T& lhs, const T& rhs) {
return rhs < lhs;
}
template <typename T, DoPostProcessingResult::EnableIfSame<T>* = nullptr>
bool operator>=(const T& lhs, const T& rhs) {
return !(lhs < rhs);
}
template <typename StructPtrType>
DocumentScannerConfigPtr DocumentScannerConfig::Clone() const {
return New(
mojo::Clone(deprecated_library_dlc_path),
mojo::Clone(library_dlc_path)
);
}
template <typename T, DocumentScannerConfig::EnableIfSame<T>*>
bool DocumentScannerConfig::Equals(const T& other_struct) const {
if (!mojo::Equals(this->deprecated_library_dlc_path, other_struct.deprecated_library_dlc_path))
return false;
if (!mojo::Equals(this->library_dlc_path, other_struct.library_dlc_path))
return false;
return true;
}
template <typename T, DocumentScannerConfig::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.deprecated_library_dlc_path < rhs.deprecated_library_dlc_path)
return true;
if (rhs.deprecated_library_dlc_path < lhs.deprecated_library_dlc_path)
return false;
if (lhs.library_dlc_path < rhs.library_dlc_path)
return true;
if (rhs.library_dlc_path < lhs.library_dlc_path)
return false;
return false;
}
template <typename StructPtrType>
DetectCornersResultPtr DetectCornersResult::Clone() const {
return New(
mojo::Clone(status),
mojo::Clone(corners)
);
}
template <typename T, DetectCornersResult::EnableIfSame<T>*>
bool DetectCornersResult::Equals(const T& other_struct) const {
if (!mojo::Equals(this->status, other_struct.status))
return false;
if (!mojo::Equals(this->corners, other_struct.corners))
return false;
return true;
}
template <typename T, DetectCornersResult::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.status < rhs.status)
return true;
if (rhs.status < lhs.status)
return false;
if (lhs.corners < rhs.corners)
return true;
if (rhs.corners < lhs.corners)
return false;
return false;
}
template <typename StructPtrType>
DoPostProcessingResultPtr DoPostProcessingResult::Clone() const {
return New(
mojo::Clone(status),
mojo::Clone(processed_jpeg_image)
);
}
template <typename T, DoPostProcessingResult::EnableIfSame<T>*>
bool DoPostProcessingResult::Equals(const T& other_struct) const {
if (!mojo::Equals(this->status, other_struct.status))
return false;
if (!mojo::Equals(this->processed_jpeg_image, other_struct.processed_jpeg_image))
return false;
return true;
}
template <typename T, DoPostProcessingResult::EnableIfSame<T>*>
bool operator<(const T& lhs, const T& rhs) {
if (lhs.status < rhs.status)
return true;
if (rhs.status < lhs.status)
return false;
if (lhs.processed_jpeg_image < rhs.processed_jpeg_image)
return true;
if (rhs.processed_jpeg_image < lhs.processed_jpeg_image)
return false;
return false;
}
} // namespace blink
} // namespace mojom
} // namespace machine_learning
} // namespace chromeos
namespace mojo {
template <>
struct COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) StructTraits<::chromeos::machine_learning::mojom::blink::DocumentScannerConfig::DataView,
::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr> {
static bool IsNull(const ::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr& input) { return !input; }
static void SetToNull(::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr* output) { output->reset(); }
static const decltype(::chromeos::machine_learning::mojom::blink::DocumentScannerConfig::deprecated_library_dlc_path)& deprecated_library_dlc_path(
const ::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr& input) {
return input->deprecated_library_dlc_path;
}
static const decltype(::chromeos::machine_learning::mojom::blink::DocumentScannerConfig::library_dlc_path)& library_dlc_path(
const ::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr& input) {
return input->library_dlc_path;
}
static bool Read(::chromeos::machine_learning::mojom::blink::DocumentScannerConfig::DataView input, ::chromeos::machine_learning::mojom::blink::DocumentScannerConfigPtr* output);
};
template <>
struct COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) StructTraits<::chromeos::machine_learning::mojom::blink::DetectCornersResult::DataView,
::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr> {
static bool IsNull(const ::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr& input) { return !input; }
static void SetToNull(::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr* output) { output->reset(); }
static decltype(::chromeos::machine_learning::mojom::blink::DetectCornersResult::status) status(
const ::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr& input) {
return input->status;
}
static const decltype(::chromeos::machine_learning::mojom::blink::DetectCornersResult::corners)& corners(
const ::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr& input) {
return input->corners;
}
static bool Read(::chromeos::machine_learning::mojom::blink::DetectCornersResult::DataView input, ::chromeos::machine_learning::mojom::blink::DetectCornersResultPtr* output);
};
template <>
struct COMPONENT_EXPORT(MLSERVICE_MOJOM_BLINK) StructTraits<::chromeos::machine_learning::mojom::blink::DoPostProcessingResult::DataView,
::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr> {
static bool IsNull(const ::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr& input) { return !input; }
static void SetToNull(::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr* output) { output->reset(); }
static decltype(::chromeos::machine_learning::mojom::blink::DoPostProcessingResult::status) status(
const ::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr& input) {
return input->status;
}
static const decltype(::chromeos::machine_learning::mojom::blink::DoPostProcessingResult::processed_jpeg_image)& processed_jpeg_image(
const ::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr& input) {
return input->processed_jpeg_image;
}
static bool Read(::chromeos::machine_learning::mojom::blink::DoPostProcessingResult::DataView input, ::chromeos::machine_learning::mojom::blink::DoPostProcessingResultPtr* output);
};
} // namespace mojo
#endif // CHROMEOS_SERVICES_MACHINE_LEARNING_PUBLIC_MOJOM_DOCUMENT_SCANNER_MOJOM_BLINK_H_
/* Metadata comment
eyJtZXRhIjogW3siZW5kIjogNDExNywgImJlZ2luIjogNDEwMiwgImVkZ2UiOiAiJS9reXRoZS9l
ZGdlL2dlbmVyYXRlcyIsICJ0eXBlIjogImFuY2hvcl9kZWZpbmVzIiwgInZuYW1lIjogeyJjb3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