Skip to main content

alpha2_engine/
policy.rs

1/// The action a host should take after its renderer reports missing frames.
2#[derive(Copy, Clone, Debug, Eq, PartialEq)]
3#[non_exhaustive]
4pub enum MissingFramePolicy {
5    /// Reuse the prior rendered output and continue real-time playback.
6    HoldPrevious,
7    /// Wait for host decode/upload before advancing export.
8    Wait,
9}
10
11/// The renderer's color policy: tone-map HDR sources from the project peak, or refuse them.
12#[must_use]
13pub fn color_policy(color: &alpha2_model::ColorPipeline) -> alpha2_render::ColorPolicy {
14    match color.hdr {
15        alpha2_model::HdrSources::Reject => alpha2_render::ColorPolicy::RejectHdr,
16        alpha2_model::HdrSources::ToneMap => {
17            alpha2_render::ColorPolicy::ToneMapHdr(alpha2_render::hdr::HdrToneMap {
18                source_peak_nits: color.hdr_peak_nits,
19            })
20        }
21    }
22}