pipeline: raspberrypi: Improve the values reported in the ScalerCrop control
Previously the x,y offsets in the min/max ScalerCrop control values were zero. Here we make them the same as the sensor's analogue crop offset which is I think less misleading. With this change, it also seems reasonable to advertise the default scaler crop value to be the true default that you will get. This makes it possible for applications to see what that value will be without having to start the camera and wait for frames. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
bb35ac92e4
commit
4133dbe2b3
1 changed files with 4 additions and 3 deletions
|
@ -848,6 +848,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
|
|||
/* Adjust aspect ratio by providing crops on the input image. */
|
||||
Size size = unicamFormat.size.boundedToAspectRatio(maxSize);
|
||||
Rectangle crop = size.centeredTo(Rectangle(unicamFormat.size).center());
|
||||
Rectangle defaultCrop = crop;
|
||||
data->ispCrop_ = crop;
|
||||
|
||||
data->isp_[Isp::Input].dev()->setSelection(V4L2_SEL_TGT_CROP, &crop);
|
||||
|
@ -901,9 +902,9 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
|
|||
ctrlMap.emplace(c.first, c.second);
|
||||
|
||||
/* Add the ScalerCrop control limits based on the current mode. */
|
||||
Rectangle ispMinCrop(data->ispMinCropSize_);
|
||||
ispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize);
|
||||
ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()));
|
||||
Rectangle ispMinCrop = data->scaleIspCrop(Rectangle(data->ispMinCropSize_));
|
||||
defaultCrop = data->scaleIspCrop(defaultCrop);
|
||||
ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, data->sensorInfo_.analogCrop, defaultCrop);
|
||||
|
||||
data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue