summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/sharpen_status.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-06-28 18:03:32 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-06-29 09:39:56 +0200
commitd8848693bf92c15a4ce18a3ff8b43f537de5e033 (patch)
treed83c9dc16ea8caba209727d0b562cb49bc7977e5 /src/ipa/raspberrypi/controller/sharpen_status.h
parentb7dfefb882b67757a00a4bed015c3a51f98c6ce0 (diff)
libcamera: raspberrypi: Fail on unsupported stream role
When an unsupported stream roles is requested to generateConfiguration(), the function shall fail instead of simply ignoring the request. Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/ipa/raspberrypi/controller/sharpen_status.h')
0 files changed, 0 insertions, 0 deletions
class="hl com"> * the image metadata. */ #define NAME "rpi.sdn" Sdn::Sdn(Controller *controller) : DenoiseAlgorithm(controller), mode_(DenoiseMode::ColourOff) { } char const *Sdn::name() const { return NAME; } int Sdn::read(const libcamera::YamlObject &params) { deviation_ = params["deviation"].get<double>(3.2); strength_ = params["strength"].get<double>(0.75); return 0; } void Sdn::initialise() { } void Sdn::prepare(Metadata *imageMetadata) { struct NoiseStatus noiseStatus = {}; noiseStatus.noiseSlope = 3.0; /* in case no metadata */ if (imageMetadata->get("noise.status", noiseStatus) != 0) LOG(RPiSdn, Warning) << "no noise profile found"; LOG(RPiSdn, Debug) << "Noise profile: constant " << noiseStatus.noiseConstant << " slope " << noiseStatus.noiseSlope; struct DenoiseStatus status; status.noiseConstant = noiseStatus.noiseConstant * deviation_; status.noiseSlope = noiseStatus.noiseSlope * deviation_; status.strength = strength_; status.mode = static_cast<std::underlying_type_t<DenoiseMode>>(mode_); imageMetadata->set("denoise.status", status); LOG(RPiSdn, Debug) << "programmed constant " << status.noiseConstant << " slope " << status.noiseSlope << " strength " << status.strength; } void Sdn::setMode(DenoiseMode mode) { /* We only distinguish between off and all other modes. */ mode_ = mode; } /* Register algorithm with the system. */ static Algorithm *create(Controller *controller) { return (Algorithm *)new Sdn(controller); } static RegisterAlgorithm reg(NAME, &create);