]> gitweb.factorcode.org Git - factor.git/commitdiff
images.tessel(l)ation: spelling
authorJoe Groff <arcata@gmail.com>
Sun, 28 Aug 2011 00:29:10 +0000 (17:29 -0700)
committerJoe Groff <arcata@gmail.com>
Sun, 28 Aug 2011 00:30:45 +0000 (17:30 -0700)
basis/images/tesselation/authors.txt [deleted file]
basis/images/tesselation/tesselation-tests.factor [deleted file]
basis/images/tesselation/tesselation.factor [deleted file]
basis/images/tessellation/authors.txt [new file with mode: 0644]
basis/images/tessellation/tessellation-tests.factor [new file with mode: 0644]
basis/images/tessellation/tessellation.factor [new file with mode: 0644]
basis/opengl/textures/textures.factor

diff --git a/basis/images/tesselation/authors.txt b/basis/images/tesselation/authors.txt
deleted file mode 100644 (file)
index d4f5d6b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Slava Pestov
\ No newline at end of file
diff --git a/basis/images/tesselation/tesselation-tests.factor b/basis/images/tesselation/tesselation-tests.factor
deleted file mode 100644 (file)
index 5999c15..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-USING: images accessors kernel tools.test literals math.ranges
-byte-arrays ;
-IN: images.tesselation
-
-! Check an invariant we depend on
-[ t ] [
-    <image> B{ 1 2 3 } >>bitmap dup clone [ bitmap>> ] bi@ eq?
-] unit-test
-
-[
-    {
-        {
-            T{ image f { 2 2 } L ubyte-components f f B{ 1 2 5 6 } }
-            T{ image f { 2 2 } L ubyte-components f f B{ 3 4 7 8 } }
-        }
-        {
-            T{ image f { 2 2 } L ubyte-components f f B{ 9 10 13 14 } }
-            T{ image f { 2 2 } L ubyte-components f f B{ 11 12 15 16 } }
-        }
-    }
-] [
-    <image>
-        1 16 [a,b] >byte-array >>bitmap
-        { 4 4 } >>dim
-        L >>component-order
-        ubyte-components >>component-type
-    { 2 2 } tesselate
-] unit-test
-
-[
-    {
-        {
-            T{ image f { 2 2 } L ubyte-components f f B{ 1 2 4 5 } }
-            T{ image f { 1 2 } L ubyte-components f f B{ 3 6 } }
-        }
-        {
-            T{ image f { 2 1 } L ubyte-components f f B{ 7 8 } }
-            T{ image f { 1 1 } L ubyte-components f f B{ 9 } }
-        }
-    }
-] [
-    <image>
-        1 9 [a,b] >byte-array >>bitmap
-        { 3 3 } >>dim
-        L >>component-order
-        ubyte-components >>component-type
-    { 2 2 } tesselate
-] unit-test
diff --git a/basis/images/tesselation/tesselation.factor b/basis/images/tesselation/tesselation.factor
deleted file mode 100644 (file)
index d01bad6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-! Copyright (C) 2009 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: sequences kernel math grouping fry columns locals accessors
-images math.vectors arrays ;
-IN: images.tesselation
-
-: group-rows ( bitmap bitmap-dim -- rows )
-    first <sliced-groups> ; inline
-
-: tesselate-rows ( bitmap-rows tess-dim -- bitmaps )
-    second <sliced-groups> ; inline
-
-: tesselate-columns ( bitmap-rows tess-dim -- bitmaps )
-    first '[ _ <sliced-groups> ] map flip ; inline
-
-: tesselate-bitmap ( bitmap bitmap-dim tess-dim -- bitmap-grid )
-    [ group-rows ] dip
-    [ tesselate-rows ] keep
-    '[ _ tesselate-columns ] map ;
-
-: tile-width ( tile-bitmap original-image -- width )
-    [ first length ] [ bytes-per-pixel ] bi* /i ;
-
-: <tile-image> ( tile-bitmap original-image -- tile-image )
-    clone
-        swap
-        [ concat >>bitmap ]
-        [ [ over tile-width ] [ length ] bi 2array >>dim ] bi ;
-
-:: tesselate ( image tess-dim -- image-grid )
-    image bytes-per-pixel :> bpp
-    image dim>> { bpp 1 } v* :> image-dim'
-    tess-dim { bpp 1 } v* :> tess-dim'
-    image bitmap>> image-dim' tess-dim' tesselate-bitmap
-    [ [ image <tile-image> ] map ] map ;
diff --git a/basis/images/tessellation/authors.txt b/basis/images/tessellation/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/images/tessellation/tessellation-tests.factor b/basis/images/tessellation/tessellation-tests.factor
new file mode 100644 (file)
index 0000000..bfde13f
--- /dev/null
@@ -0,0 +1,48 @@
+USING: images accessors kernel tools.test literals math.ranges
+byte-arrays ;
+IN: images.tessellation
+
+! Check an invariant we depend on
+[ t ] [
+    <image> B{ 1 2 3 } >>bitmap dup clone [ bitmap>> ] bi@ eq?
+] unit-test
+
+[
+    {
+        {
+            T{ image f { 2 2 } L ubyte-components f f B{ 1 2 5 6 } }
+            T{ image f { 2 2 } L ubyte-components f f B{ 3 4 7 8 } }
+        }
+        {
+            T{ image f { 2 2 } L ubyte-components f f B{ 9 10 13 14 } }
+            T{ image f { 2 2 } L ubyte-components f f B{ 11 12 15 16 } }
+        }
+    }
+] [
+    <image>
+        1 16 [a,b] >byte-array >>bitmap
+        { 4 4 } >>dim
+        L >>component-order
+        ubyte-components >>component-type
+    { 2 2 } tesselate
+] unit-test
+
+[
+    {
+        {
+            T{ image f { 2 2 } L ubyte-components f f B{ 1 2 4 5 } }
+            T{ image f { 1 2 } L ubyte-components f f B{ 3 6 } }
+        }
+        {
+            T{ image f { 2 1 } L ubyte-components f f B{ 7 8 } }
+            T{ image f { 1 1 } L ubyte-components f f B{ 9 } }
+        }
+    }
+] [
+    <image>
+        1 9 [a,b] >byte-array >>bitmap
+        { 3 3 } >>dim
+        L >>component-order
+        ubyte-components >>component-type
+    { 2 2 } tesselate
+] unit-test
diff --git a/basis/images/tessellation/tessellation.factor b/basis/images/tessellation/tessellation.factor
new file mode 100644 (file)
index 0000000..a37c67b
--- /dev/null
@@ -0,0 +1,35 @@
+! Copyright (C) 2009 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: sequences kernel math grouping fry columns locals accessors
+images math.vectors arrays ;
+IN: images.tessellation
+
+: group-rows ( bitmap bitmap-dim -- rows )
+    first <sliced-groups> ; inline
+
+: tesselate-rows ( bitmap-rows tess-dim -- bitmaps )
+    second <sliced-groups> ; inline
+
+: tesselate-columns ( bitmap-rows tess-dim -- bitmaps )
+    first '[ _ <sliced-groups> ] map flip ; inline
+
+: tesselate-bitmap ( bitmap bitmap-dim tess-dim -- bitmap-grid )
+    [ group-rows ] dip
+    [ tesselate-rows ] keep
+    '[ _ tesselate-columns ] map ;
+
+: tile-width ( tile-bitmap original-image -- width )
+    [ first length ] [ bytes-per-pixel ] bi* /i ;
+
+: <tile-image> ( tile-bitmap original-image -- tile-image )
+    clone
+        swap
+        [ concat >>bitmap ]
+        [ [ over tile-width ] [ length ] bi 2array >>dim ] bi ;
+
+:: tesselate ( image tess-dim -- image-grid )
+    image bytes-per-pixel :> bpp
+    image dim>> { bpp 1 } v* :> image-dim'
+    tess-dim { bpp 1 } v* :> tess-dim'
+    image bitmap>> image-dim' tess-dim' tesselate-bitmap
+    [ [ image <tile-image> ] map ] map ;
index 0aaa9dcf9bc786f3b0fb0c0f63325142ffa68faf..50b0d309a95b031bf7fbe00a2e39f59ca9602ea1 100644 (file)
@@ -2,7 +2,7 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors alien.data assocs cache colors.constants
 destructors kernel opengl opengl.gl opengl.capabilities
-combinators images images.tesselation grouping sequences math
+combinators images images.tessellation grouping sequences math
 math.vectors generalizations fry arrays namespaces system locals
 literals specialized-arrays ;
 FROM: alien.c-types => int float ;