Skip to content

Commit

Permalink
[Format]
Browse files Browse the repository at this point in the history
elm-format applied on branch auto-res
  • Loading branch information
floffy-f committed Jun 15, 2021
1 parent 5de0cbb commit cf1ac80
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions web-elm/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,14 @@ update msg model =
oldParamsForm =
model.paramsForm

oldParams = model.params
oldParams =
model.params

optiLevels = getOptimumPyramids newLoaded
optiLevels =
getOptimumPyramids newLoaded

anyInt = NumberInput.intDefault
anyInt =
NumberInput.intDefault
in
if Set.size names == Dict.size newLoaded then
case Dict.values newLoaded of
Expand All @@ -514,14 +517,16 @@ update msg model =
| state = ViewImgs { images = Pivot.fromCons firstImage otherImages }
, viewer = Viewer.fitImage 1.0 ( toFloat firstImage.width, toFloat firstImage.height ) model.viewer
, params = { oldParams | levels = optiLevels }
, paramsForm = { oldParamsForm
| crop = CropForm.withSize firstImage.width firstImage.height
, levels =
{ anyInt
| min = Just 1
, max = Just 10
} |> NumberInput.setDefaultIntValue optiLevels
}
, paramsForm =
{ oldParamsForm
| crop = CropForm.withSize firstImage.width firstImage.height
, levels =
{ anyInt
| min = Just 1
, max = Just 10
}
|> NumberInput.setDefaultIntValue optiLevels
}
, imagesCount = Set.size names
}
, Cmd.none
Expand Down Expand Up @@ -952,7 +957,6 @@ minWidthHeight imgs =
trueMinimum



scrollLogsToEndCmd : Cmd Msg
scrollLogsToEndCmd =
Task.attempt (\_ -> NoMsg) (Browser.Dom.setViewportOf "logs" 0 1.0e14)
Expand Down Expand Up @@ -1970,6 +1974,7 @@ viewConfig ({ params, paramsForm, paramsInfo } as model) =
}
]
, moreInfo paramsInfo.levels "The number of levels for the multi-resolution approach. Each level halves/doubles the resolution of the previous one. The algorithm starts at the lowest resolution and transfers the converged parameters at one resolution to the initialization of the next. Increasing the number of levels enables better convergence for bigger movements but too many levels might make it definitively drift away. Targetting a lowest resolution of about 100x100 is generally good enough. The number of levels also has a joint interaction with the sparse threshold parameter so keep that in mind while changing this parameter."

-- , Element.text ("(default to " ++ String.fromInt defaultParams.levels ++ ")")
-- /!\ Default number of pyramids removed in order to put a fitting number of pyramids
, intInput paramsForm.levels (ParamsMsg << ChangeLevels) "Number of pyramid levels"
Expand Down

0 comments on commit cf1ac80

Please sign in to comment.