scoped constants instead of enums, removed dither, method Limit() instead of macro BOUND()