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);
26 std::default_random_engine rng;
28 return std::uniform_real_distribution<SkScalar>(
min,
max)(rng);
30 const auto randOpaqueColor = [&rng]() ->
SkColor {
31 return std::uniform_int_distribution<uint32_t>(0, 0xFFFFFF)(rng) | 0xFF000000;
34 for (
int i = 0;
i < 400; ++
i) {
35 paintOctopus(randScalar(0, 256), randScalar(0, 256),
36 randScalar(6, 12), randOpaqueColor(), canvas);
REG_FIDDLE(Octopus_Generator, 256, 256, false, 0)
#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)