Files
external_libcamera/src/ipa/simple/ipa_context.cpp
Milan Zamazal 7fab2062d8 libcamera: software_isp: Move color handling to an algorithm module
After black level handling has been moved to an algorithm module, white
balance and the construction of color tables can be moved to algorithm
modules too.

This time, the moved code is split between stats processing and
parameter construction methods.  It is also split to two algorithm
modules:

- White balance computation.

- Gamma table computation and color lookup tables construction.  While
  this applies the color gains computed by the white balance algorithm,
  it is not directly related to white balance.  And we may want to
  modify the color lookup tables in future according to other parameters
  than just gamma and white balance gains.

Gamma table computation and color lookup tables construction could be
split to separate algorithms too.  But there is no big need for that now
so they are kept together for simplicity.

This is the only part of the software ISP algorithms that sets the
parameters so emitting setIspParams can be moved to prepare() method.

A more natural representation of the gains (and black level) would be
floating point numbers.  This is not done here in order to minimize
changes in code movements.  It will be addressed in a followup patch.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Acked-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2024-09-27 15:01:57 +01:00

92 lines
2.3 KiB
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2021, Google Inc.
* Copyright (C) 2024 Red Hat Inc.
*
* Software ISP IPA Context
*/
#include "ipa_context.h"
/**
* \file ipa_context.h
* \brief Context and state information shared between the algorithms
*/
namespace libcamera::ipa::soft {
/**
* \struct IPASessionConfiguration
* \brief Session configuration for the IPA module
*
* The session configuration contains all IPA configuration parameters that
* remain constant during the capture session, from IPA module start to stop.
* It is typically set during the configure() operation of the IPA module, but
* may also be updated in the start() operation.
*/
/**
* \struct IPAActiveState
* \brief The active state of the IPA algorithms
*
* The IPA is fed with the statistics generated from the latest frame processed.
* The statistics are then processed by the IPA algorithms to compute parameters
* required for the next frame capture and processing. The current state of the
* algorithms is reflected through the IPAActiveState to store the values most
* recently computed by the IPA algorithms.
*/
/**
* \struct IPAContext
* \brief Global IPA context data shared between all algorithms
*
* \var IPAContext::configuration
* \brief The IPA session configuration, immutable during the session
*
* \var IPAContext::frameContexts
* \brief Ring buffer of the IPAFrameContext(s)
*
* \var IPAContext::activeState
* \brief The current state of IPA algorithms
*/
/**
* \var IPASessionConfiguration::gamma
* \brief Gamma value to be used in the raw image processing
*/
/**
* \var IPAActiveState::black
* \brief Context for the Black Level algorithm
*
* \var IPAActiveState::black.level
* \brief Current determined black level
*/
/**
* \var IPAActiveState::gains
* \brief Context for gains in the Colors algorithm
*
* \var IPAActiveState::gains.red
* \brief Gain of red color
*
* \var IPAActiveState::gains.green
* \brief Gain of green color
*
* \var IPAActiveState::gains.blue
* \brief Gain of blue color
*/
/**
* \var IPAActiveState::gamma
* \brief Context for gamma in the Colors algorithm
*
* \var IPAActiveState::gamma.gammaTable
* \brief Computed gamma table
*
* \var IPAActiveState::gamma.blackLevel
* \brief Black level used for the gamma table computation
*/
} /* namespace libcamera::ipa::soft */