[{"id":762,"web_url":"https://patchwork.libcamera.org/comment/762/","msgid":"<20190205183531.GE32622@bigcity.dyn.berto.se>","date":"2019-02-05T18:35:31","subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: Add geometry.h","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your patch.\n\nOn 2019-02-05 18:10:09 +0100, Jacopo Mondi wrote:\n> Add geometry related definitions in the geometry.h internal header\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/geometry.cpp       | 52 ++++++++++++++++++++++++++++++++\n>  src/libcamera/include/geometry.h | 23 ++++++++++++++\n>  src/libcamera/meson.build        |  1 +\n>  3 files changed, 76 insertions(+)\n>  create mode 100644 src/libcamera/geometry.cpp\n>  create mode 100644 src/libcamera/include/geometry.h\n> \n> diff --git a/src/libcamera/geometry.cpp b/src/libcamera/geometry.cpp\n> new file mode 100644\n> index 0000000..2cc67e8\n> --- /dev/null\n> +++ b/src/libcamera/geometry.cpp\n> @@ -0,0 +1,52 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * geometry.h - Geometry-related structures\n\nThis is geometry.cpp right?\n\n> + */\n> +\n> +#include \"geometry.h\"\n> +\n> +/**\n> + * \\file geometry.h\n> + * \\brief Structures and data related to geometric objects\n> + */\n> +\n> +namespace libcamera {\n> +\n> +/**\n> + * \\struct Rectangle\n> + * \\brief Defines a rectangle sizes and position\n\nHow about:\n\n    Describe a rectangles dimensions and its position\n\n> + *\n> + * Rectangles are used to identify an area of an image, or of a memory area\n> + * than contains one. Their location is identified by the coordinates of their\n\ns/than contains one//\n\n> + * leftmost and topmost corner, and their horizontal and vertical length.\n> + *\n> + * The measure unit of the rectangle sizes is defined by the context where the\n> + * rectangle is used.\n> + *\n> + * The reference point from which the Rectangle::x and Rectangle::y\n> + * displacements refers to is defined by the context were rectangle is used.\n> + */\n> +\n> +/**\n> + * \\var Rectangle::x\n> + * \\brief The horizontal displacement of the rectangle's leftmost corner\n> + */\n> +\n> +/**\n> + * \\var Rectangle::y\n> + * \\brief The vertical displacement of the rectangle's topmost corner\n> + */\n> +\n> +/**\n> + * \\var Rectangle::w\n> + * \\brief The distance between the leftmost and rightmost corners\n> + */\n> +\n> +/**\n> + * \\var Rectangle::h\n> + * \\brief The distance between the topmost and bottommost corners\n> + */\n> +\n> +} /* namespace libcamera */\n> diff --git a/src/libcamera/include/geometry.h b/src/libcamera/include/geometry.h\n> new file mode 100644\n> index 0000000..b147c9a\n> --- /dev/null\n> +++ b/src/libcamera/include/geometry.h\n> @@ -0,0 +1,23 @@\n> +/* SPDX-License-Identifier: LGPL-2.1-or-later */\n> +/*\n> + * Copyright (C) 2019, Google Inc.\n> + *\n> + * geometry.h - Geometry-related structure\n> + */\n> +\n> +#ifndef __LIBCAMERA_GEOMETRY_H__\n> +#define __LIBCAMERA_GEOMETRY_H__\n> +\n> +namespace libcamera {\n> +\n> +struct Rectangle\n> +{\n> +\tint x;\n> +\tint y;\n> +\tunsigned int w;\n> +\tunsigned int h;\n> +};\n> +\n> +} /* namespace libcamera */\n> +\n> +#endif /* __LIBCAMERA_GEOMETRY_H__ */\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 9f6ff99..3d6df2d 100644\n> --- a/src/libcamera/meson.build\n> +++ b/src/libcamera/meson.build\n> @@ -5,6 +5,7 @@ libcamera_sources = files([\n>      'event_dispatcher.cpp',\n>      'event_dispatcher_poll.cpp',\n>      'event_notifier.cpp',\n> +    'geometry.cpp',\n>      'log.cpp',\n>      'media_device.cpp',\n>      'media_object.cpp',\n> -- \n> 2.20.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x142.google.com (mail-lf1-x142.google.com\n\t[IPv6:2a00:1450:4864:20::142])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0759060DB9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  5 Feb 2019 19:35:34 +0100 (CET)","by mail-lf1-x142.google.com with SMTP id l142so3439566lfe.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 05 Feb 2019 10:35:33 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tu24sm3873354lfi.24.2019.02.05.10.35.32\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tTue, 05 Feb 2019 10:35:32 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=AAzamSLBgcL3fL7v4ZrMNIOB7GZvHn57LfUw6VCV5R8=;\n\tb=FWdTvWLe5amycpHuiqzM61ksBp1kSxu8/wgCtlvclvAeZ6VqB9/srm0zwJvOa6dN88\n\tvHJEAFxjvcgo6vkNRWpnxcOXiKekdsWRH48tMHGH67Qds7XJUcUtzt4iAhjZaW/DZtPH\n\tZCDTNVky/3TJRvzPV+3vI2rcSQ8Y9gSfOMMl8csbG87gqfPCufLlZCTD/N/zgj8Ttdry\n\ttGyai29D6W3lcVnvckkSQq0zNzcRByPplaiKWnut5mamfYwjMH1q1HqcQl1DCS6xn2Hz\n\tb0vbu+fZcwFXrB+YKpAAe/ro1LOMcf1fjrfjGFGUEw8kqo+V84KSJMoEAhBZ5ao7jsPm\n\tjQOg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=AAzamSLBgcL3fL7v4ZrMNIOB7GZvHn57LfUw6VCV5R8=;\n\tb=WXfJzjULMFT/ASGPXM43S4yHZ4q51HPCZfJabFQ82XjjTd+diQxWS6MGaZchcrXwSd\n\tGGqTgGPdgcu5ife6EbODAS/PfJouTdnDLSvlONONPP/TrNOQlRdhBIVPv8PE0LMHS4RI\n\tH5UD6TCs2M6VJ+cxwJE3ul1oPbr9WIGWQ3o23EPi0a/Hlz2TrhODX9j5SkVFAcP0dtPv\n\t4tdaNKSDoACzVvQ7ZOedpR7eWmlJ2NI9k65MQ3RyEphypqaW95UXx4b0SvLRtbi5CG6G\n\t0/igzZqgCMYzNYFJHpEr5R3BZlztoYDNqGRGZ1XA+0WHeVz+Fa/T9Za1tzHKqqAzOKiw\n\t0ddg==","X-Gm-Message-State":"AHQUAuaSSpOp4/191WD7rPPAgiiKBK/+agp/CMPWgJgOomfnetnykFGk\n\twpDbfkjG6NhD+yyPmpjin6AvJ3MCN/RHNA==","X-Google-Smtp-Source":"AHgI3IZHZ3TpHq1biJMFSer4M/RR6rWRNUHsL0IgfDsN1QZfNt+f4P4x3yfXLQ5xCPHuQiH2Thbk2w==","X-Received":"by 2002:a19:660a:: with SMTP id\n\ta10mr4335066lfc.146.1549391733103; \n\tTue, 05 Feb 2019 10:35:33 -0800 (PST)","Date":"Tue, 5 Feb 2019 19:35:31 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190205183531.GE32622@bigcity.dyn.berto.se>","References":"<20190205171010.1356-1-jacopo@jmondi.org>\n\t<20190205171010.1356-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190205171010.1356-3-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 2/3] libcamera: Add geometry.h","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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>","X-List-Received-Date":"Tue, 05 Feb 2019 18:35:34 -0000"}}]