Skip to content

Commit

Permalink
libass/ass_render: add ASS_OVERRIDE_BIT_BLUR to ASS_OverrideBits
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
llyyr authored and astiob committed Nov 2, 2024
1 parent cfa8c2e commit 4df64d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libass/ass.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <stdarg.h>
#include "ass_types.h"

#define LIBASS_VERSION 0x01703010
#define LIBASS_VERSION 0x01703020

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -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,
/**
Expand Down Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions libass/ass_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4df64d0

Please sign in to comment.