5 {
6#include <random>
7
10 paint.setAntiAlias(
true);
12 int radius = 3*size_base;
14 for (int leg = 0; leg < 8; ++leg) {
16 y + radius - pow(
abs(4-leg), 2), size_base/2 + 2,
paint);
17 }
23}
24
26 std::default_random_engine rng;
27 const auto randScalar = [&rng](
float min,
float max) ->
float {
28 return std::uniform_real_distribution<float>(
min,
max)(rng);
29 };
30 const auto randInt = [&rng](
int min,
int max) ->
int {
31 return std::uniform_int_distribution<int>(
min,
max)(rng);
32 };
33 const auto randOpaqueColor = [&rng]() ->
SkColor {
34 return std::uniform_int_distribution<uint32_t>(0, 0xFFFFFF)(rng) | 0xFF000000;
35 };
36
37 for (
int i = 0;
i < 400; ++
i) {
38 float x = randScalar(0, 256);
39 float y = randScalar(0, 256);
40 int s = randInt(6, 12);
42 float radius = randScalar(0, 40);
43 float angle = (randScalar(0, 1) +
frame) * 6.28319;
44 x += radius * cos(angle);
45 y += radius * sin(angle);
46 paintOctopus(
x,
y,
s, c, canvas);
47 }
48}
49}
#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)