]> gitweb.factorcode.org Git - factor.git/commitdiff
compression.run-length: moved to extra to correct dependency hierarchy
authorolus2000 <alsabak@gmail.com>
Mon, 15 Jan 2024 19:18:31 +0000 (20:18 +0100)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 15 Jan 2024 19:27:49 +0000 (11:27 -0800)
basis/compression/run-length/authors.txt [deleted file]
basis/compression/run-length/run-length.factor [deleted file]
basis/compression/run-length/tags.txt [deleted file]
extra/compression/run-length/authors.txt [new file with mode: 0644]
extra/compression/run-length/run-length.factor [new file with mode: 0644]
extra/compression/run-length/tags.txt [new file with mode: 0644]

diff --git a/basis/compression/run-length/authors.txt b/basis/compression/run-length/authors.txt
deleted file mode 100644 (file)
index 7c1b2f2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Doug Coleman
diff --git a/basis/compression/run-length/run-length.factor b/basis/compression/run-length/run-length.factor
deleted file mode 100644 (file)
index 50a8c32..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-! Copyright (C) 2009 Doug Coleman.
-! See https://factorcode.org/license.txt for BSD license.
-USING: arrays combinators grouping kernel math math.matrices
-math.order sequences sequences.parser ;
-IN: compression.run-length
-
-: run-length-uncompress ( byte-array -- byte-array' )
-    2 group [ first2 <array> ] map B{ } concat-as ;
-
-: 8hi-lo ( byte -- hi lo )
-    [ 0xf0 bitand -4 shift ] [ 0xf bitand ] bi ; inline
-
-:: run-length-uncompress-bitmap4 ( byte-array m n -- byte-array' )
-    byte-array <sequence-parser> :> sp
-    m  1 + n <zero-matrix> :> matrix
-    n 4 mod n + :> stride
-    0 :> i!
-    0 :> j!
-    f :> done?!
-    [
-        ! i j [ number>string ] bi@ " " glue .
-        sp consume dup 0 = [
-            sp consume dup 0x03 0xff between? [
-                nip [ sp ] dip dup odd?
-                [ 1 + take-n but-last ] [ take-n ] if
-                [ j matrix i swap nth copy ] [ length j + j! ] bi
-            ] [
-                nip {
-                    { 0 [ i 1 + i!  0 j! ] }
-                    { 1 [ t done?! ] }
-                    { 2 [ sp consume j + j!
-                          sp consume i + i! ] }
-                } case
-            ] if
-        ] [
-            [ sp consume 8hi-lo 2array <repetition> concat ] [ head ] bi
-            [ j matrix i swap nth copy ] [ length j + j! ] bi
-        ] if
-
-        ! j stride >= [ i 1 + i!  0 j! ] when
-        j stride >= [ 0 j! ] when
-        done? not
-    ] loop
-    matrix B{ } concat-as ;
-
-:: run-length-uncompress-bitmap8 ( byte-array m n -- byte-array' )
-    byte-array <sequence-parser> :> sp
-    m  1 + n <zero-matrix> :> matrix
-    n 4 mod n + :> stride
-    0 :> i!
-    0 :> j!
-    f :> done?!
-    [
-        ! i j [ number>string ] bi@ " " glue .
-        sp consume dup 0 = [
-            sp consume dup 0x03 0xff between? [
-                nip [ sp ] dip dup odd?
-                [ 1 + take-n but-last ] [ take-n ] if
-                [ j matrix i swap nth copy ] [ length j + j! ] bi
-            ] [
-                nip {
-                    { 0 [ i 1 + i!  0 j! ] }
-                    { 1 [ t done?! ] }
-                    { 2 [ sp consume j + j!
-                          sp consume i + i! ] }
-                } case
-            ] if
-        ] [
-            sp consume <array> [ j matrix i swap nth copy ] [ length j + j! ] bi
-        ] if
-
-        ! j stride >= [ i 1 + i!  0 j! ] when
-        j stride >= [ 0 j! ] when
-        done? not
-    ] loop
-    matrix B{ } concat-as ;
diff --git a/basis/compression/run-length/tags.txt b/basis/compression/run-length/tags.txt
deleted file mode 100644 (file)
index e41e7a9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-compression
diff --git a/extra/compression/run-length/authors.txt b/extra/compression/run-length/authors.txt
new file mode 100644 (file)
index 0000000..7c1b2f2
--- /dev/null
@@ -0,0 +1 @@
+Doug Coleman
diff --git a/extra/compression/run-length/run-length.factor b/extra/compression/run-length/run-length.factor
new file mode 100644 (file)
index 0000000..50a8c32
--- /dev/null
@@ -0,0 +1,76 @@
+! Copyright (C) 2009 Doug Coleman.
+! See https://factorcode.org/license.txt for BSD license.
+USING: arrays combinators grouping kernel math math.matrices
+math.order sequences sequences.parser ;
+IN: compression.run-length
+
+: run-length-uncompress ( byte-array -- byte-array' )
+    2 group [ first2 <array> ] map B{ } concat-as ;
+
+: 8hi-lo ( byte -- hi lo )
+    [ 0xf0 bitand -4 shift ] [ 0xf bitand ] bi ; inline
+
+:: run-length-uncompress-bitmap4 ( byte-array m n -- byte-array' )
+    byte-array <sequence-parser> :> sp
+    m  1 + n <zero-matrix> :> matrix
+    n 4 mod n + :> stride
+    0 :> i!
+    0 :> j!
+    f :> done?!
+    [
+        ! i j [ number>string ] bi@ " " glue .
+        sp consume dup 0 = [
+            sp consume dup 0x03 0xff between? [
+                nip [ sp ] dip dup odd?
+                [ 1 + take-n but-last ] [ take-n ] if
+                [ j matrix i swap nth copy ] [ length j + j! ] bi
+            ] [
+                nip {
+                    { 0 [ i 1 + i!  0 j! ] }
+                    { 1 [ t done?! ] }
+                    { 2 [ sp consume j + j!
+                          sp consume i + i! ] }
+                } case
+            ] if
+        ] [
+            [ sp consume 8hi-lo 2array <repetition> concat ] [ head ] bi
+            [ j matrix i swap nth copy ] [ length j + j! ] bi
+        ] if
+
+        ! j stride >= [ i 1 + i!  0 j! ] when
+        j stride >= [ 0 j! ] when
+        done? not
+    ] loop
+    matrix B{ } concat-as ;
+
+:: run-length-uncompress-bitmap8 ( byte-array m n -- byte-array' )
+    byte-array <sequence-parser> :> sp
+    m  1 + n <zero-matrix> :> matrix
+    n 4 mod n + :> stride
+    0 :> i!
+    0 :> j!
+    f :> done?!
+    [
+        ! i j [ number>string ] bi@ " " glue .
+        sp consume dup 0 = [
+            sp consume dup 0x03 0xff between? [
+                nip [ sp ] dip dup odd?
+                [ 1 + take-n but-last ] [ take-n ] if
+                [ j matrix i swap nth copy ] [ length j + j! ] bi
+            ] [
+                nip {
+                    { 0 [ i 1 + i!  0 j! ] }
+                    { 1 [ t done?! ] }
+                    { 2 [ sp consume j + j!
+                          sp consume i + i! ] }
+                } case
+            ] if
+        ] [
+            sp consume <array> [ j matrix i swap nth copy ] [ length j + j! ] bi
+        ] if
+
+        ! j stride >= [ i 1 + i!  0 j! ] when
+        j stride >= [ 0 j! ] when
+        done? not
+    ] loop
+    matrix B{ } concat-as ;
diff --git a/extra/compression/run-length/tags.txt b/extra/compression/run-length/tags.txt
new file mode 100644 (file)
index 0000000..e41e7a9
--- /dev/null
@@ -0,0 +1 @@
+compression