libcamera v0.5.1
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
debug_controls.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2024, Google Inc.
4 *
5 * Debug metadata helpers
6 */
7
8#pragma once
9
11
12namespace libcamera {
13
14class DebugMetadata
15{
16public:
17 DebugMetadata() = default;
18
20 void enable(bool enable = true);
21 void setParent(DebugMetadata *parent);
22 void moveEntries(ControlList &list);
23
24 template<typename T, typename V>
25 void set(const Control<T> &ctrl, const V &value)
26 {
27 if (parent_) {
28 parent_->set(ctrl, value);
29 return;
30 }
31
32 if (!enabled_)
33 return;
34
35 cache_.set(ctrl, value);
36 }
37
38 void set(unsigned int id, const ControlValue &value);
39
40private:
41 bool enabled_ = false;
42 DebugMetadata *parent_ = nullptr;
43 ControlList cache_;
44};
45
46} /* namespace libcamera */
Associate a list of ControlId with their values for an object.
Definition controls.h:411
Abstract type representing the value of a control.
Definition controls.h:134
Describe a control and its intrinsic properties.
Definition controls.h:313
Helper to record metadata for later use.
Definition debug_controls.h:15
void moveEntries(ControlList &list)
Move all cached entries into control list list.
Definition debug_controls.cpp:122
void enable(bool enable=true)
Enable or disable metadata handling.
Definition debug_controls.cpp:82
void set(const Control< T > &ctrl, const V &value)
Set the value of ctrl to value.
Definition debug_controls.h:25
void enableByControl(const ControlList &controls)
Enable based on controls::DebugMetadataEnable in the supplied ControlList.
Definition debug_controls.cpp:64
void setParent(DebugMetadata *parent)
Set the parent metadata handler to parent.
Definition debug_controls.cpp:99
Camera controls identifiers.
Namespace for libcamera controls.
Definition control_ids.h:21
Top-level libcamera namespace.
Definition backtrace.h:17