linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
To: Benoit Parrot <bparrot@ti.com>, Hans Verkuil <hverkuil@xs4all.nl>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	Sylwester Nawrocki <s.nawrocki@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [Patch 1/2] media: v4l2-rect.h: add enclosed rectangle helper
Date: Fri, 29 May 2020 13:57:51 +0200	[thread overview]
Message-ID: <6b88258e-4567-3c0b-8c90-6053dbb7634a@gmail.com> (raw)
In-Reply-To: <20200528132605.18339-2-bparrot@ti.com>

Hi Benoit,

Thank you for the patch,

W dniu 28.05.2020 o 15:26, Benoit Parrot pisze:
> Add a helper function to check if one rectangle is enclosed inside
> another.
> 
> Signed-off-by: Benoit Parrot <bparrot@ti.com>

Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>

> ---
>   include/media/v4l2-rect.h | 20 ++++++++++++++++++++
>   1 file changed, 20 insertions(+)
> 
> diff --git a/include/media/v4l2-rect.h b/include/media/v4l2-rect.h
> index 8800a640c224..bd587d0c0dc3 100644
> --- a/include/media/v4l2-rect.h
> +++ b/include/media/v4l2-rect.h
> @@ -184,4 +184,24 @@ static inline bool v4l2_rect_overlap(const struct v4l2_rect *r1,
>   	return true;
>   }
>   
> +/**
> + * v4l2_rect_enclosed() - is r1 enclosed in r2?
> + * @r1: rectangle.
> + * @r2: rectangle.
> + *
> + * Returns true if @r1 is enclosed in @r2.
> + */
> +static inline bool v4l2_rect_enclosed(struct v4l2_rect *r1,
> +				      struct v4l2_rect *r2)
> +{
> +	if (r1->left < r2->left || r1->top < r2->top)
> +		return false;
> +	if (r1->left + r1->width > r2->left + r2->width)
> +		return false;
> +	if (r1->top + r1->height > r2->top + r2->height)
> +		return false;
> +
> +	return true;
> +}
> +
>   #endif
> 

  reply	other threads:[~2020-05-29 11:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 13:26 [Patch 0/2] media: v4l2-rect.h: add enclosed rectangle helper Benoit Parrot
2020-05-28 13:26 ` [Patch 1/2] " Benoit Parrot
2020-05-29 11:57   ` Andrzej Pietrasiewicz [this message]
2020-05-30 11:51   ` Lad, Prabhakar
2020-05-28 13:26 ` [Patch 2/2] media: use v4l2_rect_enclosed helper Benoit Parrot
2020-05-29 11:59   ` Andrzej Pietrasiewicz
2020-05-30 11:53   ` Lad, Prabhakar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6b88258e-4567-3c0b-8c90-6053dbb7634a@gmail.com \
    --to=andrzejtp2010@gmail.com \
    --cc=bparrot@ti.com \
    --cc=hverkuil@xs4all.nl \
    --cc=jacek.anaszewski@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.com \
    --cc=s.nawrocki@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).