Message ID | 20250824-b4-v0-5-2-gpuisp-v2-a-v2-32-96f4576c814e@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <libcamera-devel-bounces@lists.libcamera.org> 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 81AFBC32BB for <parsemail@patchwork.libcamera.org>; Sun, 24 Aug 2025 00:49:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D15F6933E; Sun, 24 Aug 2025 02:49:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BYMnFYl3"; dkim-atps=neutral Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C371869322 for <libcamera-devel@lists.libcamera.org>; Sun, 24 Aug 2025 02:49:05 +0200 (CEST) Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-45a1b05a49cso25529425e9.1 for <libcamera-devel@lists.libcamera.org>; Sat, 23 Aug 2025 17:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1755996545; x=1756601345; darn=lists.libcamera.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ESRMJTblPPvZq2GFxDEIxtOdNxshCNwucJs6WtvfNbE=; b=BYMnFYl355tbMsxuWcC+Rk1iPWAeD/hqAalu3PvYdv3b6rCOiNx/tkuFztVuMv1o1J vk8HX/ZBtP4gPxiKF6YYHdjtg78h51mHDs90vCIgUvoJlBvDCh9mHTriE/BOOyp93BAT yeEj21Dn5QKkZU3W8Cd+1PQImjT8Kp5uL4sSjneKLHkxD2JyB/XFtxTNZvud+5wPEoaN HHarqkITgsr91DWneyF5gnmulh40CxrvWzwShMvWawaZuOnUXWI+CsZz86eJr36Pk19S ACxZJ1yaElK4BBlNRA5lPtNQr0BBAzwHnMb3XkCXOD3KNVwRaT3Wf5rcfPHW0s8jeeWe znjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755996545; x=1756601345; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ESRMJTblPPvZq2GFxDEIxtOdNxshCNwucJs6WtvfNbE=; b=gS6Xj5j1Q7uucV+Zw/08BaBzKnsGlliTqnjsrHNiCH/fvBlGJCBcvFuPccBx4jTltw 5/EedIo+5LffacHbRKTApPAiYP6WyEK3dBBLQ53CgLXMh2rgfgcxhSMiLAvkoWIYg9bZ Oj2qr36AtzVxQtfl9r3FPqP7mBbg4iI6/2Gd8eH5nWpLPqtCcSeAMutR6fFqC+2YbPiq NtBQ/jgfB7H8Bz0cEyLU8AhnPNyfZwY9LW5pMAS05lcc1ZE7Yj9SnMRc7xA/2H9ln6e7 zT6YU95auyCoE8K9FFG6p0n7h+erTwDmSkmeKZtXbceU4Lr57jMCG4C4a+V4ienkUtmz rsUw== X-Gm-Message-State: AOJu0YwwIJlNB2PttUz7Fy8sdBYWyj80Na2RysFZleYomxNqspsn8OcC TUiqGZWQM1RnaURpboeE4vswAb9tcw62N2Z3NgufuB0DYpiNPO1k7ujgLNGKcWlf9Kc= X-Gm-Gg: ASbGncvXeJLafY+VJe5dkK97RQAVzZHOLPW71Eo3nbuVt4UaIsnPYO1rmR1fENHYt1r I/fYnmcDUa4eFKS2X/G9RaPuPaivUQP93U+67zf5KEq57EGxdiakA3V99De0MvaXE1FgFpn4CHA ckDTGec17MUFCxkVvuoXU+koOSWRK3Y4+v6lR4fc4f1JQBXZlOYoh4CikkQ0NhJUAotRsrXCdJj bnlHe2Kd6TiEN7lRZgdHxmJlRTR1/6gu7Vh/qsfsw+dYU+0+wigIEu07iUBWxl9ALOlImYpOtkY nH4V5+sgN0NDwiojyGpaimTo2vTjkaNTdyHKIdslePAP+m6wsLecg3IVl5GTwLizg8GKGj5tOTt ykwaw9FiGTgXdLrQYIXPq76NJQw18BGWBMFqjFQ3f4nLKxkQxLbif9AmIYIsv+VCU00mDH2PRYZ LhSW6HkK0wGPNqdhmQhJ2P X-Google-Smtp-Source: AGHT+IERtlDc63AGtTIOKTaXXl+Nik/ssWCk8hAnfKNbJ/nhl6shrxoLWRsm8ilkuYJWNNMzhI4c8w== X-Received: by 2002:a05:600c:4687:b0:459:4441:1c07 with SMTP id 5b1f17b1804b1-45b517cba51mr62510545e9.20.1755996545262; Sat, 23 Aug 2025 17:49:05 -0700 (PDT) Received: from [192.168.0.13] (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b4e1d530esm69347225e9.0.2025.08.23.17.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Aug 2025 17:49:04 -0700 (PDT) From: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Date: Sun, 24 Aug 2025 01:48:44 +0100 Subject: [PATCH v2 32/37] libcamera: shaders: Extend bayer shaders to support swapping R and B on output MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-32-96f4576c814e@linaro.org> References: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org> In-Reply-To: <20250824-b4-v0-5-2-gpuisp-v2-a-v2-0-96f4576c814e@linaro.org> To: libcamera-devel@lists.libcamera.org Cc: Bryan O'Donoghue <bryan.odonoghue@linaro.org>, Milan Zamazal <mzamazal@redhat.com> X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1571; i=bryan.odonoghue@linaro.org; h=from:subject:message-id; bh=Ib7hryM3y+nj3Dvp5/I7OoKBgzicY5DGoVAJZWOVdiw=; b=owEBbQKS/ZANAwAKASJxO7Ohjcg6AcsmYgBoqmFiRLDbsLQxoedzZH3XvYuFi41e+qF19dSgh D80P66df1KJAjMEAAEKAB0WIQTmk/sqq6Nt4Rerb7QicTuzoY3IOgUCaKphYgAKCRAicTuzoY3I Ol2nD/449du316Nb4JhRUrUcNI15eTuGVx/+tAf+j+ffJwzsySC/mUZoXH4YQsybWt0CVE4qti8 eP1Me7UYVRdGAQh8/VEN69cmeYFMtNOZW+lE5QZtS8nIVxD6hBU5e1KJjT5gVAWi7/EiDg/n3Ev ZdowfEv0CwQm8PjQfN3l+RQXr/64e61+H5YYyFhQj3ejQkugweVpg9bSZGa1YYwLB1JeNyAfP+t jH6p9wetu2+3zBla+B4W0SQj/LaDHtDD7I3gSbsa31Bflu3yr9izT70fUUSwiYqdRG7AmhRprD+ Nrumrij7vhO0Kl315RJpCBdZJ3uQSTf0jaY7+saKMmIev1dUnZVAmXhpXWW8RmAdRLlpkRYEKfZ ri5J6IBysCXxn10p2rJob9843CxoPYbjP/8q+zsvxUsA22LRpktsB7j7X/tebPsiizBo3oAE41S SNqRZ8EQwxgu3MAmmkcUQ/BjuLPrsRtMuZjiYvS1TacT5rNn/nyoToWlZLtkoPniOQAO5hWXysg 2p++Gk6rwTrK62WSrhg3MqadqKatq5UfRkasZCW6QuqiqhvNVuTdRjOdgmLUrtcGzRiqRD+6Kdv wnXbn2ZVTrXMSrHyU2rYtroKOJsT3b25+1CzScs8h9nqEXlOy3vm9rLHqRb2ASlPTwx39C1bIVW Z3JeZGDpfoYE9wQ== X-Developer-Key: i=bryan.odonoghue@linaro.org; a=openpgp; fpr=E693FB2AABA36DE117AB6FB422713BB3A18DC83A X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <libcamera-devel.lists.libcamera.org> List-Unsubscribe: <https://lists.libcamera.org/options/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe> List-Archive: <https://lists.libcamera.org/pipermail/libcamera-devel/> List-Post: <mailto:libcamera-devel@lists.libcamera.org> List-Help: <mailto:libcamera-devel-request@lists.libcamera.org?subject=help> List-Subscribe: <https://lists.libcamera.org/listinfo/libcamera-devel>, <mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe> Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" <libcamera-devel-bounces@lists.libcamera.org> |
Series |
|
Related |
show
|
diff --git a/include/libcamera/internal/shaders/bayer_1x_packed.frag b/include/libcamera/internal/shaders/bayer_1x_packed.frag index 90bd645709e02d8cf9bee112b25cbb26c681db0a..c0632eb1f2089522cadb548a163607354bf7688f 100644 --- a/include/libcamera/internal/shaders/bayer_1x_packed.frag +++ b/include/libcamera/internal/shaders/bayer_1x_packed.frag @@ -268,5 +268,9 @@ void main(void) rgb.b = texture2D(blue_param, vec2(rgb.b, 0.5)).b; #endif +#if defined (SWAP_BLUE) + gl_FragColor = vec4(rgb.bgr, 1.0); +#else gl_FragColor = vec4(rgb, 1.0); +#endif } diff --git a/include/libcamera/internal/shaders/bayer_8.frag b/include/libcamera/internal/shaders/bayer_8.frag index 5955c2eafbe03678158b240740e18c7f00e58057..74ce15096ac0b8a221175d111d982d1222b7db38 100644 --- a/include/libcamera/internal/shaders/bayer_8.frag +++ b/include/libcamera/internal/shaders/bayer_8.frag @@ -163,5 +163,9 @@ void main(void) { rgb.b = texture2D(red_param, vec2(rgb.b, 0.5)).b; #endif - gl_FragColor.rgb = rgb; +#if defined (SWAP_BLUE) + gl_FragColor = vec4(rgb.bgr, 1.0); +#else + gl_FragColor = vec4(rgb, 1.0); +#endif }