Patch Detail
Show a patch.
GET /api/patches/17118/?format=api
{ "id": 17118, "url": "https://patchwork.libcamera.org/api/patches/17118/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17118/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220814160747.52093-3-kunalagarwal1072002@gmail.com>", "date": "2022-08-14T16:07:44", "name": "[libcamera-devel,v3,3/6] pipeline: simple: Implements Texture Handling", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "0f944cc3f4856b26cbe378b69a4bc75aac837d79", "submitter": { "id": 116, "url": "https://patchwork.libcamera.org/api/people/116/?format=api", "name": "Kunal Agarwal", "email": "kunalagarwal1072002@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17118/mbox/", "series": [ { "id": 3414, "url": "https://patchwork.libcamera.org/api/series/3414/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3414", "date": "2022-08-14T16:07:42", "name": "[libcamera-devel,v3,1/6] pipeline: simple: shader: Shaders for debayering", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3414/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17118/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17118/checks/", "tags": {}, "headers": { "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\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BCA9BC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 14 Aug 2022 16:08:56 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 85CFE61FC0;\n\tSun, 14 Aug 2022 18:08:56 +0200 (CEST)", "from mail-pg1-x536.google.com (mail-pg1-x536.google.com\n\t[IPv6:2607:f8b0:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C4C2961FBC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Aug 2022 18:08:54 +0200 (CEST)", "by mail-pg1-x536.google.com with SMTP id bh13so4772867pgb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 14 Aug 2022 09:08:54 -0700 (PDT)", "from pop-os.localdomain ([115.96.217.20])\n\tby smtp.googlemail.com with ESMTPSA id\n\tj6-20020a170902da8600b001709aea1516sm5576653plx.276.2022.08.14.09.08.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 14 Aug 2022 09:08:52 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660493336;\n\tbh=r2idUaRfzEcTQdxg1Ff5xpPqVRdDMeYRlgk/SOSaxS0=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=4SXdutv8JWfRiE7kfs7b2sCUx4EBi+Rjss/PLzOFYn+tS8Uao+2OCiAFEvGP9CdIb\n\tTGAZ0KhVOZXT71TEQr95Br54jwqpM/kWOilVgDwLNgnOrDpQLvO7kL0h2g64DnFogg\n\tqzSug1Vo445Ist2UxW5z5xzJHn1zOvrOO+4x9471RKBmjERmJlkLtwYC3bSpIf9kVt\n\tJu/7QrLY/1ytXEJRp5EeIO2IpgOtXcDPHY3BvriKK9NESvIXrurzkK0RnuR8Syqyur\n\todal2M3LZWFV8M4xeK/QwwifOv5fohG0a4yU18d5fWy8FIFSwjYprecWv2qVyD/hue\n\tt27DtmwFxJLug==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=83YbuU0kUdKgf06BbOz5ZPqh339HmPmLaxDcEZrp7Xk=;\n\tb=Zn1LfA2uvqlXVVW7t+lJlJ73Ui5utwjilauyPuCN/NoJccJiashRV2Fj3fyTFU5GeK\n\t902w3OtiC33ZvMaNLwHeMLuJjD0atPT+XIdf0KQXNSpmZwOri3ImTWtNiP4ks78G4WIW\n\tpY4tM68TRAzGcOZqzbiUUo6w0DcVAtXdfPpQdWt76dT/cb4YdqHidPlcdvrGEO1xx/ue\n\tLq8Ol8gazueGw64J7mhbb9Kgyi44XG+WXCzw7ym+WviC1tpZACVLpoiVA4390RbwMnhe\n\t/HAZ0ZHJwiPTJAxi634NHlNHqR4cOEOjLXOAPwzjK/IYxuh/7mY3nSaZrYAw3yKMVhPv\n\t7abw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Zn1LfA2u\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=83YbuU0kUdKgf06BbOz5ZPqh339HmPmLaxDcEZrp7Xk=;\n\tb=JNLn6tguLxkFy5QMX+wVqvyh9+JXbSZH9r+qihLvqNqAiK/URn04BeLG8j9PeICp8Z\n\tNf8lB1p5OrBafLgm+pWmYTZXjNdlYIzNRtnQriy9znUXh67bJzlC5wA5dcF/46dsWeuv\n\tlr4rR46Rh1/ReBn0+ZxS9KJygF2H1SST7c+zljXL+S8tYT0plDCSfI76u0cgED1623Eo\n\t6WNKt017SVKNnrb8PNiOtfZSgfsT0Vt9MYORmmu5F1ikjPUeCGhBchygLUm06u3c9TOZ\n\tRGfpFJVcHXf3cw66JtjmXUaIFGOXiXYMuVyL05DI473GBOITwGVvBC1xVAu/9Kp/hyTv\n\tvusw==", "X-Gm-Message-State": "ACgBeo0Nblpy4zk20efduRJpfkGPRkihrA1ONwxyZTd52fTO36hKR+k+\n\tDvGR9BXlQDAzgEWUAN8S5752ZDyEwwE=", "X-Google-Smtp-Source": "AA6agR6I55IT9l4Kqv5PGT5U6zBabTPCohla9dPqoI+fmdRzz/2yvcy0+ZZs1htyhkZ7uApm4p5nRQ==", "X-Received": "by 2002:a63:4547:0:b0:41d:ba0a:870a with SMTP id\n\tu7-20020a634547000000b0041dba0a870amr10828401pgk.216.1660493333080; \n\tSun, 14 Aug 2022 09:08:53 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sun, 14 Aug 2022 21:37:44 +0530", "Message-Id": "<20220814160747.52093-3-kunalagarwal1072002@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220814160747.52093-1-kunalagarwal1072002@gmail.com>", "References": "<20220814160747.52093-1-kunalagarwal1072002@gmail.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 3/6] pipeline: simple: Implements\n\tTexture Handling", "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>,\n\t<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>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "From": "Kunal Agarwal via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Kunal Agarwal <kunalagarwal1072002@gmail.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Texture Class which includes functions for binding, unbinding,\ndeleting and rendering on textures\n\nSigned-off-by: Kunal Agarwal <kunalagarwal1072002@gmail.com>\n---\n src/libcamera/pipeline/simple/texture.cpp | 53 +++++++++++++++++++++++\n src/libcamera/pipeline/simple/texture.h | 42 ++++++++++++++++++\n 2 files changed, 95 insertions(+)\n create mode 100644 src/libcamera/pipeline/simple/texture.cpp\n create mode 100644 src/libcamera/pipeline/simple/texture.h", "diff": "diff --git a/src/libcamera/pipeline/simple/texture.cpp b/src/libcamera/pipeline/simple/texture.cpp\nnew file mode 100644\nindex 00000000..3551ebc7\n--- /dev/null\n+++ b/src/libcamera/pipeline/simple/texture.cpp\n@@ -0,0 +1,53 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Kunal Agarwal\n+ *\n+ * texture.cpp - Texture Handling\n+ */\n+\n+#include \"texture.h\"\n+\n+#include <libcamera/framebuffer.h>\n+\n+#include <GLES3/gl3.h>\n+\n+namespace libcamera {\n+void Texture::initTexture(GLenum slot)\n+{\n+\t/* Generates an OpenGL texture object and assigns the texture to a Texture Unit */\n+\tglGenTextures(1, &idTex_);\n+\tglActiveTexture(slot);\n+\tglBindTexture(type_, idTex_);\n+\n+\t/* Configures the type of algorithm that is used to make the image smaller or bigger */\n+\tglTexParameteri(type_, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n+\tglTexParameteri(type_, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n+\n+\t/* Prevents edge bleeding */\n+\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);\n+\tglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);\n+}\n+\n+void Texture::startTexture(MappedFrameBuffer *image, GLenum format, GLenum pixelType, Size pixelSize)\n+{\n+\t/* Assigns the image to the OpenGL Texture object */\n+\tglTexImage2D(type_, 0, GL_LUMINANCE, pixelSize.width, pixelSize.height, 0, format, pixelType, image->planes()[0].data());\n+\tglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, idTex_, 0);\n+}\n+\n+void Texture::bind()\n+{\n+\tglBindTexture(type_, idTex_);\n+}\n+\n+void Texture::unbind()\n+{\n+\tglBindTexture(type_, 0);\n+}\n+\n+void Texture::deleteText()\n+{\n+\tglDeleteTextures(1, &idTex_);\n+}\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/simple/texture.h b/src/libcamera/pipeline/simple/texture.h\nnew file mode 100644\nindex 00000000..c4a41f6f\n--- /dev/null\n+++ b/src/libcamera/pipeline/simple/texture.h\n@@ -0,0 +1,42 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2022, Kunal Agarwal\n+ *\n+ * texture.h - Texture Handling\n+ */\n+\n+#pragma once\n+\n+#include <libcamera/geometry.h>\n+\n+#include \"libcamera/internal/mapped_framebuffer.h\"\n+\n+#include \"shader.h\"\n+\n+namespace libcamera {\n+\n+class FrameBuffer;\n+\n+class Texture\n+{\n+public:\n+\tGLuint idTex_;\n+\tGLenum type_;\n+\n+\tTexture(GLenum texType, GLuint rend_text)\n+\t\t: idTex_(rend_text), type_(texType){};\n+\n+\tvoid initTexture(GLenum slot);\n+\n+\tvoid startTexture(MappedFrameBuffer *image, GLenum format, GLenum pixelType, Size pixelSize);\n+\n+\tvoid texUnit(ShaderProgram &shader, const char *uniform, GLuint unit);\n+\n+\tvoid bind();\n+\n+\tvoid unbind();\n+\n+\tvoid deleteText();\n+};\n+\n+} /* namespace libcamera */\n", "prefixes": [ "libcamera-devel", "v3", "3/6" ] }