#OTHER
class: Depth16Image
comment/format in: #pixelAtX:y:
changed: #rowAt:putAll:startingAt:
--- a/Depth16Image.st Mon Mar 07 00:36:31 2016 +0100
+++ b/Depth16Image.st Mon Mar 07 00:37:18 2016 +0100
@@ -11,6 +11,8 @@
"
"{ Package: 'stx:libview' }"
+"{ NameSpace: Smalltalk }"
+
Image subclass:#Depth16Image
instanceVariableNames:''
classVariableNames:''
@@ -83,7 +85,6 @@
lineIndex := (width * 2 * y) + 1.
- "left pixel in high bits"
^ bytes wordAt:(lineIndex + (x * 2)) MSB:true.
"Created: 24.4.1997 / 16:06:19 / cg"
@@ -109,16 +110,20 @@
Notice: row coordinate starts at 0."
|dstIdx "{ Class: SmallInteger }"
+ srcIdx "{ Class: SmallInteger }"
pixel
bytes|
bytes := self bits.
dstIdx := (width * 2 * y) + 1.
+ srcIdx := startIndex.
1 to:width do:[:col |
- pixel := pixelArray at:(startIndex + col - 1).
- bytes at:dstIdx put:((pixel bitShift:-8) bitAnd:16rFF).
- bytes at:dstIdx+1 put:(pixel bitAnd:16rFF).
- dstIdx := dstIdx + 2.
+ pixel := pixelArray at:srcIdx.
+ "/ msbFirst
+ bytes at:dstIdx put:((pixel bitShift:-8) bitAnd:16rFF).
+ bytes at:dstIdx+1 put:(pixel bitAnd:16rFF).
+ dstIdx := dstIdx + 2.
+ srcIdx := srcIdx + 1.
].
^ pixelArray
@@ -199,10 +204,10 @@
!Depth16Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth16Image.st,v 1.17 2014-03-02 14:39:22 cg Exp $'
+ ^ '$Header$'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libview/Depth16Image.st,v 1.17 2014-03-02 14:39:22 cg Exp $'
+ ^ '$Header$'
! !