inline some Bitmap functions to improve performance