Skip navigation.
 
mlRe: Faster way to test pixels?
FROM : Jens Alfke
DATE : Sun May 25 18:58:46 2008

On 25 May '08, at 8:14 AM, Steve Christensen wrote:

> Unless you know for a fact that your bitmap data is packed such that 
> each row begins immediately after the previous row, you'll need to 
> do a bit more work. Bitmaps can be created with [bits bytesPerRow] > 
> bytesPerPixel * [bits pixelsWide]. In that case you could have some 
> uninitialized bytes between the end of one row and the beginning of 
> the next, which could affect the outcome of your test.


I agree — I've been burned by this in the past. RowBytes often seems 
to get rounded up to multiples of a power of 2, such as 8 or 16, 
probably for better cache coherency or because GPUs are optimized for 
it.

—Jens

Related mailsAuthorDate
mlFaster way to test pixels? Graham Cox May 25, 07:55
mlRe: Faster way to test pixels? Ken Thomases May 25, 08:10
mlRe: Faster way to test pixels? Jens Alfke May 25, 09:13
mlRe: Faster way to test pixels? Graham Cox May 25, 13:34
mlRe: Faster way to test pixels? Steve Christensen May 25, 17:14
mlRe: Faster way to test pixels? Gary L. Wade May 25, 18:52
mlRe: Faster way to test pixels? Jens Alfke May 25, 18:58
mlRe: Faster way to test pixels? Ken Ferry May 26, 01:44
mlRe: Faster way to test pixels? Graham Cox May 26, 12:43