Converting to RGB might involve a precision increase
Need to do more than a simple shift to get the appropriate
new value. This isn't quite as exact as a proper multiplication
and division, but the error is so small it's not worth the
extra cycles.
diff --git a/common/rfb/PixelFormat.h b/common/rfb/PixelFormat.h
index aef309c..dd41474 100644
--- a/common/rfb/PixelFormat.h
+++ b/common/rfb/PixelFormat.h
@@ -89,9 +89,9 @@
int blueShift;
protected:
- int redConvShift;
- int greenConvShift;
- int blueConvShift;
+ /* Pre-computed values to keep algorithms simple */
+ int redBits, greenBits, blueBits;
+ int maxBits, minBits;
bool endianMismatch;
};
}