libcamera v0.2.0+3-70b69666-nvm
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
swstats_cpu.h
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2023, Linaro Ltd
4 * Copyright (C) 2023, Red Hat Inc.
5 *
6 * Authors:
7 * Hans de Goede <hdegoede@redhat.com>
8 *
9 * swstats_cpu.h - CPU based software statistics implementation
10 */
11
12#pragma once
13
15#include "libcamera/internal/shared_mem_object.h"
16#include "libcamera/internal/software_isp/swisp_stats.h"
17#include "libcamera/internal/software_isp/swstats.h"
18
19namespace libcamera {
20
25class SwStatsCpu : public SwStats
26{
27public:
28 SwStatsCpu();
29 ~SwStatsCpu() { }
30
31 bool isValid() const { return sharedStats_.fd().isValid(); }
32 const SharedFD &getStatsFD() { return sharedStats_.fd(); }
33 int configure(const StreamConfiguration &inputCfg);
34private:
35 int setupStandardBayerOrder(BayerFormat::Order order);
36 /* Bayer 8 bpp unpacked */
37 void statsBGGR8Line0(const uint8_t *src[]);
38 /* Bayer 10 bpp unpacked */
39 void statsBGGR10Line0(const uint8_t *src[]);
40 /* Bayer 12 bpp unpacked */
41 void statsBGGR12Line0(const uint8_t *src[]);
42 /* Bayer 10 bpp packed */
43 void statsBGGR10PLine0(const uint8_t *src[]);
44 void statsGBRG10PLine0(const uint8_t *src[]);
45 /* IGIG_GBGR_IGIG_GRGB 10 bpp unpacked */
46 void statsRGBIR10Line0(const uint8_t *src[]);
47 void statsRGBIR10Line2(const uint8_t *src[]);
48 void resetStats(void);
49 void finishStats(void);
50
51 SharedMemObject<SwIspStats> sharedStats_;
52 SwIspStats stats_;
53 bool swap_lines_;
54};
55
56} /* namespace libcamera */
Class to represent Bayer formats and manipulate them.
Order
The order of the colour channels in the Bayer pattern.
Definition bayer_format.h:25
RAII-style wrapper for file descriptors.
Definition shared_fd.h:17
Helper class for shared memory allocations.
Definition shared_mem_object.h:31
Implementation for the Software statistics on the CPU.
Definition swstats_cpu.h:26
const SharedFD & getStatsFD()
Get the file descriptor for the statistics.
Definition swstats_cpu.h:32
int configure(const StreamConfiguration &inputCfg)
Configure the statistics object for the passed in input format.
Definition swstats_cpu.cpp:301
bool isValid() const
Gets wether the statistics object is valid.
Definition swstats_cpu.h:31
Base class for the software ISP statistics.
Definition swstats.h:36
Top-level libcamera namespace.
Definition backtrace.h:17
Configuration parameters for a stream.
Definition stream.h:41
Struct that holds the statistics for the Software ISP.
Definition swisp_stats.h:15