5 {
6#include <random>
7
10 paint.setAntiAlias(
true);
12 int radius = 3 * size_base;
14 for (int leg = 0; leg < 8; ++leg) {
15 canvas->
drawCircle(
x - radius + (2 * radius / 7.5 * leg),
16 y + radius - pow(
abs(4 - leg), 2), size_base / 2 + 2,
paint);
17 }
23}
24
26 std::default_random_engine rng;
28 return std::uniform_real_distribution<SkScalar>(
min,
max)(rng);
29 };
30 const auto randOpaqueColor = [&rng]() ->
SkColor {
31 return std::uniform_int_distribution<uint32_t>(0, 0xFFFFFF)(rng) | 0xFF000000;
32 };
33
34 for (
int i = 0;
i < 400; ++
i) {
35 paintOctopus(randScalar(0, 256), randScalar(0, 256),
36 randScalar(6, 12), randOpaqueColor(), canvas);
37 }
38}
39}
#define SkColorGetR(color)
#define SkColorGetG(color)
#define SkColorSetRGB(r, g, b)
#define SkColorGetB(color)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
SIN Vec< N, float > abs(const Vec< N, float > &x)