Show parameters for thumbnail as table.
This commit is contained in:
parent
67ba66bdf7
commit
fa7d79b112
@ -84,6 +84,22 @@ impl NoiseType {
|
|||||||
),
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn parameters(&self) -> Vec<(&str, String)> {
|
||||||
|
match &self {
|
||||||
|
NoiseType::Scale(scale) => vec![("Scale", scale.to_string())],
|
||||||
|
NoiseType::Turbulence(turbulence) => vec![("Turbulence", turbulence.to_string())],
|
||||||
|
NoiseType::Marble {
|
||||||
|
period,
|
||||||
|
power,
|
||||||
|
size,
|
||||||
|
} => vec![
|
||||||
|
("Period", period.to_string()),
|
||||||
|
("Power", power.to_string()),
|
||||||
|
("Size", size.to_string()),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
@ -289,12 +305,17 @@ fn build_specimens(width: u32, height: u32) -> Vec<Specimen> {
|
|||||||
}
|
}
|
||||||
specimens.push(specimen);
|
specimens.push(specimen);
|
||||||
|
|
||||||
let mut specimen = Specimen {
|
let max_size = 8;
|
||||||
title: "Varying Marble".into(),
|
for power in 1..12 {
|
||||||
params: Vec::new(),
|
let mut specimen = Specimen {
|
||||||
};
|
title: format!(
|
||||||
for power in 1..10 {
|
"Marble power {}, varying size 2-{}",
|
||||||
for size in 1..6 {
|
power,
|
||||||
|
1 << (max_size - 1)
|
||||||
|
),
|
||||||
|
params: Vec::new(),
|
||||||
|
};
|
||||||
|
for size in 1..max_size {
|
||||||
let params = NoiseParams {
|
let params = NoiseParams {
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
@ -306,7 +327,13 @@ fn build_specimens(width: u32, height: u32) -> Vec<Specimen> {
|
|||||||
};
|
};
|
||||||
specimen.params.push(params);
|
specimen.params.push(params);
|
||||||
}
|
}
|
||||||
|
specimens.push(specimen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut specimen = Specimen {
|
||||||
|
title: "Marble varying power, size = 32".into(),
|
||||||
|
params: Vec::new(),
|
||||||
|
};
|
||||||
for power in 1..10 {
|
for power in 1..10 {
|
||||||
let params = NoiseParams {
|
let params = NoiseParams {
|
||||||
width,
|
width,
|
||||||
|
|||||||
@ -14,7 +14,13 @@
|
|||||||
<a href="{{ np.big_url()|safe }}">
|
<a href="{{ np.big_url()|safe }}">
|
||||||
<img width="{{ np.width }}" height="{{ np.height }}" src="{{ np.url()|safe }}"/>
|
<img width="{{ np.width }}" height="{{ np.height }}" src="{{ np.url()|safe }}"/>
|
||||||
</a>
|
</a>
|
||||||
<figcaption>{{ np.compact_string() }}</figcaption>
|
<figcaption>
|
||||||
|
<table>
|
||||||
|
{% for p in np.noise.parameters() %}
|
||||||
|
<tr><th>{{ p.0 }}</th><td>{{ p.1 }}</td></tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -5,6 +5,11 @@ figure p {
|
|||||||
figure {
|
figure {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0.25em;
|
margin: 0.25em;
|
||||||
text-align: center;
|
|
||||||
font-size: smaller;
|
font-size: smaller;
|
||||||
|
text-align: left;
|
||||||
|
line-height: .75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
figure table tr th {
|
||||||
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user