1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
NSMutableArray * ligneR = [[NSMutableArray alloc] init];
NSMutableArray * colonneR = [[NSMutableArray alloc] init];
for (NSUInteger i = 0; i < ghostSize.width; i++) {
[colonneR addObject:[[NSMutableString alloc]init ]];//]WithFormat:@"%d",newR]];
}
for (NSUInteger j = 0; j < ghostSize.height; j++) {
for (NSUInteger i = 0; i < ghostSize.width; i++) {
UInt32 * inputPixel = inputPixels + j * inputWidth + i + offsetPixelCountForInput;
UInt32 inputColor = *inputPixel;
UInt32 * ghostPixel = ghostPixels + j * (int)ghostSize.width + i;
UInt32 ghostColor = *ghostPixel;
int newR = R(ghostColor) ;
NSNumber *R=[NSNumber numberWithInt:newR];
[colonneR replaceObjectAtIndex:i withObject:R];
*inputPixel = RGBAMake(newR, newG, newB, A(inputColor));
}
[ligneR addObject:colonneR];
} |
Partager