BMPの話なんですが
(unsigned)(((long)pixWidth * pixDepth + 31) / 32) * 4
(unsigned)((pixDepth + 7) / 8)
でそれぞれ1ライン、1ピクセルに必要なバイト数を得られるのでしょうか?