Before I start here, I am using C#. I would like to do some transforms using the ColorMatrix class. The problem is that sometimes an overflow occurs for r, g, or b. Instead of clamping the value at 255, the matrix loops around and starts again at 0. This means that, for images which should appear all white, they begin to turn black again. I am using this to model intensity over different line rates for line scan cameras. Does anyone know of a way to get around this?
BTW, I do have other other methods in mind, and I could do the matrix transforms myself, but I am more interested in a solution to this specific problem (if there is one of course).