@@ -404,8 +404,9 @@ void DebayerEGL::setShaderVariableValues(const DebayerParams ¶ms)
* Scale input to output size, keeping the aspect ratio and preferring
* cropping over black bars.
*/
- GLfloat scale = std::max((GLfloat)window_.width / width_,
- (GLfloat)window_.height / height_);
+ Size maxInputSize = sizes(inputPixelFormat_, {width_, height_}).max;
+ GLfloat scale = std::max((GLfloat)window_.width / maxInputSize.width,
+ (GLfloat)window_.height / maxInputSize.height);
GLfloat trans = -(1.0f - scale);
GLfloat projMatrix[] = {
scale, 0, 0, 0,
The debayer algorithm produces a sligtly smaller output resolution compared to the input one, using a border at the edges depending on the pattern. This wasn't considered when scaling to the final output buffer size, resulting in garbage pixels at the right - or in case or 90 degree rotated sensors - the bottom of the image. Use the correct algorithm output size instead - the maximum output buffer size. Fixes: f520b29fe (libcamera: software_isp: debayer_egl: Add an eGL Debayer class) Signed-off-by: Robert Mader <robert.mader@collabora.com> --- src/libcamera/software_isp/debayer_egl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)