summaryrefslogtreecommitdiff
path: root/src/android/cros/camera3_hal.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-04-03 17:49:12 +0200
committerStefan Klug <stefan.klug@ideasonboard.com>2025-05-20 09:49:09 +0200
commit754798b664888e55402bc5c5708e56fa461c0ba1 (patch)
tree01a6c3df478b39f35536ecc8788cb8324ee39917 /src/android/cros/camera3_hal.cpp
parentdacbcc7d7779e5faec243b51b1581d401954ddea (diff)
libcamera: matrix: Extend multiplication operator to heterogenous types
It is useful to multiply matrices of heterogneous types, for instance float and double. Extend the multiplication operator to support this, avoiding the need to convert one of the matrices. The type of the returned matrix is selected automatically to avoid loosing precision. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/android/cros/camera3_hal.cpp')
0 files changed, 0 insertions, 0 deletions
s="hl kwa">using namespace RPiController; #define NAME "rpi.sharpen" Sharpen::Sharpen(Controller *controller) : SharpenAlgorithm(controller), user_strength_(1.0) { } char const *Sharpen::Name() const { return NAME; } void Sharpen::SwitchMode(CameraMode const &camera_mode, [[maybe_unused]] Metadata *metadata) { // can't be less than one, right? mode_factor_ = std::max(1.0, camera_mode.noise_factor); } void Sharpen::Read(boost::property_tree::ptree const &params) { RPI_LOG(Name()); threshold_ = params.get<double>("threshold", 1.0); strength_ = params.get<double>("strength", 1.0); limit_ = params.get<double>("limit", 1.0); } void Sharpen::SetStrength(double strength) { // Note that this method is how an application sets the overall // sharpening "strength". We call this the "user strength" field // as there already is a strength_ field - being an internal gain // parameter that gets passed to the ISP control code. Negative // values are not allowed - coerce them to zero (no sharpening). user_strength_ = std::max(0.0, strength); } void Sharpen::Prepare(Metadata *image_metadata) { // The user_strength_ affects the algorithm's internal gain directly, but // we adjust the limit and threshold less aggressively. Using a sqrt // function is an arbitrary but gentle way of accomplishing this. double user_strength_sqrt = sqrt(user_strength_); struct SharpenStatus status; // Binned modes seem to need the sharpening toned down with this