libcamera: include/libcamera/internal/debug_controls.h Source File

libcamera v0.5.0 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
10#include <libcamera/control_ids.h>
11
12namespace libcamera {
13
14 class DebugMetadata
15{
16public:
17 DebugMetadata() = default;
18
19 void enableByControl(const ControlList &controls);
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 */
libcamera::ControlList
Associate a list of ControlId with their values for an object.
Definition controls.h:411
libcamera::ControlValue
Abstract type representing the value of a control.
Definition controls.h:134
libcamera::Control
Describe a control and its intrinsic properties.
Definition controls.h:313
libcamera::DebugMetadata
Helper to record metadata for later use.
Definition debug_controls.h:15
libcamera::DebugMetadata::moveEntries
void moveEntries(ControlList &list)
Move all cached entries into control list list.
Definition debug_controls.cpp:122
libcamera::DebugMetadata::enable
void enable(bool enable=true)
Enable or disable metadata handling.
Definition debug_controls.cpp:82
libcamera::DebugMetadata::set
void set(const Control< T > &ctrl, const V &value)
Set the value of ctrl to value.
Definition debug_controls.h:25
libcamera::DebugMetadata::enableByControl
void enableByControl(const ControlList &controls)
Enable based on controls::DebugMetadataEnable in the supplied ControlList.
Definition debug_controls.cpp:64
libcamera::DebugMetadata::setParent
void setParent(DebugMetadata *parent)
Set the parent metadata handler to parent.
Definition debug_controls.cpp:99
control_ids.h
Camera controls identifiers.
libcamera::controls
Namespace for libcamera controls.
Definition control_ids.h:21
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17