blob: 8f768029360b9dde14d11f2201331e4e6bbb17db [file] [log] [blame]
// camera/mojo/effects/effects_pipeline.mojom-shared-internal.h is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CAMERA_MOJO_EFFECTS_EFFECTS_PIPELINE_MOJOM_SHARED_INTERNAL_H_
#define CAMERA_MOJO_EFFECTS_EFFECTS_PIPELINE_MOJOM_SHARED_INTERNAL_H_
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/map_data_internal.h"
#include "mojo/public/cpp/bindings/lib/buffer.h"
#include "camera/mojo/file_path.mojom-shared-internal.h"
#include "mojo/public/cpp/bindings/lib/native_enum_data.h"
#include "mojo/public/interfaces/bindings/native_struct.mojom-shared-internal.h"
namespace mojo {
namespace internal {
class ValidationContext;
}
}
namespace cros::mojom {
namespace internal {
class EffectsConfig_Data;
struct CameraEffect_Data {
public:
static bool constexpr kIsExtensible = true;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
struct GpuApi_Data {
public:
static bool constexpr kIsExtensible = true;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
struct BlurLevel_Data {
public:
static bool constexpr kIsExtensible = true;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
case 3:
case 4:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
struct SegmentationModel_Data {
public:
static bool constexpr kIsExtensible = true;
static bool IsKnownValue(int32_t value) {
switch (value) {
case 0:
case 1:
case 2:
return true;
}
return false;
}
static bool Validate(int32_t value,
mojo::internal::ValidationContext* validation_context) {
if (kIsExtensible || IsKnownValue(value))
return true;
ReportValidationError(validation_context,
mojo::internal::VALIDATION_ERROR_UNKNOWN_ENUM_VALUE);
return false;
}
};
#pragma pack(push, 1)
class EffectsConfig_Data {
public:
static bool Validate(const void* data,
mojo::internal::ValidationContext* validation_context);
mojo::internal::StructHeader header_;
int32_t effect;
int32_t blur_level;
int32_t segmentation_gpu_api;
uint16_t graph_max_frames_in_flight;
uint8_t blur_enabled : 1;
uint8_t replace_enabled : 1;
uint8_t relight_enabled : 1;
uint8_t light_intensity_$flag : 1;
uint8_t pad7_[1];
int32_t segmentation_model;
float light_intensity_$value;
mojo::internal::Pointer<::mojo_base::mojom::internal::RelativeFilePath_Data> background_filepath;
private:
friend class mojo::internal::MessageFragment<EffectsConfig_Data>;
EffectsConfig_Data();
~EffectsConfig_Data() = delete;
};
static_assert(sizeof(EffectsConfig_Data) == 40,
"Bad sizeof(EffectsConfig_Data)");
// Used by EffectsConfig::WrapAsMessage to lazily serialize the struct.
template <typename UserType, typename DataView>
struct EffectsConfig_UnserializedMessageContext
: public mojo::internal::UnserializedMessageContext {
public:
static const mojo::internal::UnserializedMessageContext::Tag kMessageTag;
EffectsConfig_UnserializedMessageContext(
uint32_t message_name,
uint32_t message_flags,
UserType input)
: mojo::internal::UnserializedMessageContext(&kMessageTag, message_name, message_flags)
, user_data_(std::move(input)) {}
~EffectsConfig_UnserializedMessageContext() override = default;
UserType TakeData() {
return std::move(user_data_);
}
private:
// mojo::internal::UnserializedMessageContext:
void Serialize(mojo::Message& message) override {
mojo::internal::MessageFragment<EffectsConfig_Data> fragment(message);
mojo::internal::Serialize<DataView>(user_data_, fragment);
}
UserType user_data_;
};
template <typename UserType, typename DataView>
const mojo::internal::UnserializedMessageContext::Tag
EffectsConfig_UnserializedMessageContext<UserType, DataView>::kMessageTag = {};
#pragma pack(pop)
} // namespace internal
} // cros::mojom
#endif // CAMERA_MOJO_EFFECTS_EFFECTS_PIPELINE_MOJOM_SHARED_INTERNAL_H_