| 17 | } |
| 18 | |
| 19 | class FrameDelay { |
| 20 | public: |
| 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 | |
| 45 | class CustomAPNGAsmListener : public apngasm::listener::APNGAsmListener { |
| 46 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected