Loading...
Searching...
No Matches
debug_controls.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2024, Google Inc.
*
* Debug metadata helpers
*/
#pragma once
#include <libcamera/control_ids.h>
namespace libcamera {
class DebugMetadata
{
public:
DebugMetadata() = default;
void enableByControl(const ControlList &controls);
void enable(bool enable = true);
void setParent(DebugMetadata *parent);
void moveEntries(ControlList &list);
template<typename T, typename V>
void set(const Control<T> &ctrl, const V &value)
{
if (parent_) {
parent_->set(ctrl, value);
return;
}
if (!enabled_)
return;
cache_.set(ctrl, value);
}
void set(unsigned int id, const ControlValue &value);
private:
bool enabled_ = false;
DebugMetadata *parent_ = nullptr;
ControlList cache_;
};
} /* namespace libcamera */
libcamera::ControlList
Associate a list of ControlId with their values for an object.
Definition controls.h:409
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:22
libcamera
Top-level libcamera namespace.
Definition backtrace.h:17