--- a/Depth24Image.st Wed Jul 02 19:31:49 2003 +0200
+++ b/Depth24Image.st Fri Jul 04 16:19:27 2003 +0200
@@ -1644,11 +1644,9 @@
].
index := index + 3.
].
-
pseudoBits := ByteArray uninitializedNew:(width * height).
- w := width + 2.
- error := ByteArray uninitializedNew:w*(3*2).
+ error := ByteArray uninitializedNew:(width + 2) * (3*2).
w := width.
h := height.
@@ -1657,15 +1655,10 @@
%{
int __x, __y;
- int __eR, __eG, __eB;
unsigned char *srcP, *dstP;
unsigned char *idP;
- unsigned char *dp;
unsigned char *__clrLookup;
short *errP, *eP;
- int __fR, __fG, __fB;
- int iR, iG, iB;
- int idx;
int __w = __intVal(w);
int __h = __intVal(h);
int __nColors = __intVal(lastColor);
@@ -1710,6 +1703,9 @@
bzero(eP, (__w+2) * 2 * 3);
for (__y=__h; __y>0; __y--) {
+ unsigned char *dp;
+ int __eR, __eG, __eB;
+
__eR = __eG = __eB = 0;
eP = &(errP[3]);
@@ -1728,12 +1724,14 @@
int minDelta, bestIdx;
int cnt;
- __wantR = *srcP++;
- __wantG = *srcP++;
- __wantB = *srcP++;
+ __wantR = srcP[0];
+ __wantG = srcP[1];
+ __wantB = srcP[2];
+ srcP += 3;
/*
- * wR, wG and wB is the wanted r/g/b value;
+ * wI are the wanted r/g/b values;
+ * eI are the error values;
*/
__wantR = __wantR + __eR;
__wantG = __wantG + __eG;
@@ -1744,12 +1742,7 @@
#define BLUE_SCALE 11
#define GOOD_DELTA 30
-#define xRED_SCALE 1
-#define xGREEN_SCALE 1
-#define xBLUE_SCALE 1
-#define xGOOD_DELTA 3
-
-#define FAST_LOOKUP
+#define FAST_LOOKUP /* */
/* #define ONE_SHOT */
#define NPROBE 8
@@ -1917,6 +1910,7 @@
}
#endif
}
+
dp = __ByteArrayInstPtr(ditherRGBBytes)->ba_element;
dp += bestIdx * 3;
dR = dp[0];
@@ -3024,5 +3018,5 @@
!Depth24Image class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/Depth24Image.st,v 1.81 2003-07-02 17:31:49 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/Depth24Image.st,v 1.82 2003-07-04 14:19:27 cg Exp $'
! !