MCPcopy Index your code
hub / github.com/processing/processing / pathTo

Method pathTo

core/src/processing/opengl/LinePath.java:472–502  ·  view source on GitHub ↗
(PathIterator pi, LineStroker lsink)

Source from the content-addressed store, hash-verified

470
471
472 private static void pathTo(PathIterator pi, LineStroker lsink) {
473 float coords[] = new float[6];
474 while (!pi.isDone()) {
475 int color;
476 switch (pi.currentSegment(coords)) {
477 case SEG_MOVETO:
478 color = ((int)coords[2]<<24) |
479 ((int)coords[3]<<16) |
480 ((int)coords[4]<< 8) |
481 (int)coords[5];
482 lsink.moveTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]), color);
483 break;
484 case SEG_LINETO:
485 color = ((int)coords[2]<<24) |
486 ((int)coords[3]<<16) |
487 ((int)coords[4]<< 8) |
488 (int)coords[5];
489 lsink.lineJoin();
490 lsink.lineTo(FloatToS15_16(coords[0]), FloatToS15_16(coords[1]), color);
491 break;
492 case SEG_CLOSE:
493 lsink.lineJoin();
494 lsink.close();
495 break;
496 default:
497 throw new InternalError("unknown flattened segment type");
498 }
499 pi.next();
500 }
501 lsink.end();
502 }
503
504
505 /////////////////////////////////////////////////////////////////////////////

Callers 1

strokeToMethod · 0.95

Calls 9

FloatToS15_16Method · 0.95
isDoneMethod · 0.65
currentSegmentMethod · 0.65
nextMethod · 0.65
endMethod · 0.65
moveToMethod · 0.45
lineJoinMethod · 0.45
lineToMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected