Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
61315 committed Feb 18, 2022
1 parent 6035fa3 commit 4e205f4
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,64 @@ $ make test
to test the sample images.

FYI, the test results should look like this:
![preview](./preview.png)
![preview](./docs/preview.png)

## Building examples

### hello

Minimal build test. Should write `hello` to the stdout.

```
$ make examples/hello
$ examples/hello
```

### ppm

![example-ppm](./docs/example-ppm.png)

Takes in source/mask bitmap and do the image synthesis operation. The dimensions of the source and mask image should match.

```
$ make examples/ppm
$ examples/ppm <source> <mask> <result> <context> <neighbors> <probes>
```

E.g.
```
$ examples/ppm assets/source000.ppm assets/mask000.ppm result000.ppm 1 16 64
```

NOTE: There is a meaningful correlation between **the quality of opration** and the type of fitting method(**context**) described below. The quality of synthesis operation may vary.

| context | method | shape | direction |
|---------|-------------|------------|-----------|
| 0 | Patching | - | - |
| 1 | Shuffle | Random | Random |
| 2 | Brushfire | Concentric | Inward |
| 3 | Directional | Horizontal | Inward |
| 4 | Directional | Vertical | Inward |
| 5 | Brushfire | Concentric | Outward |
| 6 | Directional | Horizontal | Outward |
| 7 | Directional | Vertical | Outward |
| 8 | Squeeze | Concentric | Both |

### painter

![example-painter](./docs/example-painter.gif)

Interactive painting demo. Performs synthesis operation on-the-fly.

This example requires [SDL2](https://wiki.libsdl.org/Installation) installed on the build machine, otherwise build will not succeed.

`Makefile` tries to locate the SDL2 using `pkg-config` command. If facing errors, be sure to check if SDL2 is installed properly.

```
$ make examples/painter
$ examples/painter <source>
```
E.g.
```
$ examples/painter assets/source001.ppm
```
Binary file added docs/example-painter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/example-ppm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 4e205f4

Please sign in to comment.