Unravel Engine C++ Reference
Loading...
Searching...
No Matches
trace_resolution.h
Go to the documentation of this file.
1#pragma once
2
3#include <base/basetypes.hpp>
4#include <algorithm>
5#include <cstdint>
6
7namespace unravel
8{
9
18enum class trace_resolution : uint8_t
19{
20 full = 1,
21 half = 2,
22 quarter = 4,
23 eighth = 8,
24};
25
27inline auto get_divisor(trace_resolution res) -> uint32_t
28{
29 return static_cast<uint32_t>(res);
30}
31
34{
35 const uint32_t d = get_divisor(res);
36 return {std::max(1u, ref.width / d), std::max(1u, ref.height / d)};
37}
38
39
40} // namespace unravel
auto get_divisor(trace_resolution res) -> uint32_t
Returns the integer divisor backing the enum value (never zero).
auto compute_trace_size(const usize32_t &ref, trace_resolution res) -> usize32_t
Computes the trace-target size from a full-resolution reference, clamped to 1x1 min.