21#include "libcamera/internal/shared_mem_object.h"
22#include "libcamera/internal/software_isp/swisp_stats.h"
33 ~SwStatsCpu() =
default;
35 bool isValid()
const {
return sharedStats_.fd().isValid(); }
44 void finishFrame(uint32_t frame, uint32_t bufferId);
48 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.y) ||
49 y >= (window_.y + window_.height))
52 (this->*stats0_)(src);
57 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.y) ||
58 y >= (window_.y + window_.height))
61 (this->*stats2_)(src);
67 using statsProcessFn = void (SwStatsCpu::*)(
const uint8_t *src[]);
71 void statsBGGR8Line0(
const uint8_t *src[]);
73 void statsBGGR10Line0(
const uint8_t *src[]);
75 void statsBGGR12Line0(
const uint8_t *src[]);
77 void statsBGGR10PLine0(
const uint8_t *src[]);
78 void statsGBRG10PLine0(
const uint8_t *src[]);
81 statsProcessFn stats0_;
82 statsProcessFn stats2_;
85 unsigned int ySkipMask_;
Describe a rectangle's position and dimensions.
Definition geometry.h:241
RAII-style wrapper for file descriptors.
Definition shared_fd.h:17
Helper class to allocate an object in shareable memory.
Definition shared_mem_object.h:60
Generic signal and slot communication mechanism.
Definition signal.h:39
Describe a two-dimensional size.
Definition geometry.h:51
const SharedFD & getStatsFD()
Get the file descriptor for the statistics.
Definition swstats_cpu.h:37
Signal< uint32_t, uint32_t > statsReady
Signals that the statistics are ready.
Definition swstats_cpu.h:64
int configure(const StreamConfiguration &inputCfg)
Configure the statistics object for the passed in input format.
Definition swstats_cpu.cpp:367
void finishFrame(uint32_t frame, uint32_t bufferId)
Finish statistics calculation for the current frame.
Definition swstats_cpu.cpp:319
void startFrame()
Reset state to start statistics gathering for a new frame.
Definition swstats_cpu.cpp:301
void setWindow(const Rectangle &window)
Specify window coordinates over which to gather statistics.
Definition swstats_cpu.cpp:420
void processLine0(unsigned int y, const uint8_t *src[])
Process line 0.
Definition swstats_cpu.h:46
void processLine2(unsigned int y, const uint8_t *src[])
Process line 2 and 3.
Definition swstats_cpu.h:55
bool isValid() const
Gets whether the statistics object is valid.
Definition swstats_cpu.h:35
const Size & patternSize()
Get the pattern size.
Definition swstats_cpu.h:39
Data structures related to geometric objects.
Top-level libcamera namespace.
Definition backtrace.h:17
Signal & slot implementation.
Configuration parameters for a stream.
Definition stream.h:40
Struct that holds the statistics for the Software ISP.
Definition swisp_stats.h:22