ipa: simple: Report contrast in metadata
Provide the requested contrast value, if any, in the metadata to add to the completed requests. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
8a4c2682be
commit
1375b07ede
3 changed files with 20 additions and 1 deletions
|
@ -87,9 +87,11 @@ int16_t Lut::ccmValue(unsigned int i, float ccm) const
|
||||||
|
|
||||||
void Lut::prepare(IPAContext &context,
|
void Lut::prepare(IPAContext &context,
|
||||||
[[maybe_unused]] const uint32_t frame,
|
[[maybe_unused]] const uint32_t frame,
|
||||||
[[maybe_unused]] IPAFrameContext &frameContext,
|
IPAFrameContext &frameContext,
|
||||||
DebayerParams *params)
|
DebayerParams *params)
|
||||||
{
|
{
|
||||||
|
frameContext.contrast = context.activeState.knobs.contrast;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Update the gamma table if needed. This means if black level changes
|
* Update the gamma table if needed. This means if black level changes
|
||||||
* and since the black level gets updated only if a lower value is
|
* and since the black level gets updated only if a lower value is
|
||||||
|
@ -139,6 +141,17 @@ void Lut::prepare(IPAContext &context,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lut::process([[maybe_unused]] IPAContext &context,
|
||||||
|
[[maybe_unused]] const uint32_t frame,
|
||||||
|
[[maybe_unused]] IPAFrameContext &frameContext,
|
||||||
|
[[maybe_unused]] const SwIspStats *stats,
|
||||||
|
ControlList &metadata)
|
||||||
|
{
|
||||||
|
const auto &contrast = frameContext.contrast;
|
||||||
|
if (contrast)
|
||||||
|
metadata.set(controls::Contrast, contrast.value());
|
||||||
|
}
|
||||||
|
|
||||||
REGISTER_IPA_ALGORITHM(Lut, "Lut")
|
REGISTER_IPA_ALGORITHM(Lut, "Lut")
|
||||||
|
|
||||||
} /* namespace ipa::soft::algorithms */
|
} /* namespace ipa::soft::algorithms */
|
||||||
|
|
|
@ -30,6 +30,11 @@ public:
|
||||||
const uint32_t frame,
|
const uint32_t frame,
|
||||||
IPAFrameContext &frameContext,
|
IPAFrameContext &frameContext,
|
||||||
DebayerParams *params) override;
|
DebayerParams *params) override;
|
||||||
|
void process(IPAContext &context,
|
||||||
|
const uint32_t frame,
|
||||||
|
IPAFrameContext &frameContext,
|
||||||
|
const SwIspStats *stats,
|
||||||
|
ControlList &metadata) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateGammaTable(IPAContext &context);
|
void updateGammaTable(IPAContext &context);
|
||||||
|
|
|
@ -74,6 +74,7 @@ struct IPAFrameContext : public FrameContext {
|
||||||
double red;
|
double red;
|
||||||
double blue;
|
double blue;
|
||||||
} gains;
|
} gains;
|
||||||
|
std::optional<double> contrast;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IPAContext {
|
struct IPAContext {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue