As near as I can tell, this function would need to include options for each of the possible rgb formats.
If you want a general function using WritePixelFast is most likely the way to go. The "LockedPixels" is really (IMHO) more suitable for "hardcoded" solutions based on your particular game. The example mentioned above for example could probably be optimized by a factor of ten or so by using constants in place of variables, and a less flexible "wipe" code.