small routines for a software-blitter and image filters