Allow independent distortion of rgb channels

This commit is contained in:
2025-11-19 10:38:30 +00:00
parent 8759431fec
commit 610936a5fa
6 changed files with 72 additions and 31 deletions
+5 -4
View File
@@ -1,10 +1,11 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Distortion (updateDistortion) where
import Dodge.Data.Distortion
import Control.Lens
updateDistortion :: Distortion -> Maybe Distortion
updateDistortion = \case
RadialDistortion a b c d e f t
| t > 0 -> Just $ RadialDistortion a b c d e f $ t-1
| otherwise -> Nothing
updateDistortion rd
| rd ^. rdTime > 0 = Just $ rd & rdTime .~ 1
| otherwise = Nothing