rt_pixel added mask parameter and error checks to rt_pixel_set_to_array