The p_cce_read/write_comp() functions use integer divisions for the conversions.
E.g. when reading an integer component into a float application buffer, and writing back again (to integer component), the data will be modified due to the lack of rounding.
Furthermore, there appears to be no clipping to prevent over/underflow.
Logged In: YES
user_id=1524009
Originator: YES
I added rounding to the conversion formulas in p_cce_read/write_comp(), except for the conversions to float and double.
The integer conversions are now: ((cast)( buf[py*width+px]-offset)/gain +0.5);
How to handle the clipping issue?