Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

accessing pixels in an image



I'd like to wean myself off of GWorlds to do image processing on images in Carbon width Core Graphics, so I'd like to access pixels at the native resolution. Is there an easy way of doing this? Near as I can figure out, I need to call :

CGImageSourceCreateWithURL
CGImageSourceCreateImageAtIndex

to read the image file, then call

CGImageGetBitmapInfo
CGImageGetBitsPerComponent(
CGImageGetBitsPerPixel
CGImageGetColorSpace
CGImageGetWidth
CGImageGetHeight

to get enough information to create a Bitmap context with

CGBitmapContextCreate

which is then populated with pixels from the image file with

CGContextDrawImage

Is this right?


Cocoa has a nice method to do this in one line

NSBitmapImageRep *srcImageRep = [NSBitmapImageRep imageRepWithData: [srcImage TIFFRepresentation]];

Is there something like this for Carbon?


-- Ken Turkowski email@hidden Reality Pixels http://www.realitypixels.com Computer Graphics 2D 3D Immersive Imagery Photo-mosaicing Panoramas Computer Vision Applied Mathematics Numerical Analysis Optimization

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.