--- a/Depth24Image.st Tue Jun 18 10:35:32 1996 +0200
+++ b/Depth24Image.st Tue Jun 18 17:06:39 1996 +0200
@@ -1528,12 +1528,14 @@
newBytes := ByteArray uninitializedNew:(newWidth * 3 * newHeight).
newImage := self species new.
- newImage bits:newBytes.
- newImage width:newWidth.
- newImage height:newHeight.
- newImage photometric:photometric.
- newImage samplesPerPixel:samplesPerPixel.
- newImage bitsPerSample:#(8 8 8).
+ newImage
+ width:newWidth
+ height:newHeight
+ photometric:photometric
+ samplesPerPixel:samplesPerPixel
+ bitsPerSample:#(8 8 8)
+ colorMap:nil
+ bits:newBytes.
"walk over destination image fetching pixels from source image"
@@ -1551,14 +1553,14 @@
double _mY = _floatVal(mY);
for (_row = 0; _row <= _h; _row++) {
- _srcRowP = _srcP + (_width3 * (int)((double)_row / _mY));
- for (_col = 0; _col <= _w; _col++) {
- sP = _srcRowP + (((int)((double)_col / _mX)) * 3);
- _dstP[0] = sP[0];
- _dstP[1] = sP[1];
- _dstP[2] = sP[2];
- _dstP += 3;
- }
+ _srcRowP = _srcP + (_width3 * (int)((double)_row / _mY));
+ for (_col = 0; _col <= _w; _col++) {
+ sP = _srcRowP + (((int)((double)_col / _mX)) * 3);
+ _dstP[0] = sP[0];
+ _dstP[1] = sP[1];
+ _dstP[2] = sP[2];
+ _dstP += 3;
+ }
}
%}
.
@@ -1568,17 +1570,17 @@
w := newWidth - 1.
h := newHeight - 1.
0 to:h do:[:row |
- srcRowIdx := (width * 3 * (row // mY)) + 1.
- 0 to:w do:[:col |
- srcIndex := srcRowIdx + ((col // mX) * 3).
- value := bytes at:srcIndex.
- newBytes at:dstIndex put:value.
- value := bytes at:(srcIndex + 1).
- newBytes at:(dstIndex + 1) put:value.
- value := bytes at:(srcIndex + 2).
- newBytes at:(dstIndex + 2) put:value.
- dstIndex := dstIndex + 3
- ]
+ srcRowIdx := (width * 3 * (row // mY)) + 1.
+ 0 to:w do:[:col |
+ srcIndex := srcRowIdx + ((col // mX) * 3).
+ value := bytes at:srcIndex.
+ newBytes at:dstIndex put:value.
+ value := bytes at:(srcIndex + 1).
+ newBytes at:(dstIndex + 1) put:value.
+ value := bytes at:(srcIndex + 2).
+ newBytes at:(dstIndex + 2) put:value.
+ dstIndex := dstIndex + 3
+ ]
].
"
^ newImage
@@ -1707,5 +1709,5 @@
!Depth24Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth24Image.st,v 1.35 1996-06-14 17:51:16 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth24Image.st,v 1.36 1996-06-18 15:06:39 cg Exp $'
! !