From patchwork Thu Dec 31 15:53:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Fricke X-Patchwork-Id: 10794 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A6084C0F1A for ; Thu, 31 Dec 2020 15:54:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 34ECD615B2; Thu, 31 Dec 2020 16:54:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="k+HxCSng"; dkim-atps=neutral Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BD3A16031B for ; Thu, 31 Dec 2020 16:54:23 +0100 (CET) Received: by mail-wr1-x430.google.com with SMTP id r3so20409592wrt.2 for ; Thu, 31 Dec 2020 07:54:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=snslqTIDVJgc40ytGaQeRYGbGg9Iy8GeRpOrp+4ixag=; b=k+HxCSngktPH2bdkGWkSUt4zK8vVGMS1nIEX+mSBEyaNAqeKfBBl0b2mezGUWgR4q9 QFSCUENgarD2Mavc8lKlvlCmBMSfNHyx83meoK/ntHLze838Iq5b8cRZoK+ZdNT3bZn2 tFvAGmhNO/YcNzzn4Rz+lRSec5ZDOfyqmfZm9ZSWWZZDiMEL99Jg8Xc1rD5gG02/dk0G RFOlGCoi4ba2kfRVxoDMq9RAMpGMJeaSZYjnBxn638lD94A+NrqsEzi1wZq+eYzVYzbk fL8GCGXntxbyssw8TFn+QTSxJaH52SEgOLCoNZBBIKaIiFKAQbCSM5FDmpPpEF3VHb98 kD3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=snslqTIDVJgc40ytGaQeRYGbGg9Iy8GeRpOrp+4ixag=; b=cpmgbPWgqCIT6vJX4EZFnPIFtKvzcnLMorvbvzWa1ohd7Wm+h5ezgXPfjuzzLT+gEs Au1qvHw96zJZksR2hPoE65JFq0R5Kw7y0tKzYQP7aLJoTuh4j6q8QsQlxtKHJrjmfilt VHUDtVYTGS9chpSKMMz7pe1mpTFdVrexp/CGJl52rEanXDjmJ5bVwX/1/MUiGZsgd0SE 0+4Zdb21MP6nTXdGMS8qj3mLFBCzHbmSZIXWCfqDUo9fsUiv3Bu7L7ps6BFFQ5JSxSEM 0ODOEfdCxFwVsrr4D0ShEt0juuvJ5fQKEDeLSYCpdxzDTagcxodwVKK8C/5FrI+I5c+v gjtw== X-Gm-Message-State: AOAM53138Twh/UDibAIPE5Ogcp/6K9trnctrZhW9CD84RRVAaXvsBbkS wUPYr7gL4fYfpSvSWFxPi0to7HNsLrQ= X-Google-Smtp-Source: ABdhPJxgDqPC+FOmP4HAqFCkWniQK2FTR9Vq9U7F87LZ7cWQYTQDKEPoFLxxYufhobE7w9YCNyzG/A== X-Received: by 2002:a05:6000:1d2:: with SMTP id t18mr54266458wrx.412.1609430063416; Thu, 31 Dec 2020 07:54:23 -0800 (PST) Received: from basti-TUXEDO-Book-XA1510.fritz.box (p200300d1ff267500b10aabf0e84cdf75.dip0.t-ipconnect.de. [2003:d1:ff26:7500:b10a:abf0:e84c:df75]) by smtp.gmail.com with ESMTPSA id s63sm14595787wms.18.2020.12.31.07.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Dec 2020 07:54:22 -0800 (PST) From: Sebastian Fricke To: libcamera-devel@lists.libcamera.org Date: Thu, 31 Dec 2020 16:53:32 +0100 Message-Id: <20201231155336.7058-1-sebastian.fricke.linux@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/4] Improve BayerFormat class X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Improve BayerFormat class This patch series adds unit-tests, the `fromV4L2PixelFormat` static member function and the ==/!= operators to the BayerFormat class. --- Changes since version 1: * Convert the `fromV4L2PixelFormat` to a static member function, as it doesn't contain any self use. * Adjust the current user of the old constructor (raspberryPi pipeline) to use the new function. * Add the ==/!= operators to improve tests and to add helpful helper functions. * Change the logic of `fromV4L2PixelFormat` by replace the search of a matching bayer format to a v4l2 pixel format with a search for a matching v4l2 pixel format to a bayer format. * Remove the v4l2ToBayer mapping table as it lost it's last user * Remove 'TEST \d:' & 'TEST \d: FAIL:' pattern from comments and messages within the unit tests. * Convert variable names from snake_case to camelCase. * Add an additional to test to confirm that we cannot get a V4L2PixelFormat from a BayerFormat not found in the mapping table. * Add tests for the == & != operators * Change the test within the Transform unit tests from a comparision of string formats to a direct compare of the BayerFormat objects. * Unify the test error messages by enclosing the expected and actual string representations in '' * Fix checkstyle errors. * Add explaination for why the transpose functionality was ignored within the unit test. --- Sebastian Fricke (4): libcamera: Add the fromV4L2PixelFormat function libcamera: Overload ==/!= operators for BayerFormats libcamera: pipeline: rpi: Adjust to new implementation test: Add unit tests for the BayerFormat class include/libcamera/internal/bayer_format.h | 8 + src/libcamera/bayer_format.cpp | 73 +++---- .../pipeline/raspberrypi/raspberrypi.cpp | 4 +- test/bayer_format.cpp | 202 ++++++++++++++++++ test/meson.build | 1 + 5 files changed, 241 insertions(+), 47 deletions(-) create mode 100644 test/bayer_format.cpp