up
This commit is contained in:
@@ -255,7 +255,7 @@ func (HeuristicEngine) Propose(photos []PhotoAnalysis, profile ProfileInfo) ([]T
|
||||
cool: sorted[0].Warmth < 0.02,
|
||||
}
|
||||
if len(sorted) > 1 {
|
||||
plan.inserts = sorted[1:min(len(sorted), 3)] // hero + up to 2 inserts
|
||||
plan.inserts = sorted[1:min(len(sorted), 5)] // hero + up to 4 inserts
|
||||
}
|
||||
|
||||
// Only side-column inserts (or none): a bottom strip collides with the QSO
|
||||
@@ -671,9 +671,19 @@ func placeInserts(inserts []PhotoAnalysis, hero PhotoAnalysis, archetype string)
|
||||
return els, pxRect{x: margin, y: cardH - 380, w: cardW - 2*margin, h: 380 - margin}
|
||||
}
|
||||
|
||||
// Side column: pick the calmer half of the hero photo.
|
||||
n := min(len(inserts), 3)
|
||||
w, gap, margin := 400.0, 20.0, 70.0
|
||||
// Side column: pick the calmer half of the hero photo. The insert width
|
||||
// shrinks as needed so up to 4 framed photos stack down the side.
|
||||
n := min(len(inserts), 4)
|
||||
gap, margin := 20.0, 70.0
|
||||
availH := float64(cardH) - 2*margin - float64(n-1)*gap
|
||||
var arSum float64
|
||||
for i := 0; i < n; i++ {
|
||||
arSum += float64(inserts[i].H) / float64(inserts[i].W)
|
||||
}
|
||||
w := 400.0
|
||||
if arSum > 0 {
|
||||
w = clamp(availH/arSum, 240, 400) // fit all n vertically, within sane bounds
|
||||
}
|
||||
left := halfDetail(hero, true) < halfDetail(hero, false)
|
||||
x := cardW - w - margin
|
||||
if left {
|
||||
|
||||
@@ -106,6 +106,8 @@ type FxParams struct {
|
||||
Grunge *float64 `json:"grunge,omitempty"`
|
||||
Bevel *float64 `json:"bevel,omitempty"`
|
||||
Seed *float64 `json:"seed,omitempty"`
|
||||
Dark string `json:"dark,omitempty"` // dark inter-letter edge (per colour palette)
|
||||
Outer string `json:"outer,omitempty"` // silver/rim colour (glossy)
|
||||
}
|
||||
|
||||
// setKeys lists the JSON names of the params that are actually set, for
|
||||
|
||||
Reference in New Issue
Block a user