Depth4Image.st
changeset 3872 390fabbc3036
parent 3869 cd40d1912c03
child 4405 f4c62bb63035
equal deleted inserted replaced
3871:a7867fb8d880 3872:390fabbc3036
   106     bytes at:index put:byte
   106     bytes at:index put:byte
   107 
   107 
   108     "Created: 24.4.1997 / 17:06:39 / cg"
   108     "Created: 24.4.1997 / 17:06:39 / cg"
   109 !
   109 !
   110 
   110 
   111 rowAt:rowIndex into:aPixelBuffer
   111 rowAt:y into:aPixelBuffer
   112     "fill aBuffer with pixel values retrieved from a single row.
   112     "fill aBuffer with pixel values retrieved from a single row.
   113      Notice: rowIndex is 0-based."
   113      Notice: row coordinate starts with 0."
   114 
   114 
   115     |lineIndex "{ Class: SmallInteger }"
   115     |lineIndex "{ Class: SmallInteger }"
   116      byte      "{ Class: SmallInteger }" 
   116      byte      "{ Class: SmallInteger }" 
   117      w         "{ Class: SmallInteger }" 
   117      w         "{ Class: SmallInteger }" 
   118      pixel dstIdx bytes|
   118      pixel dstIdx bytes|
   119 
   119 
   120     bytes := self bits.
   120     bytes := self bits.
   121     dstIdx := 1.
   121     dstIdx := 1.
   122     w := width - 1.
   122     w := width - 1.
   123     lineIndex := (self bytesPerRow * rowIndex).
   123     lineIndex := (self bytesPerRow * y).
   124     0 to:w do:[:x |
   124     0 to:w do:[:x |
   125         x even ifTrue:[
   125         x even ifTrue:[
   126             lineIndex := lineIndex + 1.
   126             lineIndex := lineIndex + 1.
   127             byte := bytes at:lineIndex.
   127             byte := bytes at:lineIndex.
   128             pixel := (byte bitShift:-4) bitAnd:16rF.
   128             pixel := (byte bitShift:-4) bitAnd:16rF.
  1027 ! !
  1027 ! !
  1028 
  1028 
  1029 !Depth4Image class methodsFor:'documentation'!
  1029 !Depth4Image class methodsFor:'documentation'!
  1030 
  1030 
  1031 version
  1031 version
  1032     ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.45 2003-04-29 19:42:31 cg Exp $'
  1032     ^ '$Header: /cvs/stx/stx/libview/Depth4Image.st,v 1.46 2003-05-02 17:50:18 cg Exp $'
  1033 ! !
  1033 ! !