remove polish parameter

additional layers of polish yield too negligible of an effect to bother with.
tweaking the magic parameter is preferred.
This commit is contained in:
Connor Olding 2016-10-31 15:21:22 -07:00
parent 79afa91dd8
commit e5ee52ccff
2 changed files with 19 additions and 32 deletions

View File

@ -42,9 +42,6 @@ usage:
-M --tries
random points added to candidates
range: [0,65536]; default: 192
-p --polish
extra iterations
range: [0,9]; default: 0
-m --magic
magic constant, affects iterations
range: [0,255]; default: 192
@ -59,8 +56,7 @@ usage:
required default: [none]
```
the `radius` and `polish` parameters should probably be
properly described or removed.
the `radius` parameter should probably be removed.
### neighborhood

View File

@ -132,7 +132,7 @@ typedef struct {
bool h_tile, v_tile;
double autism;
int neighbors, tries;
int polish, magic;
int magic;
} Parameters;
INLINE bool wrap_or_clip(const Parameters parameters, const Image image,
@ -298,9 +298,8 @@ static void run(Resynth_state *s, Parameters parameters) {
const int data_area = sb_count(s->data_points);
for (int p = 0; p < parameters.polish + 1; p++) {
// shuffle data points in-place
for (int i = 0; i < data_area; i++) {
// shuffle in-place
// (we could use a better random function here)
int j = rand() % data_area;
Coord temp = s->data_points[i];
@ -319,7 +318,6 @@ static void run(Resynth_state *s, Parameters parameters) {
sb_push(s->data_points, s->data_points[i]);
}
}
}
// prepare an array of neighbors we've already computed the difference of.
// this is a simple optimization and isn't critical to the algorithm.
@ -443,7 +441,6 @@ int main(int argc, char *argv[]) {
parameters.autism = 32. / 256.; // 30. / 256.
parameters.neighbors = 29; // 30
parameters.tries = 192; // 200 (or 80 in the paper)
parameters.polish = 0; // 0
int scale = 1;
unsigned long seed = 0;
@ -483,11 +480,6 @@ int main(int argc, char *argv[]) {
" range: [0,65536]; default: 192")
parameters.tries = kyaa_flag_arg;
KYAA_FLAG_LONG('p', "polish",
" extra iterations\n"
" range: [0,9]; default: 0")
parameters.polish = kyaa_flag_arg;
KYAA_FLAG_LONG('m', "magic",
" magic constant, affects iterations\n"
" range: [0,255]; default: 192")
@ -514,7 +506,6 @@ int main(int argc, char *argv[]) {
exit(1);
}
CLAMPV(parameters.polish, 0, 9);
CLAMPV(parameters.magic, 0, 255);
CLAMPV(parameters.autism, 0., 1.);
CLAMPV(parameters.neighbors, 0, disc00[LEN(disc00) - 1]);