Constructing the color mapping tables is related to stats rather than debayering, where they are applied. Let's move the corresponding code to stats processing. The same applies to the auxiliary gamma table. As the gamma value is currently fixed and used in a single place, with the temporary exception mentioned below, there is no need to share it anywhere anymore. It's necessary to initialize SoftwareIsp::debayerParams_ to default values. These initial values are used for the first two frames, before they are changed based on determined stats. To avoid sharing the gamma value constant in artificial ways, we use 0.5 directly in the initialization. This all is not a particularly elegant thing to do, such a code belongs conceptually to the similar code in stats processing, but doing better is left for larger refactoring. This is a preliminary step towards building this functionality on top of libipa/algorithm.h, which should follow. Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Andrei Konovalov <andrey.konovalov.ynk@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
29 lines
545 B
C++
29 lines
545 B
C++
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
/*
|
|
* Copyright (C) 2023, 2024 Red Hat Inc.
|
|
*
|
|
* Authors:
|
|
* Hans de Goede <hdegoede@redhat.com>
|
|
*
|
|
* DebayerParams header
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <array>
|
|
#include <stdint.h>
|
|
|
|
namespace libcamera {
|
|
|
|
struct DebayerParams {
|
|
static constexpr unsigned int kGain10 = 256;
|
|
static constexpr unsigned int kRGBLookupSize = 256;
|
|
|
|
using ColorLookupTable = std::array<uint8_t, kRGBLookupSize>;
|
|
|
|
ColorLookupTable red;
|
|
ColorLookupTable green;
|
|
ColorLookupTable blue;
|
|
};
|
|
|
|
} /* namespace libcamera */
|