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 for a project's color pipeline: tone-map HDR
12/// sources from its peak, or refuse them.
13#[must_use]
14pub fn color_policy(color: &alpha2_model::ColorPipeline) -> alpha2_render::ColorPolicy {
15    match color.hdr {
16        alpha2_model::HdrSources::Reject => alpha2_render::ColorPolicy::RejectHdr,
17        alpha2_model::HdrSources::ToneMap => {
18            alpha2_render::ColorPolicy::ToneMapHdr(alpha2_render::hdr::HdrToneMap {
19                source_peak_nits: color.hdr_peak_nits,
20            })
21        }
22    }
23}