eb41f63694
Add a gamma algorithm for the rkisp1. It defaults to a gamma of 2.2 which closely resembles sRGB. No seperate sRGB mode was implemented because the pwl that models the gamma curve is so coarse that there is basically no difference between srgb and gamma=2.2. The default can be overridden within the tuning file or set at runtime using the gamma control. The gamma algorithm is not enabled by default. This will be done in future tuning file updates. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2024, Ideas On Board
|
|
*
|
|
* RkISP1 Gamma out control
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "algorithm.h"
|
|
|
|
namespace libcamera {
|
|
|
|
namespace ipa::rkisp1::algorithms {
|
|
|
|
class GammaOutCorrection : public Algorithm
|
|
{
|
|
public:
|
|
GammaOutCorrection() = default;
|
|
~GammaOutCorrection() = default;
|
|
|
|
int init(IPAContext &context, const YamlObject &tuningData) override;
|
|
int configure(IPAContext &context,
|
|
const IPACameraSensorInfo &configInfo) override;
|
|
void queueRequest(IPAContext &context,
|
|
const uint32_t frame,
|
|
IPAFrameContext &frameContext,
|
|
const ControlList &controls) override;
|
|
void prepare(IPAContext &context, const uint32_t frame,
|
|
IPAFrameContext &frameContext,
|
|
rkisp1_params_cfg *params) override;
|
|
void process(IPAContext &context, const uint32_t frame,
|
|
IPAFrameContext &frameContext,
|
|
const rkisp1_stat_buffer *stats,
|
|
ControlList &metadata) override;
|
|
|
|
private:
|
|
float defaultGamma_;
|
|
};
|
|
|
|
} /* namespace ipa::rkisp1::algorithms */
|
|
} /* namespace libcamera */
|