21#include "libcamera/internal/shared_mem_object.h"
22#include "libcamera/internal/software_isp/swisp_stats.h"
33 ~SwStatsCpu() =
default;
43 bool isValid()
const {
return sharedStats_.fd().isValid(); }
52 void finishFrame(uint32_t frame, uint32_t bufferId);
54 void processLine0(uint32_t frame,
unsigned int y,
const uint8_t *src[])
59 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.y) ||
60 y >= (window_.y + window_.height))
63 (this->*stats0_)(src);
66 void processLine2(uint32_t frame,
unsigned int y,
const uint8_t *src[])
71 if ((y & ySkipMask_) || y <
static_cast<unsigned int>(window_.y) ||
72 y >= (window_.y + window_.height))
75 (this->*stats2_)(src);
81 using statsProcessFn = void (SwStatsCpu::*)(
const uint8_t *src[]);
85 void statsBGGR8Line0(
const uint8_t *src[]);
87 void statsBGGR10Line0(
const uint8_t *src[]);
89 void statsBGGR12Line0(
const uint8_t *src[]);
91 void statsBGGR10PLine0(
const uint8_t *src[]);
92 void statsGBRG10PLine0(
const uint8_t *src[]);
95 statsProcessFn stats0_;
96 statsProcessFn stats2_;
99 unsigned int ySkipMask_;
105 unsigned int xShift_;
Describe a rectangle's position and dimensions.
Definition geometry.h:247
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
static constexpr uint32_t kStatPerNumFrames
Run stats once every kStatPerNumFrames frames.
Definition swstats_cpu.h:41
const SharedFD & getStatsFD()
Get the file descriptor for the statistics.
Definition swstats_cpu.h:45
void processLine0(uint32_t frame, unsigned int y, const uint8_t *src[])
Process line 0.
Definition swstats_cpu.h:54
void processLine2(uint32_t frame, unsigned int y, const uint8_t *src[])
Process line 2 and 3.
Definition swstats_cpu.h:66
Signal< uint32_t, uint32_t > statsReady
Signals that the statistics are ready.
Definition swstats_cpu.h:78
int configure(const StreamConfiguration &inputCfg)
Configure the statistics object for the passed in input format.
Definition swstats_cpu.cpp:379
void finishFrame(uint32_t frame, uint32_t bufferId)
Finish statistics calculation for the current frame.
Definition swstats_cpu.cpp:330
void setWindow(const Rectangle &window)
Specify window coordinates over which to gather statistics.
Definition swstats_cpu.cpp:454
bool isValid() const
Gets whether the statistics object is valid.
Definition swstats_cpu.h:43
const Size & patternSize()
Get the pattern size.
Definition swstats_cpu.h:47
void startFrame(uint32_t frame)
Reset state to start statistics gathering for a new frame.
Definition swstats_cpu.cpp:309
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