]> gitweb.factorcode.org Git - factor.git/blobdiff - unmaintained/images/processing/rotation/rotation-tests.factor
core, basis, extra: Remove DOS line endings from files.
[factor.git] / unmaintained / images / processing / rotation / rotation-tests.factor
index 390e6deeff4174423a5291b5a915b4689fe88929..8f65362fdfbc2ef9c5b2c875a6748ac113aac79e 100644 (file)
@@ -1,71 +1,71 @@
-! Copyright (C) 2009 Kobi Lurie, Doug Coleman.\r
-! See http://factorcode.org/license.txt for BSD license.\r
-USING: accessors fry images.loader\r
-images.processing.rotation kernel literals math sequences\r
-tools.test images.processing.rotation.private ;\r
-IN: images.processing.rotation.tests\r
-\r
-: first-row ( seq^2 -- seq ) first ;\r
-: first-col ( seq^2 -- item ) harvest [ first ] map ;\r
-: last-row ( seq^2 -- item ) last ;\r
-: last-col ( seq^2 -- item ) harvest [ last ] map ;\r
-: end-of-first-row ( seq^2 -- item ) first-row last ;\r
-: first-of-first-row ( seq^2 -- item ) first-row first ;\r
-: end-of-last-row ( seq^2 -- item ) last-row last ;\r
-: first-of-last-row ( seq^2 -- item ) last-row first ;\r
-\r
-<<\r
-\r
-: clone-image ( image -- new-image )\r
-    clone [ clone ] change-bitmap ;\r
-\r
->>\r
-\r
-: pasted-image ( -- image )\r
-    "vocab:images/processing/rotation/test-bitmaps/PastedImage.bmp"\r
-    load-image clone-image ;\r
-\r
-: pasted-image90 ( -- image )\r
-    "vocab:images/processing/rotation/test-bitmaps/PastedImage90.bmp"\r
-    load-image clone-image ;\r
-\r
-: lake-image ( -- image )\r
-    "vocab:images/processing/rotation/test-bitmaps/lake.bmp"\r
-    load-image clone-image image>pixel-rows ;\r
-\r
-[ t ] [ pasted-image dup clone-image 4 [ 90 rotate ] times = ] unit-test\r
-[ t ] [ pasted-image dup clone-image 2 [ 180 rotate ] times = ] unit-test\r
-[ t ] [ pasted-image dup clone-image 270 rotate 90 rotate = ] unit-test\r
-[ t ] [\r
-    pasted-image dup clone-image dup { 90 180 90 } [ rotate drop ] with each =\r
-] unit-test\r
-\r
-[ t ] [\r
-    pasted-image 90 rotate\r
-    pasted-image90 = \r
-] unit-test\r
-\r
-[ t ] [\r
-    "vocab:images/processing/rotation/test-bitmaps/small.bmp"\r
-    load-image 90 rotate \r
-    "vocab:images/processing/rotation/test-bitmaps/small-rotated.bmp"\r
-    load-image =\r
-] unit-test\r
-    \r
-[ t ] [\r
-    lake-image\r
-    [ first-of-first-row ]\r
-    [ 90 (rotate) end-of-first-row ] bi =\r
-] unit-test\r
-\r
-[ t ]\r
-[ lake-image [ first-row ] [ 90 (rotate) last-col ] bi = ] unit-test\r
-\r
-[ t ]\r
-[ lake-image [ last-col ] [ 90 (rotate) last-row reverse ] bi = ] unit-test\r
-\r
-[ t ]\r
-[ lake-image [ last-row ] [ 90 (rotate) first-col ] bi = ] unit-test\r
-\r
-[ t ]\r
-[ lake-image [ first-col ] [ 90 (rotate) first-row reverse ] bi = ] unit-test\r
+! Copyright (C) 2009 Kobi Lurie, Doug Coleman.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors fry images.loader
+images.processing.rotation kernel literals math sequences
+tools.test images.processing.rotation.private ;
+IN: images.processing.rotation.tests
+
+: first-row ( seq^2 -- seq ) first ;
+: first-col ( seq^2 -- item ) harvest [ first ] map ;
+: last-row ( seq^2 -- item ) last ;
+: last-col ( seq^2 -- item ) harvest [ last ] map ;
+: end-of-first-row ( seq^2 -- item ) first-row last ;
+: first-of-first-row ( seq^2 -- item ) first-row first ;
+: end-of-last-row ( seq^2 -- item ) last-row last ;
+: first-of-last-row ( seq^2 -- item ) last-row first ;
+
+<<
+
+: clone-image ( image -- new-image )
+    clone [ clone ] change-bitmap ;
+
+>>
+
+: pasted-image ( -- image )
+    "vocab:images/processing/rotation/test-bitmaps/PastedImage.bmp"
+    load-image clone-image ;
+
+: pasted-image90 ( -- image )
+    "vocab:images/processing/rotation/test-bitmaps/PastedImage90.bmp"
+    load-image clone-image ;
+
+: lake-image ( -- image )
+    "vocab:images/processing/rotation/test-bitmaps/lake.bmp"
+    load-image clone-image image>pixel-rows ;
+
+[ t ] [ pasted-image dup clone-image 4 [ 90 rotate ] times = ] unit-test
+[ t ] [ pasted-image dup clone-image 2 [ 180 rotate ] times = ] unit-test
+[ t ] [ pasted-image dup clone-image 270 rotate 90 rotate = ] unit-test
+[ t ] [
+    pasted-image dup clone-image dup { 90 180 90 } [ rotate drop ] with each =
+] unit-test
+
+[ t ] [
+    pasted-image 90 rotate
+    pasted-image90 = 
+] unit-test
+
+[ t ] [
+    "vocab:images/processing/rotation/test-bitmaps/small.bmp"
+    load-image 90 rotate 
+    "vocab:images/processing/rotation/test-bitmaps/small-rotated.bmp"
+    load-image =
+] unit-test
+    
+[ t ] [
+    lake-image
+    [ first-of-first-row ]
+    [ 90 (rotate) end-of-first-row ] bi =
+] unit-test
+
+[ t ]
+[ lake-image [ first-row ] [ 90 (rotate) last-col ] bi = ] unit-test
+
+[ t ]
+[ lake-image [ last-col ] [ 90 (rotate) last-row reverse ] bi = ] unit-test
+
+[ t ]
+[ lake-image [ last-row ] [ 90 (rotate) first-col ] bi = ] unit-test
+
+[ t ]
+[ lake-image [ first-col ] [ 90 (rotate) first-row reverse ] bi = ] unit-test