Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 05-21-2008, 08:23 AM   #1 (permalink)
realberen
New Member
 
realberen's Avatar
 
Join Date: Apr 2008
Posts: 60
Default Getting data from an UIImage

Hi, I'm making a barcode reader for the iPhone.

I've captured a picture to an UIImage, but now I want to access the data and analyse them. Really, I just want the middle row, converted to greyscale, for now I want to discard the rest. However, UIImage doesn't give me access to the raw data, I have to convert it to either PNG or JPEG in an NSData using functions like UIImagePNGRepresentation(image). That's fine, but how do I continue to convert a PNG file to raw pixels?

UIImage has provided me with the dimensions of the picture, and I expect the pixels to be in ARGB format, but I haven't found the equivalent of NSBitmapImageRep in the SDK. Any suggestions on how I can convert an NSData* with a ARGB PNG image into a grayscale NSArray* of int or similar?

Cheers

Nik
realberen is offline   Reply With Quote
 

» Advertisements
» Online Users: 584
14 members and 570 guests
chemistry, ckgni, devangvyas, Domele, hiddendemo, ilmman, linkmx, Objective Zero, PetarPM, Prolocksmith12, savvycom, Speed, StormFactory, sudama
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,780
Threads: 89,204
Posts: 380,599
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Prolocksmith12
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:31 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.