Why float?

If float is needed: then define mask_float outside of the loop and update mask_float[i_max + t_row, j_max + t_col] = 0 separately, so you do not have to cast it in each iteration.