Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add use_scene_referred to zimg_graph_builder_params #196

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
3.0.5
api: add 'use_scene_referred' flag to zimg_graph_builder_params
colorspace: add ST.428-1 (gamma 2.6) transfer function
depth: fix AVX-512 integer to float border handling (introduced in 2.6)
depth: fix NEON dither border handling (introduced in 3.0)
Expand Down
3 changes: 3 additions & 0 deletions doc/example/hdr_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct Arguments {
char fast;
char hlg;
char wcg;
char scene_referred;
};

const ArgparseOption program_switches[] = {
Expand All @@ -69,6 +70,7 @@ const ArgparseOption program_switches[] = {
{ OPTION_FLOAT, "l", "luminance", offsetof(Arguments, luminance), nullptr, "legacy peak brightness (cd/m^2)" },
{ OPTION_USER1, "k", "key", offsetof(Arguments, mask_key), decode_mask_key, "HDR color key (RRGGBB hex string)" },
{ OPTION_STRING, "m", "mask", offsetof(Arguments, hdrpath), nullptr, "HDR difference mask" },
{ OPTION_STRING, "s", "sceneref", offsetof(Arguments, scene_referred), nullptr, "use scene-referred transfer functions" },
{ OPTION_NULL }
};

Expand Down Expand Up @@ -241,6 +243,7 @@ void execute(const Arguments &args)
zimgxx::zfilter_graph_builder_params params;
params.nominal_peak_luminance = args.luminance;
params.allow_approximate_gamma = !!args.fast;
params.use_scene_referred = !!args.scene_referred;

// HDR10 specification.
zimgxx::zimage_format src_format;
Expand Down
6 changes: 6 additions & 0 deletions src/zimg/api/zimg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ zimg::graph::GraphBuilder::params import_graph_params(const zimg_graph_builder_p
params.peak_luminance = src.nominal_peak_luminance;
params.approximate_gamma = !!src.allow_approximate_gamma;
}
if (src.version >= API_VERSION_2_4) {
params.scene_referred = !!src.use_scene_referred;
}

return params;
}
Expand Down Expand Up @@ -710,6 +713,9 @@ void zimg_graph_builder_params_default(zimg_graph_builder_params *ptr, unsigned
ptr->nominal_peak_luminance = NAN;
ptr->allow_approximate_gamma = 0;
}
if (version >= API_VERSION_2_4) {
ptr->use_scene_referred = 0;
}
}

zimg_filter_graph *zimg_filter_graph_build(const zimg_image_format *src_format, const zimg_image_format *dst_format, const zimg_graph_builder_params *params)
Expand Down
3 changes: 3 additions & 0 deletions src/zimg/api/zimg.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ typedef struct zimg_graph_builder_params {

/** Allow evaluating transfer functions at reduced precision (default false). */
char allow_approximate_gamma;

/** Use scene-referred transfer functions (default false).*/
char use_scene_referred;
} zimg_graph_builder_params;

/**
Expand Down