MCPcopy
hub / github.com/tdewolff/canvas / cmdLen

Function cmdLen

path.go:79–83  ·  view source on GitHub ↗

cmdLen returns the number of values (float64s) the path command contains.

(cmd float64)

Source from the content-addressed store, hash-verified

77
78// cmdLen returns the number of values (float64s) the path command contains.
79func cmdLen(cmd float64) int {
80 // extract only part of the exponent, this is 3 times faster than using a switch on cmd
81 n := uint8((math.Float64bits(cmd)&0x0FF0000000000000)>>52) + 1
82 return cmdLens[n]
83}
84
85// toArcFlags converts to the largeArc and sweep boolean flags given its value in the path.
86func toArcFlags(f float64) (bool, bool) {

Callers 15

ScanMethod · 0.85
ValuesMethod · 0.85
StartMethod · 0.85
CP1Method · 0.85
CP2Method · 0.85
ArcMethod · 0.85
ScanMethod · 0.85
ValuesMethod · 0.85
EndMethod · 0.85
RayIntersectionsMethod · 0.85
AddPathEndpointsMethod · 0.85
GridsnapMethod · 0.85

Calls

no outgoing calls

Tested by 1

BenchmarkScannerFunction · 0.68