Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
picture_basics.h
Go to the documentation of this file.
1#pragma once
2
3#include <Common/assertion.h>
4
5#include <cstddef>
6
7namespace ph
8{
9
11{
12 Empty = 0,
13
14 Int8,
15 UInt8,
16 Int16,
17 UInt16,
18 Int32,
19 UInt32,
20 Int64,
21 UInt64,
22 Float16,
23 Float32,
25};
26
27inline std::size_t num_bytes_in_component(const EPicturePixelComponent componentType)
28{
29 switch(componentType)
30 {
31 case EPicturePixelComponent::Empty: return 0;
32 case EPicturePixelComponent::Int8: return 1;
33 case EPicturePixelComponent::UInt8: return 1;
34 case EPicturePixelComponent::Int16: return 2;
35 case EPicturePixelComponent::UInt16: return 2;
36 case EPicturePixelComponent::Int32: return 4;
37 case EPicturePixelComponent::UInt32: return 4;
38 case EPicturePixelComponent::Int64: return 8;
39 case EPicturePixelComponent::UInt64: return 8;
43 default: PH_ASSERT_UNREACHABLE_SECTION(); return 0;
44 }
45}
46
47}// end namespace ph
The root for all renderer implementations.
Definition EEngineProject.h:6
EPicturePixelComponent
Definition picture_basics.h:11
std::size_t num_bytes_in_component(const EPicturePixelComponent componentType)
Definition picture_basics.h:27