Applying transformations to NSBitmapImageRep
So ... I have an image loaded into an NSBitmapImageRep object, so I am able to examine the contents of specific pixels via a two dimensional array. Now I want to apply a couple of "transformations" to the image, in preparation for some additional processing. If I was manipulating the image manually, in Photoshop, I would:
- Rotate the image
- Crop a portion of it and discard the rest
- Apply a "threshold" transformation (which essentially converts the image to black and white, based on the threshold value I provide)
- Resample the image to shrink it down a bit (which, although losing some image quality, will speed up the subsequent processing)
(not necessarily in that order)
Are there objec开发者_开发百科tive C methods available to facilitate these specific image manipulations, with the data in the NSBitmapImageRep object? If so, can someone point me to some good examples?
Create a CIImage for the CGImage of the bitmap image rep. Then you can:
- Rotate it
- Crop it
- Apply a threshold filter
- Scale it
精彩评论