[libcamera-devel,0/2] Digital zoom implementation
mbox series

Message ID 20200702105337.31161-1-david.plowman@raspberrypi.com
Headers show
Series
  • Digital zoom implementation
Related show

Message

David Plowman July 2, 2020, 10:53 a.m. UTC
Hi everyone

This patch set implements digital zoom. I don't think it's ready for
prime time yet but it seemed to me to be a good way to move the
discussion beyond the somewhat theoretical stage and towards something
a bit more practical.

It follows the path of my previous emails, and consists of two patches.

The first is the general infrastructure one and adds the DigitalZoom
control. I ummed and erred for a while over what to call it, but I
think "digital zoom" really does describe it best. I think most people
are familiar with the idea of picking just part of an image and
zooming it back up to the size of the unzoomed output.

Next, I also add a function to get the "sensorCrop". Again,
terminology is perhaps an issue here, but it gets you those pixel
dimensions from the sensor, adjusted for output aspect ratio, within
which you can then zoom. As far as I can see, it's only the pipeline
handler that actually calculates this, and it depends on both the
camera mode and the output size, so this seemed a reasonable way to
get these numbers back to an application.

The second patch implements this for the Raspberry Pi. Mostly controls
get sent to the IPAs and handled there, but this one needs to be
intercepted and actioned by the pipeline handler. Additionally, we
make the pipeline handler responsible for updating the return values
(the "digital zoom" actually used) in the metadata.

Anyway, I hope this all makes sense. As I said, I think there's some
further discussion to be had before we take this further, so I look
forward to some feedback!

Thanks and best regards
David

David Plowman (2):
  libcamera: Implement digital zoom
  libcamera: raspberrypi: Implement digital zoom

 include/libcamera/camera.h                    |  2 +
 include/libcamera/internal/pipeline_handler.h |  4 ++
 include/libcamera/ipa/raspberrypi.h           |  1 +
 src/ipa/raspberrypi/raspberrypi.cpp           | 10 ++++
 src/libcamera/camera.cpp                      | 26 ++++++++
 src/libcamera/control_ids.yaml                | 10 ++++
 .../pipeline/raspberrypi/raspberrypi.cpp      | 59 +++++++++++++++++++
 7 files changed, 112 insertions(+)