| Sign In/My Account | View Cart |
| Article: |
Bitmap Image Filters | |
| Subject: | handle alpha channel? | |
| Date: | 2002-08-08 21:12:34 | |
| From: | psheldon | |
|
"p1 = srcData + 3 * (y * w + x);" in IAGrayscaleFilter.m I believe does not as needs n in place of 3, I think.
|
||
Showing messages 1 through 3 of 3.
handle alpha channel?
*p2 = (char)rint((*(p1 + ao) + *(p1 + 1 + ao) + *(p1 + 2 + ao)) / 3);
where ao (alpha offset) is determined at the start of the method as:
int ao = [srcImageRep hasAlpha] ? 1 : 0;
See if that works for you...
Mike