Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling/using libjpeg for iPhone (iOS 3.0+)?

I want to use the libjpeg (http://www.ijg.org/) library in an iPhone iOS 3.0 or greater project. I have tried a few different approaches, but being a bit naive, I'm not really sure how to begin.

I've been playing with parts and pieces of the SDL library project from here http://code.google.com/p/sdl-static/ all to no real working outcomes.

Can anyone link me to a tutorial or give me a push in the right direction?

My ultimate goal is to be able to manipulate the DCT coefficients of jpeg images somewhat similar to this MatLab libjpeg wrapper. http://www.philsallee.com/jpegtbx

So I would like to start with something like

UIImage *cover = [UIImage imageNamed:@"cover.jpg"];
// convert to the libjpeg structs
// do some DCT coefficient manipulations
UIImage *stego = ... // save it back to iOS SDK equivalent image type
like image 618
Ben Holland Avatar asked Dec 28 '25 22:12

Ben Holland


1 Answers

You can unpack the entire library into your project and add the files to XCode. There's a file 'filelist.txt' which describes the minimal set you need to link into your project. Have a look at 'example.c' for how to call the API. I don't see functions to tweak the DCT coefficients - that you'll have to hack in yourself.

like image 63
John Ripley Avatar answered Dec 30 '25 16:12

John Ripley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!