summaryrefslogtreecommitdiff
path: root/src/android/jpeg/encoder_libjpeg.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2022-07-14 20:14:26 +0200
committerJacopo Mondi <jacopo@jmondi.org>2022-07-15 13:43:47 +0200
commite9b6b362820338d0546563444e7b1767f5c7044c (patch)
tree28b91dc512e2bc0deac28db55d8d9b646e3dbcaf /src/android/jpeg/encoder_libjpeg.h
parenta5877e03072c9578cd97a84f4db1106f24a588a9 (diff)
cam: sdl: Use uint32_t in place of SDL_PixelFormatEnum
The SDL_PixelFormatEnum type has been introduced in libsdl by 1a4c0d4e17e6 ("Fixed bug 4377 - SDL_PIXELFORMAT enum is anonymous, which prevents its use in a templated function") which is only available after release 2.0.10 of the library. Debian 10 ships libsdl at version 2.0.9 and building cam with sdl support there fails with error: ./src/cam/sdl_texture.h:27:8: error: ‘SDL_PixelFormatEnum’ does not name a type; did you mean ‘SDL_PixelFormat’? Fix that by using the base type uint32_t in place of SDL_PixelFormatEnum. Reported-by: https://buildbot.libcamera.org/#/builders/6/builds/355 Fixes: 11554a259f4e ("cam: sdl_sink: Add SDL sink with initial YUYV support") Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Eric Curtin <ecurtin@redhat.com>
Diffstat (limited to 'src/android/jpeg/encoder_libjpeg.h')
0 files changed, 0 insertions, 0 deletions
hl opt">(controller), mode_factor_(1.0) { } char const *Noise::Name() const { return NAME; } void Noise::SwitchMode(CameraMode const &camera_mode, [[maybe_unused]] Metadata *metadata) { // For example, we would expect a 2x2 binned mode to have a "noise // factor" of sqrt(2x2) = 2. (can't be less than one, right?) mode_factor_ = std::max(1.0, camera_mode.noise_factor); } void Noise::Read(boost::property_tree::ptree const &params) { reference_constant_ = params.get<double>("reference_constant"); reference_slope_ = params.get<double>("reference_slope"); } void Noise::Prepare(Metadata *image_metadata) { struct DeviceStatus device_status; device_status.analogue_gain = 1.0; // keep compiler calm if (image_metadata->Get("device.status", device_status) == 0) { // There is a slight question as to exactly how the noise // profile, specifically the constant part of it, scales. For // now we assume it all scales the same, and we'll revisit this // if it proves substantially wrong. NOTE: we may also want to // make some adjustments based on the camera mode (such as // binning), if we knew how to discover it... double factor = sqrt(device_status.analogue_gain) / mode_factor_; struct NoiseStatus status; status.noise_constant = reference_constant_ * factor; status.noise_slope = reference_slope_ * factor; image_metadata->Set("noise.status", status); LOG(RPiNoise, Debug) << "constant " << status.noise_constant << " slope " << status.noise_slope; } else LOG(RPiNoise, Warning) << " no metadata"; } // Register algorithm with the system. static Algorithm *Create(Controller *controller) { return new Noise(controller); } static RegisterAlgorithm reg(NAME, &Create);