|
Re: incorrect subtraction in get color pixel value
I suspect that the math is being done with an unsigned 8 bit integer. In that system, 0 - 1 is equal to 255. Strange, and that is why integers are a bit of a risky tradeoff. To check this, do the math as normal, then add or subtract 256 to the number to get it back into the range of 0 to 255. That is the result that you will get with unsigned numbers.
Greg McKaskle
|