Re: Best class for pixel-level image processing?
Re: Best class for pixel-level image processing?
- Subject: Re: Best class for pixel-level image processing?
- From: Trygve Inda <email@hidden>
- Date: Fri, 12 Feb 2010 08:00:06 +0000
- Thread-topic: Best class for pixel-level image processing?
> I am writing an application that wants to perform some basic computer vision
> computation, and I want a class that offers pixel-level access to an image.
> What would be the best way to approach this?
>
Do something like:
MyImageRep =
[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
pixelsWide:pixelsWide
pixelsHigh:pixelsHigh
bitsPerSample:8
samplesPerPixel:4
hasAlpha:YES
isPlanar:NO
colorSpaceName:NSDeviceRGBColorSpace
bitmapFormat:NSAlphaFirstBitmapFormat
bytesPerRow:pixelsWide * 4
bitsPerPixel:32];
And later:
[NSGraphicsContext setCurrentContext:[NSGraphicsContext
graphicsContextWithBitmapImageRep:myImageRep]];
and:
[myImageRep representationUsingType:NSJPEGFileType properties:imageProps];
This should get you started.
Trygve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden