Added logging info.
Added missing prototypes.
Added width and height parameters to calculate pixel buffer.