Re: How to determine a single pixels alpha?
Re: How to determine a single pixels alpha?
- Subject: Re: How to determine a single pixels alpha?
- From: Brian Hook <email@hidden>
- Date: Sun, 30 Sep 2001 16:30:37 -0700
unsigned char *pPixel = &pixels[ aPoint.x * 4 + aPoint.y * 4 * imageWidth ];
There's one too many multiplies in the code above.
int
pixIndex = 4 * (y*(int)imageSize.width+x);
Er, it works out the same (you've factored out the multiply by 4).
x * 4 + y * 4 * width = 4 * ( x + y*width)
Now, if "Width" is in bytes instead of pixels, there would be one too many
multiplies.
Brian