MCPcopy Create free account
hub / github.com/apngasm/apngasm / FrameDelay

Class FrameDelay

cli/src/cli.cpp:19–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19class FrameDelay {
20public:
21 int num, den;
22 FrameDelay(void) : num(100), den(1000) {}
23 FrameDelay(int num) : num(num), den(1000) {}
24 FrameDelay(int num, int den) : num(num), den(den) {}
25 FrameDelay(const std::string &src_str) : den(1000) {
26 using namespace std;
27
28 if (isNumber(src_str)) {
29 num = atoi(src_str.c_str());
30 } else { // Delay is in fractions of a second or invalid
31 using boost::algorithm::split;
32
33 vector<string> portions;
34 split(portions, src_str, boost::is_any_of(":"));
35 if (portions.size() != 2 || !isNumber(portions[0]) ||
36 !isNumber(portions[1])) {
37 throw std::runtime_error("parse delay error");
38 }
39 num = atoi(portions[0].c_str());
40 den = atoi(portions[1].c_str());
41 }
42 }
43};
44
45class CustomAPNGAsmListener : public apngasm::listener::APNGAsmListener {
46public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected