libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
units.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <cstdint>
14#include <promeki/namespace.h>
15#include <promeki/string.h>
16#include <promeki/enums.h>
17
18PROMEKI_NAMESPACE_BEGIN
19
45class Units {
46 public:
62 static String fromByteCount(uint64_t bytes, int maxDecimals = 3);
63
78 static String fromByteCount(uint64_t bytes, int maxDecimals, const ByteCountStyle &style);
79
97 static String fromDuration(double seconds, int precision = 2);
98
115 static String fromDurationNs(double ns, int precision = 2);
116
137 static String fromDurationMs(double ms, int precision = 2);
138
155 static String fromFrequency(double hz, int precision = 2);
156
175 static String fromSampleCount(uint64_t samples, uint32_t sampleRate, int precision = 2);
176
192 static String fromBytesPerSec(double bps, int precision = 1);
193
209 static String fromBitsPerSec(double bps, int precision = 1);
210
227 static String fromItemsPerSec(double ips, int precision = 1);
228
250 static String fromCount(uint64_t count, int precision = 2);
251
268 static String fromFramesPerSec(double fps, int precision = 2);
269};
270
271PROMEKI_NAMESPACE_END
272
273#endif // PROMEKI_ENABLE_CORE