31 std::unique_ptr<Drawable> drawable(Drawable::createFromImageData(data, data_size));
32 return drawable->getOutlineAsPath();
40 Path path =
fromSvgData((
const void*)BinaryData::vital_ring_svg, BinaryData::vital_ring_svgSize);
41 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
51 Path path =
fromSvgData((
const void*)BinaryData::vital_v_svg, BinaryData::vital_ring_svgSize);
52 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
62 return fromSvgData((
const void*)BinaryData::vital_word_svg, BinaryData::vital_word_svgSize);
70 return fromSvgData((
const void*)BinaryData::vital_word_ring_svg, BinaryData::vital_word_ring_svgSize);
78 return fromSvgData((
const void*)BinaryData::chorus_svg, BinaryData::chorus_svgSize);
86 return fromSvgData((
const void*)BinaryData::compressor_svg, BinaryData::compressor_svgSize);
94 return fromSvgData((
const void*)BinaryData::delay_svg, BinaryData::delay_svgSize);
102 return fromSvgData((
const void*)BinaryData::distortion_svg, BinaryData::distortion_svgSize);
110 return fromSvgData((
const void*)BinaryData::equalizer_svg, BinaryData::equalizer_svgSize);
118 return fromSvgData((
const void*)BinaryData::effects_filter_svg, BinaryData::effects_filter_svgSize);
126 return fromSvgData((
const void*)BinaryData::flanger_svg, BinaryData::flanger_svgSize);
134 return fromSvgData((
const void*)BinaryData::folder_svg, BinaryData::folder_svgSize);
142 return fromSvgData((
const void*)BinaryData::phaser_svg, BinaryData::phaser_svgSize);
150 return fromSvgData((
const void*)BinaryData::reverb_svg, BinaryData::reverb_svgSize);
158 static const PathStrokeType arrow_stroke(0.1f, PathStrokeType::JointStyle::curved,
159 PathStrokeType::EndCapStyle::rounded);
161 Path prev_line, prev_shape;
162 prev_line.startNewSubPath(0.65f, 0.3f);
163 prev_line.lineTo(0.35f, 0.5f);
164 prev_line.lineTo(0.65f, 0.7f);
166 arrow_stroke.createStrokedPath(prev_shape, prev_line);
167 prev_shape.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
168 prev_shape.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
177 static const PathStrokeType arrow_stroke(0.1f, PathStrokeType::JointStyle::curved,
178 PathStrokeType::EndCapStyle::rounded);
180 Path next_line, next_shape;
181 next_line.startNewSubPath(0.35f, 0.3f);
182 next_line.lineTo(0.65f, 0.5f);
183 next_line.lineTo(0.35f, 0.7f);
185 arrow_stroke.createStrokedPath(next_shape, next_line);
186 next_shape.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
187 next_shape.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
196 static const float kClockAngle = 1.0f;
197 static const float kClockWidth = 0.4f;
198 static const float kBuffer = (1.0f - kClockWidth) / 2.0f;
201 path.addPieSegment(kBuffer, kBuffer, kClockWidth, kClockWidth, 0.0f, kClockAngle - 2.0f *
vital::kPi, 0.0f);
202 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
203 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
212 return fromSvgData((
const void*)BinaryData::drag_drop_arrows_svg, BinaryData::drag_drop_arrows_svgSize);
220 static constexpr float kLeftAdjustment = 1.0f / 32.0f;
221 static constexpr float kNoteWidth = 1.0f / 4.0f;
222 static constexpr float kNoteHeight = 1.0f / 5.0f;
223 static constexpr float kBarHeight = 2.0f / 5.0f;
224 static constexpr float kBarWidth = 1.0f / 20.0f;
225 static constexpr float kY = 1.0f - (1.0f - kBarHeight + kNoteHeight / 2.0f) / 2.0f;
226 static constexpr float kX = (1.0f - kNoteWidth) / 2.0f - kLeftAdjustment;
229 path.addEllipse(kX, kY - kNoteHeight / 2.0f, kNoteWidth, kNoteHeight);
230 path.addRectangle(kX + kNoteWidth - kBarWidth, kY - kBarHeight, kBarWidth, kBarHeight);
233 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
234 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
243 static constexpr float kNoteWidth = 1.0f / 5.0f;
244 static constexpr float kNoteHeight = 1.0f / 6.0f;
245 static constexpr float kX = (1.0f - 3.0f * kNoteWidth) / 2.0f;
246 static constexpr float kBarWidth = 1.0f / 20.0f;
247 static constexpr float kBarHeight = 1.0f / 4.0f;
248 static constexpr float kY = 1.0f - (1.0f - kBarHeight) / 2.0f;
251 path.addRectangle(kX + kNoteWidth - kBarWidth, kY - kBarHeight - kBarWidth,
252 2.0f * kNoteWidth + kBarWidth, kBarWidth);
254 path.addEllipse(kX, kY - kNoteHeight / 2.0f, kNoteWidth, kNoteHeight);
255 path.addRectangle(kX + kNoteWidth - kBarWidth, kY - kBarHeight, kBarWidth, kBarHeight);
256 path.addEllipse(kX + kNoteWidth, kY - kNoteHeight / 2.0f, kNoteWidth, kNoteHeight);
257 path.addRectangle(kX + kNoteWidth - kBarWidth + kNoteWidth, kY - kBarHeight, kBarWidth, kBarHeight);
258 path.addEllipse(kX + 2.0f * kNoteWidth, kY - kNoteHeight / 2.0f, kNoteWidth, kNoteHeight);
259 path.addRectangle(kX + kNoteWidth - kBarWidth + 2.0f * kNoteWidth, kY - kBarHeight, kBarWidth, kBarHeight);
262 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
263 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
273 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
274 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
275 path.addLineSegment(Line<float>(0.2f, 0.3f, 0.8f, 0.3f), 0.05f);
276 path.addLineSegment(Line<float>(0.2f, 0.5f, 0.8f, 0.5f), 0.05f);
277 path.addLineSegment(Line<float>(0.2f, 0.7f, 0.8f, 0.7f), 0.05f);
287 static constexpr float kBuffer = 0.2f;
288 static constexpr float kLineWidth = 0.04f;
289 static constexpr float kSpacing = 0.2f;
291 int buffer = std::round(width * kBuffer);
292 int line_width = std::max<int>(1, width * kLineWidth);
293 int spacing = width * kSpacing;
295 float center = (line_width % 2) * 0.5f + (width / 2);
297 path.addLineSegment(Line<float>(buffer, center - spacing, width - buffer, center - spacing), line_width);
298 path.addLineSegment(Line<float>(buffer, center, width - buffer, center), line_width);
299 path.addLineSegment(Line<float>(buffer, center + spacing, width - buffer, center + spacing), line_width);
300 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
301 path.addLineSegment(Line<float>(width, width, width, width), 0.2f);
306 static constexpr float kBuffer = 0.35f;
307 static constexpr float kLineWidth = 0.04f;
309 int buffer = std::round(width * kBuffer);
310 int line_width = std::max<int>(1, width * kLineWidth);
312 float center = (line_width % 2) * 0.5f + (width / 2);
314 path.addLineSegment(Line<float>(buffer, center, width - buffer, center), line_width);
315 path.addLineSegment(Line<float>(center, buffer, center, width - buffer), line_width);
317 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
318 path.addLineSegment(Line<float>(width, width, width, width), 0.2f);
323 static constexpr float kBuffer = 0.2f;
324 static constexpr float kLineWidth = 0.15f;
326 float start = kBuffer;
327 float end = 1.0f - kBuffer;
328 float close = 0.5f - kLineWidth * 0.5f;
329 float far = 0.5f + kLineWidth * 0.5f;
332 path.startNewSubPath(start, close);
333 path.lineTo(start, far);
334 path.lineTo(close, far);
335 path.lineTo(close, end);
336 path.lineTo(far, end);
337 path.lineTo(far, far);
338 path.lineTo(end, far);
339 path.lineTo(end, close);
340 path.lineTo(far, close);
341 path.lineTo(far, start);
342 path.lineTo(close, start);
343 path.lineTo(close, close);
344 path.lineTo(start, close);
347 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
348 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
353 static constexpr float kLineWidth = 0.04f;
354 static constexpr float kSpacingX = 0.3f;
355 static constexpr float kSpacingY = 0.25f;
356 static constexpr float kArrowMovement = 0.14f;
357 static constexpr float kBoxWrap = 0.07f;
359 int line_width = std::max<int>(1, width * kLineWidth);
360 int spacing_x = width * kSpacingX;
361 int spacing_y = width * kSpacingY;
362 float movement = width * kArrowMovement / 2.0f;
363 float wrap = width * kBoxWrap;
365 float center = (line_width % 2) * 0.5f + (width / 2);
368 outline.startNewSubPath(center, center - spacing_y);
369 outline.lineTo(center, center + movement);
371 outline.startNewSubPath(center - 2 * movement, center - movement);
372 outline.lineTo(center, center + movement);
373 outline.lineTo(center + 2 * movement, center - movement);
375 outline.startNewSubPath(center - spacing_x + wrap, center);
376 outline.lineTo(center - spacing_x, center);
377 outline.lineTo(center - spacing_x, center + spacing_y);
378 outline.lineTo(center + spacing_x, center + spacing_y);
379 outline.lineTo(center + spacing_x, center);
380 outline.lineTo(center + spacing_x - wrap, center);
383 PathStrokeType stroke(line_width, PathStrokeType::curved, PathStrokeType::rounded);
384 stroke.createStrokedPath(path, outline);
385 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
386 path.addLineSegment(Line<float>(width, width, width, width), 0.2f);
393 path.startNewSubPath(0.33f, 0.4f);
394 path.lineTo(0.66f, 0.4f);
395 path.lineTo(0.5f, 0.6f);
398 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
399 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
406 path.startNewSubPath(0.33f, 0.6f);
407 path.lineTo(0.66f, 0.6f);
408 path.lineTo(0.5f, 0.4f);
411 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
412 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
418 outline.startNewSubPath(0.25f, 0.25f);
419 outline.lineTo(0.75f, 0.75f);
420 outline.startNewSubPath(0.25f, 0.75f);
421 outline.lineTo(0.75f, 0.25f);
424 PathStrokeType stroke(0.03f, PathStrokeType::curved, PathStrokeType::rounded);
425 stroke.createStrokedPath(path, outline);
426 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
427 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
433 outline.startNewSubPath(0.25f, 0.25f);
434 outline.lineTo(0.75f, 0.75f);
435 outline.startNewSubPath(0.25f, 0.75f);
436 outline.lineTo(0.75f, 0.25f);
439 PathStrokeType stroke(0.1f, PathStrokeType::curved, PathStrokeType::butt);
440 stroke.createStrokedPath(path, outline);
441 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
442 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
448 path.addStar(Point<float>(0.5f, 0.5f), 5, 0.2f, 0.4f);
449 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
450 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
456 path.addLineSegment(Line<float>(0.2f, 0.2f, 0.2f, 0.2f), 0.01f);
457 path.addLineSegment(Line<float>(0.8f, 0.8f, 0.8f, 0.8f), 0.01f);
459 path.startNewSubPath(0.24f, 0.35f);
460 path.lineTo(0.24f, 0.65f);
461 path.lineTo(0.41f, 0.65f);
462 path.lineTo(0.41f, 0.5f);
463 path.lineTo(0.35f, 0.5f);
464 path.lineTo(0.35f, 0.35f);
467 path.startNewSubPath(0.48f, 0.65f);
468 path.lineTo(0.48f, 0.35f);
469 path.lineTo(0.52f, 0.35f);
470 path.lineTo(0.52f, 0.5f);
471 path.lineTo(0.58f, 0.5f);
472 path.lineTo(0.58f, 0.65f);
473 path.lineTo(0.42f, 0.65f);
474 path.lineTo(0.42f, 0.5f);
475 path.lineTo(0.48f, 0.5f);
478 path.startNewSubPath(0.65f, 0.35f);
479 path.lineTo(0.76f, 0.35f);
480 path.lineTo(0.76f, 0.65f);
481 path.lineTo(0.59f, 0.65f);
482 path.lineTo(0.59f, 0.5f);
483 path.lineTo(0.65f, 0.5f);
484 path.lineTo(0.65f, 0.35f);
493 board.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.01f);
494 board.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.01f);
500 path.startNewSubPath(1, 0);
508 path.startNewSubPath(29, 0);
518 path.startNewSubPath(57, 0);
526 path.startNewSubPath(73, 0);
534 path.startNewSubPath(99, 0);
544 path.startNewSubPath(128, 0);
554 path.startNewSubPath(157, 0);
566 static constexpr float kRadius = 0.3f;
567 static constexpr float kGearOuterRatio = 1.2f;
568 static constexpr int kNumGearTeeth = 8;
571 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
572 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
573 float offset = 0.5f - kRadius;
574 float diameter = 2.0f * kRadius;
575 path.addPieSegment(offset, offset, diameter, diameter, 0.0f, 2.0f *
vital::kPi, 0.5f);
576 for (
int i = 0; i < kNumGearTeeth; ++i) {
577 float phase = 2.0f * i *
vital::kPi / kNumGearTeeth;
578 float x_offset = kRadius * cosf(phase);
579 float y_offset = kRadius * sinf(phase);
580 Line<float> line(0.5f + x_offset, 0.5f + y_offset,
581 0.5f + kGearOuterRatio * x_offset, 0.5f + kGearOuterRatio * y_offset);
582 path.addLineSegment(line, 0.13f);
589 static constexpr float kRadius = 0.22f;
590 static constexpr float kWidthRatio = 0.3f;
591 static constexpr float kGlassOffset = 0.2f;
592 static constexpr float kSqrt2 = 1.41421356237f;
595 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
596 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
597 float diameter = 2.0f * kRadius;
598 path.addPieSegment(kGlassOffset, kGlassOffset, diameter, diameter, 0.0f, 2.0f *
vital::kPi, 1.0f - kWidthRatio);
600 float line_width = kWidthRatio * kRadius;
601 float line_start = kGlassOffset + kSqrt2 * kRadius + line_width / 2.0f;
602 path.addLineSegment(Line<float>(line_start, line_start, 1.0f - kGlassOffset, 1.0f - kGlassOffset), line_width);
609 outline.startNewSubPath(0.5f, 0.25f);
610 outline.lineTo(0.5f, 0.6f);
611 outline.startNewSubPath(0.35f, 0.45f);
612 outline.lineTo(0.5f, 0.6f);
613 outline.lineTo(0.65f, 0.45f);
615 outline.startNewSubPath(0.25f, 0.5f);
616 outline.lineTo(0.2f, 0.5f);
617 outline.lineTo(0.2f, 0.75f);
618 outline.lineTo(0.8f, 0.75f);
619 outline.lineTo(0.8f, 0.5f);
620 outline.lineTo(0.75f, 0.5f);
623 PathStrokeType stroke(0.05f, PathStrokeType::curved, PathStrokeType::rounded);
624 stroke.createStrokedPath(path, outline);
625 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
626 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
632 outline.startNewSubPath(0.68f, 0.3f);
633 outline.lineTo(0.85f, 0.3f);
634 outline.lineTo(0.85f, 0.7f);
635 outline.lineTo(0.15f, 0.7f);
636 outline.lineTo(0.15f, 0.3f);
637 outline.lineTo(0.61f, 0.3f);
638 PathStrokeType outer_stroke(0.12f, PathStrokeType::curved, PathStrokeType::rounded);
641 outer_stroke.createStrokeWithArrowheads(path, outline, 0.0f, 0.0f, 0.4f, 0.26f);
642 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
643 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
648 Path left_outline, right_outline;
649 left_outline.startNewSubPath(0.5f, 0.5f);
650 left_outline.lineTo(0.0f, 0.5f);
651 left_outline.startNewSubPath(0.5f, 0.5f);
652 left_outline.lineTo(1.0f, 0.5f);
654 PathStrokeType stroke(0.12f, PathStrokeType::curved, PathStrokeType::butt);
655 Path left_path, right_path;
656 stroke.createStrokeWithArrowheads(left_path, left_outline, 0.0f, 0.0f, 0.4f, 0.26f);
657 stroke.createStrokeWithArrowheads(right_path, right_outline, 0.0f, 0.0f, 0.4f, 0.26f);
660 path.addPath(left_path);
661 path.addPath(right_path);
663 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
664 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
669 Path left_outline, right_outline;
670 left_outline.startNewSubPath(0.3f, 0.5f);
671 left_outline.lineTo(0.0f, 0.5f);
672 left_outline.startNewSubPath(0.7f, 0.5f);
673 left_outline.lineTo(1.0f, 0.5f);
675 PathStrokeType stroke(0.12f, PathStrokeType::curved, PathStrokeType::rounded);
676 Path left_path, right_path;
677 stroke.createStrokeWithArrowheads(left_path, left_outline, 0.0f, 0.0f, 0.4f, 0.26f);
678 stroke.createStrokeWithArrowheads(right_path, right_outline, 0.0f, 0.0f, 0.4f, 0.26f);
681 path.addEllipse(0.4f, 0.4f, 0.2f, 0.2f);
682 path.addPath(left_path);
683 path.addPath(right_path);
685 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
686 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
692 over.startNewSubPath(0.1f, 0.7f);
693 over.lineTo(0.25f, 0.7f);
694 over.lineTo(0.55f, 0.3f);
695 over.lineTo(0.95f, 0.3f);
698 under_first.startNewSubPath(0.1f, 0.3f);
699 under_first.lineTo(0.25f, 0.3f);
700 under_first.lineTo(0.325f, 0.4f);
703 under_second.startNewSubPath(0.475f, 0.6f);
704 under_second.lineTo(0.55f, 0.7f);
705 under_second.lineTo(0.95f, 0.7f);
707 PathStrokeType stroke(0.12f, PathStrokeType::curved, PathStrokeType::butt);
709 stroke.createStrokeWithArrowheads(over_path, over, 0.0f, 0.0f, 0.35f, 0.26f);
710 Path under_path_first;
711 stroke.createStrokedPath(under_path_first, under_first);
712 Path under_path_second;
713 stroke.createStrokeWithArrowheads(under_path_second, under_second, 0.0f, 0.0f, 0.35f, 0.26f);
716 path.addPath(over_path);
717 path.addPath(under_path_first);
718 path.addPath(under_path_second);
720 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
721 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
726 static constexpr float kPencilDimension = 0.14f;
727 static constexpr float kEraserLength = 0.6f * kPencilDimension;
728 static constexpr float kSeparatorWidth = 0.15f * kPencilDimension;
729 static constexpr float kPencilRemoval = kEraserLength + kSeparatorWidth;
730 static constexpr float kBorder = 0.22f;
733 path.startNewSubPath(kBorder, 1.0f - kBorder);
734 path.lineTo(kBorder + kPencilDimension, 1.0f - kBorder);
735 path.lineTo(1.0f - kBorder - kPencilRemoval, kBorder + kPencilDimension + kPencilRemoval);
736 path.lineTo(1.0f - kBorder - kPencilRemoval - kPencilDimension, kBorder + kPencilRemoval);
737 path.lineTo(kBorder, 1.0f - kBorder - kPencilDimension);
740 path.startNewSubPath(1.0f - kBorder - kPencilDimension, kBorder);
741 path.lineTo(1.0f - kBorder, kBorder + kPencilDimension);
742 path.lineTo(1.0f - kBorder - kEraserLength, kBorder + kPencilDimension + kEraserLength);
743 path.lineTo(1.0f - kBorder - kEraserLength - kPencilDimension, kBorder + kEraserLength);
746 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
747 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
752 static constexpr float kBorder = 0.15f;
753 static constexpr float kLineWidth = 0.1f;
754 static constexpr float kEndpointStrokeWidth = 0.08f;
755 static constexpr float kEndpointRadius = 0.09f;
756 static constexpr int kNumCurvePoints = 16;
757 static constexpr float kFullRadians =
vital::kPi * 2.0f;
758 static constexpr float kBumpIn = kEndpointRadius;
759 static constexpr float kAdjustXIn = kBumpIn + kEndpointRadius / 2.0f;
762 float start_x = kBorder + kAdjustXIn;
763 float start_y = 1.0f - kBorder - kBumpIn;
764 float end_x = 1.0f - kBorder - kAdjustXIn;
765 float end_y = kBorder + kBumpIn;
767 curve.startNewSubPath(start_x, end_x);
768 for (
int i = 0; i < kNumCurvePoints; ++i) {
769 float t = (1.0f + i) / kNumCurvePoints;
770 float x = t * end_x + (1.0f - t) * start_x;
771 float y_t = sinf((t - 0.5f) *
vital::kPi) * 0.5f + 0.5f;
772 float y = y_t * end_y + (1.0f - y_t) * start_y;
777 PathStrokeType line_stroke(kLineWidth, PathStrokeType::curved, PathStrokeType::butt);
778 PathStrokeType endpoint_stroke(kEndpointStrokeWidth, PathStrokeType::curved, PathStrokeType::butt);
779 line_stroke.createStrokedPath(path, curve);
782 arc.addCentredArc(end_x + kBumpIn, end_y, kEndpointRadius, kEndpointRadius, 0.0f, 0.0f, kFullRadians,
true);
783 arc.addCentredArc(start_x - kBumpIn, start_y, kEndpointRadius, kEndpointRadius, 0.0f, 0.0f, kFullRadians,
true);
785 endpoint_stroke.createStrokedPath(end_points, arc);
786 path.addPath(end_points);
788 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
789 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
795 path.addEllipse(0.1f, 0.4f, 0.2f, 0.2f);
796 path.addEllipse(0.4f, 0.4f, 0.2f, 0.2f);
797 path.addEllipse(0.7f, 0.4f, 0.2f, 0.2f);
799 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
800 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
805 static constexpr float kBrushWideDimension = 0.3f;
806 static constexpr float kBrushHandleDimension = 0.08f;
807 static constexpr float kBrushLength = 0.6f * kBrushWideDimension;
808 static constexpr float kSeparatorWidth = 0.15f * kBrushWideDimension;
809 static constexpr float kConnectionDistance = kBrushLength + kSeparatorWidth;
810 static constexpr float kHandleDistance = kConnectionDistance + kBrushWideDimension * 0.8f;
811 static constexpr float kBorder = 0.15f;
814 path.startNewSubPath(kBorder, 1.0f - kBorder);
815 path.lineTo(kBorder + kBrushHandleDimension, 1.0f - kBorder);
816 path.lineTo(1.0f - kBorder - kHandleDistance, kBorder + kBrushHandleDimension + kHandleDistance);
817 path.lineTo(1.0f - kBorder - kConnectionDistance, kBorder + kBrushWideDimension + kConnectionDistance);
818 path.lineTo(1.0f - kBorder - kConnectionDistance - kBrushWideDimension, kBorder + kConnectionDistance);
819 path.lineTo(1.0f - kBorder - kHandleDistance - kBrushHandleDimension, kBorder + kHandleDistance);
820 path.lineTo(kBorder, 1.0f - kBorder - kBrushHandleDimension);
823 path.startNewSubPath(1.0f - kBorder - kBrushWideDimension, kBorder);
824 path.lineTo(1.0f - kBorder, kBorder + kBrushWideDimension);
825 path.lineTo(1.0f - kBorder - kBrushLength, kBorder + kBrushWideDimension + kBrushLength);
826 path.lineTo(1.0f - kBorder - kBrushLength - kBrushWideDimension, kBorder + kBrushLength);
829 path.addLineSegment(Line<float>(0.0f, 0.0f, 0.0f, 0.0f), 0.2f);
830 path.addLineSegment(Line<float>(1.0f, 1.0f, 1.0f, 1.0f), 0.2f);
835 PathStrokeType stroke(line_thickness, PathStrokeType::curved, PathStrokeType::rounded);
838 stroke.createStrokedPath(path, outline);
842 static Path
lowPass(
float line_thickness = 0.1f) {
844 outline.startNewSubPath(1.0f, 0.8f);
845 outline.lineTo(0.7f, 0.3f);
846 outline.lineTo(0.5f, 0.5f);
847 outline.lineTo(0.0f, 0.5f);
849 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.2f);
855 outline.startNewSubPath(0.0f, 0.8f);
856 outline.lineTo(0.3f, 0.3f);
857 outline.lineTo(0.5f, 0.5f);
858 outline.lineTo(1.0f, 0.5f);
860 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.2f);
865 static constexpr float kMiddle = 3.0f / 5.0f;
866 static constexpr float kBottom = 4.0f / 5.0f;
869 outline.startNewSubPath(0.0f, kBottom);
870 outline.lineTo(1.0f / 3.0f, kMiddle);
871 outline.lineTo(0.5f, 0.25f);
872 outline.lineTo(2.0f / 3.0f, kMiddle);
873 outline.lineTo(1.0f, kBottom);
876 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.2f);
881 static constexpr float kArrowAmount = 1.0f / 3.0f;
882 static constexpr float kBuffer = 0.0f;
885 outline.startNewSubPath(1.0f - kBuffer, 0.5f);
886 outline.lineTo(kBuffer, 0.5f);
887 outline.startNewSubPath(kBuffer, 0.5f);
888 outline.lineTo(kBuffer + kArrowAmount, 0.5f - kArrowAmount);
889 outline.startNewSubPath(kBuffer, 0.5f);
890 outline.lineTo(kBuffer + kArrowAmount, 0.5f + kArrowAmount);
895 static constexpr float kArrowAmount = 1.0f / 3.0f;
896 static constexpr float kBuffer = 0.0f;
899 outline.startNewSubPath(1.0f - kBuffer, 0.5f);
900 outline.lineTo(kBuffer, 0.5f);
901 outline.startNewSubPath(1.0f - kBuffer, 0.5f);
902 outline.lineTo(1.0f - kArrowAmount - kBuffer, 0.5f - kArrowAmount);
903 outline.startNewSubPath(1.0f - kBuffer, 0.5f);
904 outline.lineTo(1.0f - kArrowAmount - kBuffer, 0.5f + kArrowAmount);
910 outline.startNewSubPath(0.0f, 0.5f);
911 outline.lineTo(1.0f / 3.0f, 3.0f / 4.0f);
912 outline.lineTo(1.0f / 2.0f, 1.0f / 4.0f);
913 outline.lineTo(2.0f / 3.0f, 3.0f / 4.0f);
914 outline.lineTo(1.0f, 0.5f);
917 path.addLineSegment(Line<float>(1.0f, 0.15f, 1.0f, 0.15f), 0.1f);
918 path.addLineSegment(Line<float>(1.0f, 0.85f, 1.0f, 0.85f), 0.1f);
923 static constexpr int kNumHumps = 5;
925 static const float kUp = 1.0f / 4.0f;
926 static const float kDown = 3.0f / 4.0f;
928 float delta = 1.0f / (2 * kNumHumps + 2);
930 outline.startNewSubPath(0.0f, 0.5f);
932 float position = 0.0f;
933 for (
int i = 0; i < kNumHumps; ++i) {
935 outline.lineTo(position, kDown);
937 outline.lineTo(position, kUp);
940 outline.lineTo(position, kDown);
941 outline.lineTo(1.0f, 0.5f);
944 path.addLineSegment(Line<float>(1.0f, 0.15f, 1.0f, 0.15f), 0.1f);
945 path.addLineSegment(Line<float>(1.0f, 0.85f, 1.0f, 0.85f), 0.1f);
950 static constexpr float kTop = 2.0f / 5.0f;
951 static constexpr float kBottom = 4.0f / 5.0f;
954 outline.startNewSubPath(0.0f, kTop);
955 outline.lineTo(1.0f / 3.0f, kTop);
956 outline.lineTo(1.0f / 2.0f, kBottom);
957 outline.lineTo(2.0f / 3.0f, kTop);
958 outline.lineTo(1.0f, kTop);
961 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.1f);
966 static constexpr float kTop = 2.0f / 5.0f;
967 static constexpr float kBottom = 4.0f / 5.0f;
970 outline.startNewSubPath(0.0f, kBottom);
971 outline.lineTo(1.0f / 3.0f, kBottom);
972 outline.lineTo(0.5f, kTop);
973 outline.lineTo(2.0f / 3.0f, kBottom);
974 outline.lineTo(1.0f, kBottom);
977 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.1f);
982 static constexpr float kTop = 2.0f / 5.0f;
983 static constexpr float kBottom = 4.0f / 5.0f;
986 outline.startNewSubPath(0.0f, kBottom);
987 outline.lineTo(1.0f / 3.0f, kTop);
988 outline.lineTo(2.0f / 3.0f, kTop);
989 outline.lineTo(1.0f, kBottom);
992 path.addLineSegment(Line<float>(1.0f, 0.2f, 1.0f, 0.2f), 0.1f);
A utility class providing static functions to generate various SVG-based or programmatic paths.
Definition paths.h:14
static Path delay()
Creates a delay effect icon path from embedded SVG data.
Definition paths.h:93
static Path pencil()
Definition paths.h:725
static Path fromSvgData(const void *data, size_t data_size)
Creates a JUCE Path from embedded SVG data.
Definition paths.h:30
static Path phaser()
Creates a phaser effect icon path.
Definition paths.h:141
static Path equalizer()
Creates an equalizer icon path.
Definition paths.h:109
static Path downTriangle()
Definition paths.h:390
static Path ellipses()
Definition paths.h:793
static Path chorus()
Creates a chorus icon path from embedded SVG data.
Definition paths.h:77
static Path vitalWordRing()
Creates the Vital wordmark with ring path.
Definition paths.h:69
static Path save()
Definition paths.h:607
static Path note()
Creates a musical note icon path.
Definition paths.h:219
static Path dragDropArrows()
Creates a drag-and-drop arrows icon path.
Definition paths.h:211
static Path compressor()
Creates a compressor icon path from embedded SVG data.
Definition paths.h:85
static Path star()
Definition paths.h:446
static Path bounce()
Definition paths.h:647
static Path halfSinCurve()
Definition paths.h:751
static Path tripletNotes()
Creates a triplet notes icon path.
Definition paths.h:242
static Path highPass()
Definition paths.h:853
static Path plus(int width)
Definition paths.h:305
static Path fullKeyboard()
Definition paths.h:498
static Path menu()
Creates a menu icon path (three horizontal lines).
Definition paths.h:271
static Path bipolar()
Definition paths.h:668
static Path magnifyingGlass()
Definition paths.h:588
static Path leftArrow()
Definition paths.h:880
static constexpr int kLogoWidth
Width reference used for scaling Vital's logo paths.
Definition paths.h:17
static Path paintBrush()
Definition paths.h:804
static Path shuffle()
Definition paths.h:690
static Path notch()
Definition paths.h:949
static Path reverb()
Creates a reverb effect icon path.
Definition paths.h:149
static Path plusOutline()
Definition paths.h:322
static Path distortion()
Creates a distortion effect icon path.
Definition paths.h:101
Paths()=delete
Deleted constructor to prevent instantiation.
static Path menu(int width)
Overloaded menu path with custom width.
Definition paths.h:286
static Path vitalWord()
Creates the Vital wordmark path.
Definition paths.h:61
static Path next()
Creates a 'next' arrow icon path.
Definition paths.h:176
static Path clock()
Creates a clock icon path.
Definition paths.h:195
static Path vitalV()
Creates the Vital 'V' logo path.
Definition paths.h:50
static Path flanger()
Creates a flanger effect icon path.
Definition paths.h:125
static Path gear()
Definition paths.h:565
static Path rightArrow()
Definition paths.h:894
static Path createFilterStroke(const Path &outline, float line_thickness=0.1f)
Definition paths.h:834
static Path narrowBand()
Definition paths.h:965
static Path folder()
Creates a folder icon path.
Definition paths.h:133
static Path phaser1()
Definition paths.h:908
static Path loop()
Definition paths.h:630
static Path keyboardBordered()
Definition paths.h:490
static Path phaser3()
Definition paths.h:922
static Path bandPass()
Definition paths.h:864
static Path keyboard()
Definition paths.h:454
static Path exitX()
Definition paths.h:416
static Path upTriangle()
Definition paths.h:403
static Path lowPass(float line_thickness=0.1f)
Definition paths.h:842
static Path wideBand()
Definition paths.h:981
static Path prev()
Creates a 'previous' arrow icon path.
Definition paths.h:157
static Path effectsFilter()
Creates an effects filter icon path.
Definition paths.h:117
static Path vitalRing()
Creates the Vital ring logo path.
Definition paths.h:39
static Path thickX()
Definition paths.h:431
static Path save(int width)
Definition paths.h:352
constexpr mono_float kPi
Pi constant.
Definition common.h:36