#include "tools/fiddle/examples.h"
#include <climits>
#include <random>
Go to the source code of this file.
|
| REG_FIDDLE (Bitmap_installPixels_2, 256, 256, false, 0) |
|
◆ REG_FIDDLE()
REG_FIDDLE |
( |
Bitmap_installPixels_2 |
, |
|
|
256 |
, |
|
|
256 |
, |
|
|
false |
, |
|
|
0 |
|
|
) |
| |
Definition at line 8 of file Bitmap_installPixels_2.cpp.
8 {
10 std::default_random_engine rng;
11 const auto randUint = [&rng](uint32_t
min, uint32_t
max) -> uint32_t {
12 return std::uniform_int_distribution<uint32_t>(
min,
max)(rng);
13 };
19 pixels[
x] = randUint(0, UINT_MAX);
20 }
23 canvas->
scale(32, 32);
25 }
26}
27}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)