Move towards pixel upscaling filter

This commit is contained in:
2025-11-25 11:04:06 +00:00
parent f5a972d9e2
commit c0cfadbdd3
13 changed files with 107 additions and 49 deletions
+2 -2
View File
@@ -455,7 +455,7 @@ pokeFlatV ::
{-# INLINE pokeFlatV #-}
pokeFlatV xdata pnorm col ptr nv sh = do
pokeByteOff ptr (nv * shapeVerxSize) (V4 x y z xdata)
pokeByteOff ptr (nv *shapeVerxSize + 4 * floatSize) (normalTo8 $ V4 nx ny nz 1)
pokeByteOff ptr (nv *shapeVerxSize + 4 * floatSize) (normalTo8 $ V4 nx ny nz (-1))
pokeByteOff ptr (nv *shapeVerxSize + 5 * floatSize) (toColor8 col)
return (nv + 1)
where
@@ -463,7 +463,7 @@ pokeFlatV xdata pnorm col ptr nv sh = do
V3 nx ny nz = (sh - pnorm) - V3 x y z
normalTo8 :: Point4 -> V4 Int8
normalTo8 = over each f . normalize
normalTo8 = over each f . over _xyz normalize
where
f x = floor $ x * 127