Skip to content

Commit

Permalink
plugin: Add Force HDR option
Browse files Browse the repository at this point in the history
Closes #199
  • Loading branch information
nowrep committed Mar 31, 2024
1 parent 4eae471 commit 151ef9c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/locale/cs-CZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CaptureWindow="Okno"
CaptureAnyWindow="Zaznamenávat jakékoliv okno"
CaptureAnyWindowExcept="Zaznamenávat jakékoliv okno kromě"
AllowTransparency="Povolit průhlednost"
ForceHDR="Vynutit HDR"
1 change: 1 addition & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CaptureWindow="Window"
CaptureAnyWindow="Capture any window"
CaptureAnyWindowExcept="Capture any window except"
AllowTransparency="Allow Transparency"
ForceHDR="Force HDR"
8 changes: 8 additions & 0 deletions src/vkcapture.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ typedef struct {
#endif
bool show_cursor;
bool allow_transparency;
bool force_hdr;
bool window_match;
bool window_exclude;
const char *window;
Expand Down Expand Up @@ -323,6 +324,7 @@ static void vkcapture_source_update(void *data, obs_data_t *settings)

ctx->show_cursor = obs_data_get_bool(settings, "show_cursor");
ctx->allow_transparency = obs_data_get_bool(settings, "allow_transparency");
ctx->force_hdr = obs_data_get_bool(settings, "force_hdr");

ctx->window_match = false;
ctx->window_exclude = false;
Expand Down Expand Up @@ -618,6 +620,7 @@ static void vkcapture_source_get_defaults(obs_data_t *defaults)
{
obs_data_set_default_bool(defaults, "show_cursor", true);
obs_data_set_default_bool(defaults, "allow_transparency", false);
obs_data_set_default_bool(defaults, "force_hdr", false);
}

static obs_properties_t *vkcapture_source_get_properties(void *data)
Expand Down Expand Up @@ -663,6 +666,7 @@ static obs_properties_t *vkcapture_source_get_properties(void *data)
}

obs_properties_add_bool(props, "allow_transparency", obs_module_text("AllowTransparency"));
obs_properties_add_bool(props, "force_hdr", obs_module_text("ForceHDR"));

return props;
}
Expand All @@ -673,6 +677,10 @@ enum gs_color_space vkcapture_get_color_space(void *data, size_t count, const en

enum gs_color_space color_space = ctx->tdata.color_space;

if (ctx->force_hdr) {
color_space = GS_CS_709_EXTENDED;
}

UNUSED_PARAMETER(count);
UNUSED_PARAMETER(preferred_spaces);
return color_space;
Expand Down

0 comments on commit 151ef9c

Please sign in to comment.