summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/hid/irsensor/moment_processor.h
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2022-07-24 19:31:28 +0200
committerGitHub <noreply@github.com>2022-07-24 19:31:28 +0200
commit5af06d14337a61d9ed1093079d13f68cbb1f5451 (patch)
tree88df3fada076b04c2ab2da8972d1d785f492b520 /src/core/hle/service/hid/irsensor/moment_processor.h
parentMerge pull request #8545 from Kelebek1/Audio (diff)
parentyuzu: Add webcam support and rebase to latest master (diff)
downloadyuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar.gz
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar.bz2
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar.lz
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar.xz
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.tar.zst
yuzu-5af06d14337a61d9ed1093079d13f68cbb1f5451.zip
Diffstat (limited to 'src/core/hle/service/hid/irsensor/moment_processor.h')
-rw-r--r--src/core/hle/service/hid/irsensor/moment_processor.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/core/hle/service/hid/irsensor/moment_processor.h b/src/core/hle/service/hid/irsensor/moment_processor.h
new file mode 100644
index 000000000..d4bd22e0f
--- /dev/null
+++ b/src/core/hle/service/hid/irsensor/moment_processor.h
@@ -0,0 +1,61 @@
+// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#include "common/bit_field.h"
+#include "common/common_types.h"
+#include "core/hid/irs_types.h"
+#include "core/hle/service/hid/irsensor/processor_base.h"
+
+namespace Service::IRS {
+class MomentProcessor final : public ProcessorBase {
+public:
+ explicit MomentProcessor(Core::IrSensor::DeviceFormat& device_format);
+ ~MomentProcessor() override;
+
+ // Called when the processor is initialized
+ void StartProcessor() override;
+
+ // Called when the processor is suspended
+ void SuspendProcessor() override;
+
+ // Called when the processor is stopped
+ void StopProcessor() override;
+
+ // Sets config parameters of the camera
+ void SetConfig(Core::IrSensor::PackedMomentProcessorConfig config);
+
+private:
+ // This is nn::irsensor::MomentProcessorConfig
+ struct MomentProcessorConfig {
+ Core::IrSensor::CameraConfig camera_config;
+ Core::IrSensor::IrsRect window_of_interest;
+ Core::IrSensor::MomentProcessorPreprocess preprocess;
+ u32 preprocess_intensity_threshold;
+ };
+ static_assert(sizeof(MomentProcessorConfig) == 0x28,
+ "MomentProcessorConfig is an invalid size");
+
+ // This is nn::irsensor::MomentStatistic
+ struct MomentStatistic {
+ f32 average_intensity;
+ Core::IrSensor::IrsCentroid centroid;
+ };
+ static_assert(sizeof(MomentStatistic) == 0xC, "MomentStatistic is an invalid size");
+
+ // This is nn::irsensor::MomentProcessorState
+ struct MomentProcessorState {
+ s64 sampling_number;
+ u64 timestamp;
+ Core::IrSensor::CameraAmbientNoiseLevel ambient_noise_level;
+ INSERT_PADDING_BYTES(4);
+ std::array<MomentStatistic, 0x30> stadistic;
+ };
+ static_assert(sizeof(MomentProcessorState) == 0x258, "MomentProcessorState is an invalid size");
+
+ MomentProcessorConfig current_config{};
+ Core::IrSensor::DeviceFormat& device;
+};
+
+} // namespace Service::IRS