Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo
@ 2025-02-03 20:45 Jörg Habenicht via ffmpeg-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Jörg Habenicht via ffmpeg-devel @ 2025-02-03 20:45 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jörg Habenicht

Add a parameter (boolean) r to switch the area from
rectangular (r=0) to circular(r=1) delogo.

Signed-off-by: Jörg Habenicht <j.habenicht@gmx.de>
---
  libavfilter/vf_delogo.c | 7 ++++---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index bfbf8e6f4c..7641c3b483 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -195,7 +195,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
   typedef struct DelogoContext {
      const AVClass *class;
-    int x, y, w, h, band, show;
+    int x, y, w, h, band, show, round;
      char *x_expr, *y_expr, *w_expr, *h_expr;
      AVExpr *x_pexpr, *y_pexpr, *w_pexpr, *h_pexpr;
      double var_values[VAR_VARS_NB];
@@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
      { "y",    "set logo y position",       OFFSET(y_expr),
AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
      { "w",    "set logo width",            OFFSET(w_expr),
AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
      { "h",    "set logo height",           OFFSET(h_expr),
AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
+    { "r",    "logo is round/ellipse",     OFFSET(round),
AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
      { "show", "show delogo area",          OFFSET(show),
AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
      { NULL }
  };
@@ -259,8 +260,8 @@ static av_cold int init(AVFilterContext *ctx)
       s->band = 1;
  -    av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d, w:%d h:%d band:%d show:%d\n",
-           s->x, s->y, s->w, s->h, s->band, s->show);
+    av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d, w:%d h:%d band:%d round:%d
show:%d\n",
+           s->x, s->y, s->w, s->h, s->band, s->round, s->show);
       s->w += s->band*2;
      s->h += s->band*2;
--
2.45.3

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo
  2025-02-06 17:12   ` Michael Niedermayer
@ 2025-02-06 22:03     ` Jörg Habenicht via ffmpeg-devel
  0 siblings, 0 replies; 4+ messages in thread
From: Jörg Habenicht via ffmpeg-devel @ 2025-02-06 22:03 UTC (permalink / raw)
  To: FFmpeg development discussions and patches; +Cc: Jörg Habenicht

Hi

Am 06.02.25 um 18:12 schrieb Michael Niedermayer:
> Hi Jörg
>
> On Tue, Feb 04, 2025 at 08:53:58PM +0100, Jörg Habenicht via ffmpeg-devel wrote:
>> Add a parameter (boolean) r to switch the area from
>> rectangular (r=0) to circular(r=1) delogo.
>>
[...]

>> @@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
>>      { "y",    "set logo y position",       OFFSET(y_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>>      { "w",    "set logo width",            OFFSET(w_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>>      { "h",    "set logo height",           OFFSET(h_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>> +    { "r",    "logo is round/ellipse",     OFFSET(round),     AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
> maybe a superellipse would be interresting
> https://en.wikipedia.org/wiki/Superellipse
>
> This would allow intermediates between a rectangle, elipse and rhombus
> I imagine this could cover more cases of logos

hm, good idea.

How do I get the user Interface right? Extending the new 'r' option from bool to accept a float type?

r=2.0 would result in an ellipse or circle and r=1.0 would result in a rhombus?

>
> either way teh 3 patches should be merged
>
> thx
>
>
my pleasure


cu

Jörg

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo
  2025-02-04 19:53 ` [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo Jörg Habenicht via ffmpeg-devel
@ 2025-02-06 17:12   ` Michael Niedermayer
  2025-02-06 22:03     ` Jörg Habenicht via ffmpeg-devel
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Niedermayer @ 2025-02-06 17:12 UTC (permalink / raw)
  To: FFmpeg development discussions and patches


[-- Attachment #1.1: Type: text/plain, Size: 1929 bytes --]

Hi Jörg

On Tue, Feb 04, 2025 at 08:53:58PM +0100, Jörg Habenicht via ffmpeg-devel wrote:
> Add a parameter (boolean) r to switch the area from
> rectangular (r=0) to circular(r=1) delogo.
> 
> Signed-off-by: Jörg Habenicht <j.habenicht@gmx.de>
> ---
>  libavfilter/vf_delogo.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
> index bfbf8e6f4c..7641c3b483 100644
> --- a/libavfilter/vf_delogo.c
> +++ b/libavfilter/vf_delogo.c
> @@ -195,7 +195,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
> 
>  typedef struct DelogoContext {
>      const AVClass *class;
> -    int x, y, w, h, band, show;
> +    int x, y, w, h, band, show, round;
>      char *x_expr, *y_expr, *w_expr, *h_expr;
>      AVExpr *x_pexpr, *y_pexpr, *w_pexpr, *h_pexpr;
>      double var_values[VAR_VARS_NB];
> @@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
>      { "y",    "set logo y position",       OFFSET(y_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>      { "w",    "set logo width",            OFFSET(w_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
>      { "h",    "set logo height",           OFFSET(h_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
> +    { "r",    "logo is round/ellipse",     OFFSET(round),     AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },

maybe a superellipse would be interresting
https://en.wikipedia.org/wiki/Superellipse

This would allow intermediates between a rectangle, elipse and rhombus
I imagine this could cover more cases of logos

either way teh 3 patches should be merged

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The smallest minority on earth is the individual. Those who deny 
individual rights cannot claim to be defenders of minorities. - Ayn Rand

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo
  2025-02-04 19:53 [FFmpeg-devel] [PATCH 0/3] Patch to create a circular delogo area Jörg Habenicht via ffmpeg-devel
@ 2025-02-04 19:53 ` Jörg Habenicht via ffmpeg-devel
  2025-02-06 17:12   ` Michael Niedermayer
  0 siblings, 1 reply; 4+ messages in thread
From: Jörg Habenicht via ffmpeg-devel @ 2025-02-04 19:53 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Jörg Habenicht

Add a parameter (boolean) r to switch the area from
rectangular (r=0) to circular(r=1) delogo.

Signed-off-by: Jörg Habenicht <j.habenicht@gmx.de>
---
 libavfilter/vf_delogo.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index bfbf8e6f4c..7641c3b483 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -195,7 +195,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,

 typedef struct DelogoContext {
     const AVClass *class;
-    int x, y, w, h, band, show;
+    int x, y, w, h, band, show, round;
     char *x_expr, *y_expr, *w_expr, *h_expr;
     AVExpr *x_pexpr, *y_pexpr, *w_pexpr, *h_pexpr;
     double var_values[VAR_VARS_NB];
@@ -209,6 +209,7 @@ static const AVOption delogo_options[]= {
     { "y",    "set logo y position",       OFFSET(y_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
     { "w",    "set logo width",            OFFSET(w_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
     { "h",    "set logo height",           OFFSET(h_expr),    AV_OPT_TYPE_STRING, { .str = "-1" }, 0, 0, FLAGS },
+    { "r",    "logo is round/ellipse",     OFFSET(round),     AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
     { "show", "show delogo area",          OFFSET(show),      AV_OPT_TYPE_BOOL,   { .i64 =  0 },   0, 1, FLAGS },
     { NULL }
 };
@@ -259,8 +260,8 @@ static av_cold int init(AVFilterContext *ctx)

     s->band = 1;

-    av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d, w:%d h:%d band:%d show:%d\n",
-           s->x, s->y, s->w, s->h, s->band, s->show);
+    av_log(ctx, AV_LOG_VERBOSE, "x:%d y:%d, w:%d h:%d band:%d round:%d show:%d\n",
+           s->x, s->y, s->w, s->h, s->band, s->round, s->show);

     s->w += s->band*2;
     s->h += s->band*2;
--
2.45.3

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-06 22:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-03 20:45 [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo Jörg Habenicht via ffmpeg-devel
2025-02-04 19:53 [FFmpeg-devel] [PATCH 0/3] Patch to create a circular delogo area Jörg Habenicht via ffmpeg-devel
2025-02-04 19:53 ` [FFmpeg-devel] [PATCH 1/3] avfilter/delogo: add parameter to switch on circular delogo Jörg Habenicht via ffmpeg-devel
2025-02-06 17:12   ` Michael Niedermayer
2025-02-06 22:03     ` Jörg Habenicht via ffmpeg-devel

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git