summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Klug <stefan.klug@ideasonboard.com>2024-12-16 16:40:44 +0100
committerStefan Klug <stefan.klug@ideasonboard.com>2024-12-17 10:31:44 +0100
commit169b65ce16375c7ec6708b187937183e11d4ed0d (patch)
tree960205e4ed24105f998da9435336f332e511acb0
parentec097d63ef9064cc495d9126b54dc772e83137d7 (diff)
pipeline: rkisp1: Split inputCrop and outputCrop
One Rectangle instance is used to calculate the inputCrop and the outputCrop of the ISP in the rkisp1 pipeline. Split that into two distinct variables, because both values will be needed in the upcoming patches. This patch does not contain any functional changes. Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 698fe9ff..6ac14cd1 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -795,15 +795,16 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
if (ret < 0)
return ret;
- Rectangle rect(0, 0, format.size);
- ret = isp_->setSelection(0, V4L2_SEL_TGT_CROP, &rect);
+ Rectangle inputCrop(0, 0, format.size);
+ ret = isp_->setSelection(0, V4L2_SEL_TGT_CROP, &inputCrop);
if (ret < 0)
return ret;
LOG(RkISP1, Debug)
<< "ISP input pad configured with " << format
- << " crop " << rect;
+ << " crop " << inputCrop;
+ Rectangle outputCrop = inputCrop;
const PixelFormat &streamFormat = config->at(0).pixelFormat;
const PixelFormatInfo &info = PixelFormatInfo::info(streamFormat);
isRaw_ = info.colourEncoding == PixelFormatInfo::ColourEncodingRAW;
@@ -821,15 +822,15 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
const auto &cfg = config->at(0);
Size ispCrop = format.size.boundedToAspectRatio(cfg.size)
.alignedUpTo(2, 2);
- rect = ispCrop.centeredTo(Rectangle(format.size).center());
+ outputCrop = ispCrop.centeredTo(Rectangle(format.size).center());
format.size = ispCrop;
}
LOG(RkISP1, Debug)
<< "Configuring ISP output pad with " << format
- << " crop " << rect;
+ << " crop " << outputCrop;
- ret = isp_->setSelection(2, V4L2_SEL_TGT_CROP, &rect);
+ ret = isp_->setSelection(2, V4L2_SEL_TGT_CROP, &outputCrop);
if (ret < 0)
return ret;
@@ -840,7 +841,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
LOG(RkISP1, Debug)
<< "ISP output pad configured with " << format
- << " crop " << rect;
+ << " crop " << outputCrop;
std::map<unsigned int, IPAStream> streamConfig;
std::vector<std::reference_wrapper<StreamConfiguration>> outputCfgs;