]> gitweb.factorcode.org Git - factor.git/commitdiff
normalizing alpha data for tiffs is done too often, check in test image for it
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 16 Mar 2009 12:11:56 +0000 (07:11 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 16 Mar 2009 12:11:56 +0000 (07:11 -0500)
basis/images/tiff/tiff.factor

index 2ea1b08e208e98079455b7e3c0ccbb34b934122e..80eaff81400f30e800d6dbc5296ef9e287431894 100755 (executable)
@@ -477,26 +477,24 @@ ERROR: unknown-component-order ifd ;
         [ unknown-component-order ]
     } case ;
 
+: normalize-alpha-data ( seq -- byte-array )
+    ! [ normalize-alpha-data ] change-bitmap
+    B{ } like dup
+    byte-array>float-array
+    4 <sliced-groups>
+    [
+        dup fourth dup 0 = [
+            2drop
+        ] [
+            [ 3 head-slice ] dip '[ _ / ] change-each
+        ] if
+    ] each ;
+
 : handle-alpha-data ( ifd -- ifd )
     dup extra-samples find-tag {
-        { extra-samples-associated-alpha-data [
-            [
-                B{ } like dup
-                byte-array>float-array
-                4 <sliced-groups>
-                [
-                    dup fourth dup 0 = [
-                        2drop
-                    ] [
-                        [ 3 head-slice ] dip '[ _ / ] change-each
-                    ] if
-                ] each
-            ] change-bitmap
-        ] }
-        { extra-samples-unspecified-alpha-data [
-        ] }
-        { extra-samples-unassociated-alpha-data [
-        ] }
+        { extra-samples-associated-alpha-data [ ] }
+        { extra-samples-unspecified-alpha-data [ ] }
+        { extra-samples-unassociated-alpha-data [ ] }
         [ bad-extra-samples ]
     } case ;