cocoa - Getting into pixel data of NSImage -


I am writing an application that operates on black and white images, by doing it an NSImage object in my method And then I am composed of NSImatemap image NSImage. All works but quite slow here is my code:

  - (NSImage *) skeleton: (NSImage *) image {int x = 0, y = 0; NSUINDER Pixel Variable = 0; NSBitmapImageRep * bitmapImageRep = [[NSBitmapImageRep alloc] initWithData: [Image TIFF Representation]]; [MyHelpText setIntValue: [bitmapImageRep PixelWide]]; [MyHelpText2 setIntValue: [bitmap image pixel high]]; Ensolar * black = [nscillar black color]; Enskolker * White = [Enkolar White Collar]; [Mycolor set]; [MyColor2 set]; (X = 0; x & lt; = [bitmapImageRep pixelsWide]; X ++) {for (y = 0; y & lt; = [bitmapImageRep pixelsHigh]; y ++) {// it is only if it [bitmapImageRep SetColor is working to see: myColor ATX: xy: y]; }} [MyColor release]; [MyColor2 release]; NSImage * Produced image = [[NSImage alloc] init]; [Add image image rendering: bitmap image]; [BitmapImageRep release]; Return [Production Image Autorelage]; }  

So I tried to use CIImage, but I do not know how to get in each pixel by (X, Y) coordinates. It's really important.


Comments