Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tool: write a texture.zoom file

Just dump out one texture to a zoom-cache file
  • Loading branch information...
commit b62a6609aa6e2aa2bfd6f6c288d3aad521e38177 1 parent 35aedda
@kfish authored
Showing with 12 additions and 1 deletion.
  1. +1 −0  Graphics/TextureSynthesis.hs
  2. +11 −1 tools/texture-synthesis.hs
View
1  Graphics/TextureSynthesis.hs
@@ -9,6 +9,7 @@ module Graphics.TextureSynthesis (
, genTextureDefault
, mkTexture
, flattenTexture
+ , slices
) where
import Control.Monad.Primitive (PrimMonad, PrimState)
View
12 tools/texture-synthesis.hs
@@ -1,10 +1,20 @@
+{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS -Wall #-}
module Main where
+import Control.Applicative ((<$>))
+import Data.ZoomCache
+import Data.ZoomCache.Texture
import Graphics.TextureSynthesis
main :: IO ()
main = do
- ts <- genTexture 8
+ ss <- slices <$> flattenTexture 3 <$> genTexture 2
+
+ let ts = map TextureSlice ss
+ track = oneTrack (undefined :: TextureSlice) False False ConstantDR 1000 "texture"
+
+ withFileWrite track True (mapM_ (write 1) ts) "texture.zoom"
+
print ts
Please sign in to comment.
Something went wrong with that request. Please try again.