From 4df64d060a8a89b2cd54678190426079bb9d49a6 Mon Sep 17 00:00:00 2001 From: llyyr Date: Sun, 15 Sep 2024 15:27:44 +0530 Subject: [PATCH] libass/ass_render: add ASS_OVERRIDE_BIT_BLUR to ASS_OverrideBits According to the comment, this was intended to be a part of BIT_FONT_SIZE_FIELDS, but never actually implemented. Adding Blur to that bit now would be a breaking change, so introduce a new bit to control whethe Blur overrides should be applied or not. --- libass/ass.h | 8 ++++++-- libass/ass_render.c | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libass/ass.h b/libass/ass.h index 06a047b26..e317defda 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -24,7 +24,7 @@ #include #include "ass_types.h" -#define LIBASS_VERSION 0x01703010 +#define LIBASS_VERSION 0x01703020 #ifdef __cplusplus extern "C" { @@ -154,7 +154,7 @@ typedef enum { */ ASS_OVERRIDE_BIT_FONT_SIZE ASS_DEPRECATED_ENUM("replaced by ASS_OVERRIDE_BIT_SELECTIVE_FONT_SCALE") = 1 << 1, /** - * On dialogue events override: FontSize, Spacing, Blur, ScaleX, ScaleY + * On dialogue events override: FontSize, Spacing, ScaleX, ScaleY */ ASS_OVERRIDE_BIT_FONT_SIZE_FIELDS = 1 << 2, /** @@ -194,6 +194,10 @@ typedef enum { * On dialogue events override: Justify */ ASS_OVERRIDE_BIT_JUSTIFY = 1 << 10, + /** + * On dialogue events override: Blur + */ + ASS_OVERRIDE_BIT_BLUR = 1 << 11, // New enum values can be added here in new ABI-compatible library releases. } ASS_OverrideBits; diff --git a/libass/ass_render.c b/libass/ass_render.c index b92df1e76..68b11fe70 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -981,6 +981,9 @@ static ASS_Style *handle_selective_style_overrides(RenderContext *state, new->Shadow = user->Shadow * scale; } + if (requested & ASS_OVERRIDE_BIT_BLUR) + new->Blur = user->Blur * scale; + if (requested & ASS_OVERRIDE_BIT_ALIGNMENT) new->Alignment = user->Alignment;