ImageReader.st
changeset 3836 f2774ddc2b1b
parent 3835 8b203fa57396
child 3839 28440069abe4
--- a/ImageReader.st	Thu Apr 03 12:32:14 2003 +0200
+++ b/ImageReader.st	Thu Apr 03 12:55:15 2003 +0200
@@ -1546,6 +1546,8 @@
     "swap bytes from RGB into BGR order.
      The argument is a pixel data buffer (byteArray)"
 
+    |t|
+
 %{  /* OPTIONAL */
     if (__isByteArray(data) && __isSmallInteger(nBytes)) {
         int __nBytes = __intVal(nBytes);
@@ -1566,7 +1568,11 @@
         }
     }
 %}.
-    self primitiveFailed.
+    1 to:(nBytes - 2) by:3 do:[:i |
+        t := data at:i.
+        data at:i put:(data at:i+2).
+        data at:i+2 put:t
+    ].
 
     "
      |bytes|
@@ -2195,5 +2201,5 @@
 !ImageReader class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.77 2003-04-03 10:32:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/ImageReader.st,v 1.78 2003-04-03 10:55:15 cg Exp $'
 ! !