Cmd decodes path data as a command and a number of subsequent values for that command
()
| 204 | |
| 205 | // Cmd decodes path data as a command and a number of subsequent values for that command |
| 206 | func (pd PathData) Cmd() (PathCmds, int) { |
| 207 | iv := uint32(pd) |
| 208 | cmd := PathCmds(iv & 0x1F) // only the lowest 5 bits (31 values) for command |
| 209 | n := int((iv & 0xFFFFFFE0) >> 5) // extract the n from remainder of bits |
| 210 | return cmd, n |
| 211 | } |
| 212 | |
| 213 | // EncCmd encodes command and n into PathData |
| 214 | func (pc PathCmds) EncCmd(n int) PathData { |
no test coverage detected