Photon Common Library 2.0.0-beta
A physically based renderer.
|
The root for all renderer implementations. More...
Namespaces | |
namespace | detail |
Implementation detail mainly for internal usages. | |
namespace | math |
namespace | os |
namespace | string_utils |
Contains various string manipulation helpers. | |
Classes | |
class | CommandLineArguments |
Helper for parsing command line arguments. More... | |
class | Config |
class | FileIOError |
class | FilesystemError |
class | IllegalOperationException |
class | IniFile |
INI file I/O. This class is useful for recording various settings across the entire engine project. As a low-level I/O class in Common library, it can be used regardless the engine initialization state (see init_render_engine() and exit_render_engine() in Engine library for more details). More... | |
class | InvalidArgumentException |
class | IOException |
class | Logger |
struct | LogGroup |
class | LogGroups |
class | LogicalException |
General exception thrown on logical error. More... | |
class | NumericException |
class | OutOfRangeException |
class | OverflowException |
class | RuntimeException |
General exception thrown on runtime error. More... | |
struct | TAlignedArray |
Aligned version of std::array . This type shares the same traits as std::array . [class.mem] section 20 (https://timsong-cpp.github.io/cppwp/n3337/class.mem#20) supports that the alignment can pass through to the inherited std::array as long as the derived type is also a standard-layout type. More... | |
class | TimerStatsReport |
class | Timestamp |
Represents a point in time. More... | |
class | UninitializedObjectException |
Concepts | |
concept | CPhotonException |
Typedefs | |
using | StdUnorderedStringSet |
Unordered std::string set with support for heterogeneous string key lookup. Supports std::string_view and literal (C-style) string lookup in addition to the original std::string lookup. The heterogeneous access can save redundant dynamic allocations when querying the map. | |
template<typename Value > | |
using | TStdUnorderedStringMap |
Unordered std::string map with support for heterogeneous string key lookup. Supports std::string_view and literal (C-style) string lookup in addition to the original std::string lookup. The heterogeneous access can save redundant dynamic allocations when querying the map. | |
using | Exception = std::exception |
using | LogHandler = std::function<void(ELogLevel logLevel, std::string_view logString)> |
template<typename T > | |
using | TAlignedMemoryUniquePtr = std::unique_ptr<T, detail::AlignedMemoryDeleter> |
using | real = float |
using | integer = int |
using | hiReal = float64 |
using | hiInteger = int64 |
using | int8 = std::int8_t |
Fixed-size integer types. | |
using | uint8 = std::uint8_t |
using | int16 = std::int16_t |
using | uint16 = std::uint16_t |
using | int32 = std::int32_t |
using | uint32 = std::uint32_t |
using | int64 = std::int64_t |
using | uint64 = std::uint64_t |
using | int8f = std::int_fast8_t |
Fastest integer types with size guarantee. For example, uint32f is an unsigned integer with at least 32 bits. | |
using | uint8f = std::uint_fast8_t |
using | int16f = std::int_fast16_t |
using | uint16f = std::uint_fast16_t |
using | int32f = std::int_fast32_t |
using | uint32f = std::uint_fast32_t |
using | int64f = std::int_fast64_t |
using | uint64f = std::uint_fast64_t |
using | float32 = float |
Fixed-size floating-point types. | |
using | float64 = double |
Enumerations | |
enum class | ELogLevel { Debug , Note , Warning , Error , DebugOnce , NoteOnce , WarningOnce , ErrorOnce } |
Functions | |
void | debug_break () |
std::string | obtain_stack_trace () |
template<CPhotonException ExceptionType, typename... Args> | |
void | throw_formatted (const std::format_string< Args... > msgFormat, Args &&... args) |
constexpr bool | is_once (const ELogLevel logLevel) |
LogGroups | get_core_log_groups () |
PH_DECLARE_LOG_GROUP (PhotonRenderer) | |
template<typename T = void> | |
auto | make_aligned_memory (std::size_t numBytes, std::size_t alignmentInBytes) -> TAlignedMemoryUniquePtr< T > |
Create an aligned memory resource. | |
template<typename T > | |
void | from_bytes (const std::byte *srcBytes, T *out_dstValue) |
template<typename T > | |
void | to_bytes (const T &srcValue, std::byte *out_dstBytes) |
template<std::size_t N> | |
void | reverse_bytes (std::byte *bytes) |
template<typename T > | |
T * | start_implicit_lifetime_as (void *ptr) noexcept |
Wrapper for std::start_lifetime_as() . Primarily a fallback when C++23 is not available. This function may touch the storage. For cv overloads or one that does not touch the storage, use std::start_lifetime_as() (requires C++23). | |
template<typename T > | |
T * | start_implicit_lifetime_as_array (void *ptr, std::size_t numArrayElements) noexcept |
Wrapper for std::start_lifetime_as_array() . Primarily a fallback when C++23 is not available. This function may touch the storage. For cv overloads or one that does not touch the storage, use std::start_lifetime_as_array() (requires C++23). | |
constexpr real | operator""_r (const long double cookedValue) |
template<typename T > | |
consteval std::size_t | sizeof_in_bits () |
Calculates number of bits an instance of type T occupies. | |
template<typename T , std::size_t N> | |
constexpr std::array< T, N > | make_array (const T &element) |
Creates an std::array filled with the same element. | |
template<std::integral DstType, std::integral SrcType> | |
DstType | lossless_integer_cast (const SrcType &src) |
template<std::floating_point DstType, std::floating_point SrcType> | |
DstType | lossless_float_cast (const SrcType &src) |
template<typename DstType , typename SrcType > | |
DstType | lossless_cast (const SrcType &src) |
Cast numeric value to another type without any loss of information. If there is any possible overflow or numeric precision loss, exception is thrown. | |
template<typename DstType , typename SrcType > | |
DstType | lossless_cast (const SrcType &src, DstType *const out_dst) |
PH_DEFINE_LOG_GROUP (PhotonRenderer, Core) | |
The root for all renderer implementations.
using ph::Exception = std::exception |
using ph::float32 = float |
Fixed-size floating-point types.
using ph::float64 = double |
using ph::hiInteger = int64 |
using ph::hiReal = float64 |
using ph::int16 = std::int16_t |
using ph::int16f = std::int_fast16_t |
using ph::int32 = std::int32_t |
using ph::int32f = std::int_fast32_t |
using ph::int64 = std::int64_t |
using ph::int64f = std::int_fast64_t |
using ph::int8 = std::int8_t |
Fixed-size integer types.
using ph::int8f = std::int_fast8_t |
Fastest integer types with size guarantee. For example, uint32f
is an unsigned integer with at least 32 bits.
using ph::integer = int |
using ph::LogHandler = std::function<void(ELogLevel logLevel, std::string_view logString)> |
using ph::real = float |
Unordered std::string
set with support for heterogeneous string key lookup. Supports std::string_view
and literal (C-style) string lookup in addition to the original std::string
lookup. The heterogeneous access can save redundant dynamic allocations when querying the map.
using ph::TAlignedMemoryUniquePtr = std::unique_ptr<T, detail::AlignedMemoryDeleter> |
using ph::TStdUnorderedStringMap |
Unordered std::string
map with support for heterogeneous string key lookup. Supports std::string_view
and literal (C-style) string lookup in addition to the original std::string
lookup. The heterogeneous access can save redundant dynamic allocations when querying the map.
using ph::uint16 = std::uint16_t |
using ph::uint16f = std::uint_fast16_t |
using ph::uint32 = std::uint32_t |
using ph::uint32f = std::uint_fast32_t |
using ph::uint64 = std::uint64_t |
using ph::uint64f = std::uint_fast64_t |
using ph::uint8 = std::uint8_t |
using ph::uint8f = std::uint_fast8_t |
|
strong |
void ph::debug_break | ( | ) |
|
inline |
LogGroups ph::get_core_log_groups | ( | ) |
|
inlineconstexpr |
|
inline |
Cast numeric value to another type without any loss of information. If there is any possible overflow or numeric precision loss, exception is thrown.
OverflowException | If overflow happens. |
Numericxception | If any numeric precision loss happens. |
|
inline |
|
inline |
|
inline |
|
inline |
Create an aligned memory resource.
The returned memory resource will follow the life time of std::unique_ptr
. Note that the memory allocated by this function is raw memory–placement new is required before any use of the memory content, otherwise it is UB by C++ standard (for non-implicit-lifetime types). For implicit-lifetime types, accessing the raw memory without placement new has defined behavior after C++20.
T | The type to create memory for. alignmentInBytes should be compatible with the type. |
numBytes | Number of bytes to allocate. Must be an integer multiple of alignmentInBytes . |
alignmentInBytes | How many bytes to align (so the returned pointer is an integer multiple of alignmentInBytes ). Must be an integer power of 2 and a multiple of sizeof(void*) . |
nullptr
on failure.
|
inlineconstexpr |
Creates an std::array
filled with the same element.
std::string ph::obtain_stack_trace | ( | ) |
|
inlineconstexpr |
ph::PH_DECLARE_LOG_GROUP | ( | PhotonRenderer | ) |
ph::PH_DEFINE_LOG_GROUP | ( | PhotonRenderer | , |
Core | ) |
|
inline |
|
inlineconsteval |
Calculates number of bits an instance of type T
occupies.
|
inlinenoexcept |
Wrapper for std::start_lifetime_as()
. Primarily a fallback when C++23 is not available. This function may touch the storage. For cv overloads or one that does not touch the storage, use std::start_lifetime_as()
(requires C++23).
unsigned char
or std::byte
implicitly creates objects within the region of storage. See [intro.object] section 13 (https://timsong-cpp.github.io/cppwp/intro.object#13).
|
inlinenoexcept |
Wrapper for std::start_lifetime_as_array()
. Primarily a fallback when C++23 is not available. This function may touch the storage. For cv overloads or one that does not touch the storage, use std::start_lifetime_as_array()
(requires C++23).
unsigned char
or std::byte
implicitly creates objects within the region of storage. See [intro.object] section 13 (https://timsong-cpp.github.io/cppwp/intro.object#13).
|
inline |
|
inline |