]> gitweb.factorcode.org Git - factor.git/commitdiff
Move <rgb-image> to images.testing, add randomize-image word
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Sep 2010 02:54:04 +0000 (21:54 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 20 Sep 2010 02:54:04 +0000 (21:54 -0500)
basis/images/images.factor
extra/images/testing/testing.factor

index 4cea5f9f66da8e5a6c159f66278cbfcd64358918..99f0bb91b9167d530c361b60ae0e283bd80642e0 100644 (file)
@@ -66,11 +66,6 @@ TUPLE: image dim component-order component-type upside-down? bitmap ;
 
 : <image> ( -- image ) image new ; inline
 
-: <rgb-image> ( -- image )
-    <image>
-        RGB >>component-order
-        ubyte-components >>component-type ; inline
-
 : has-alpha? ( image -- ? ) component-order>> alpha-channel? ;
 
 : bytes-per-component ( component-type -- n )
index a6644ed71024e0654aae6488e5721f04d43598e1..4dd271aeefa957c5ef33adaf4e97c3c4581fe473 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2009 Keith Lazuka.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: fry images.loader images.normalization images.viewer io
-io.directories io.encodings.binary io.files io.pathnames
-io.streams.byte-array kernel locals namespaces quotations
-sequences serialize tools.test io.backend ;
+USING: accessors fry images images.loader images.normalization
+images.viewer io io.backend io.directories io.encodings.binary
+io.files io.pathnames io.streams.byte-array kernel locals
+namespaces quotations random sequences serialize tools.test ;
 IN: images.testing
 
 <PRIVATE
@@ -53,3 +53,11 @@ PRIVATE>
         [ '[ _ load-reference-image ] ] bi
         unit-test
     ] with-variable ;
+    
+: <rgb-image> ( -- image )
+    <image>
+        RGB >>component-order
+        ubyte-components >>component-type ; inline
+
+: randomize-image ( image -- image )
+    dup bytes-per-image random-bytes >>bitmap ;
\ No newline at end of file