How to create JPEG image on iOS from scratch - objective-c

I'm trying to create an objective C classe for my iPad application which can convert a powerpoint file to a jpeg file.
Accordingly i've to read into the pptx format to see how the file is structured and create an image, from scratch, in which i can say this element goes there, this one here, this text there.
But actually i've no idea how to do this, if the best way is to use a already existing framework in iOS or an additional library?
Thanks to everyone ;)
Bye

The fastest way to visualize elements is, to me, OpenGL ES. You can use mobile GPU to visualize then there is CIImage for managing image.

Take a look at Quartz 2D, the drawing engine used as the main workhorse for 2D graphics on iOS. It gives you all the primitives for drawing shapes, fills, text and other objects you need to render the presentation.

Related

Fast way to find all instances of an image in an image? Core Image? OpenCV?

I wrote code that loops through a video feed of a computer screen and recognizes certain PNG images by looping through pixels. I get 60fps with 250% CPU usage(1280x800 video feed). The code is a blend of Objective-C and C++.
I'm trying to find a faster alternative. Can Core Image detect instances of an image within another image and give me the pixel location? If not, is OpenCV fast enough to do that kind of processing at 60fps?
If Core Image and OpenCV aren't the correct tools, is there another tool that would be better suited?
(I haven't found any documentation showing Core Image can do what I need, I am trying to get a OpenCV demo working to benchmark)

Custom Shape in Cocos3d

I am developing an iPhone application that uses cocos3d. My question is: how to draw custom shape in cocos3d? for example a cylinder, a cylinder with an ellipse as its base instead of a circle, a polygone, etc. Can anyone please guide me how to start?
Thanks in advance
There's good support for doing that in Cocos3D.
CC3Mesh has simple property settings for allocating space for vertex content, plus a large family of methods for getting and setting various vertex content. Make sure you understand how to use the vertexContentTypes property.
The source files CC3ParametricMeshes.m and CC3ParametricMeshNodes.m contain a number of examples of creating mesh shapes programmatically. Have a look at the implementations in those files.

iOS: how to add "cartoon" style animation (movie) to the slide?

I'm wondering if it's possible to have a slide with text AND add some animation into it for an iPad app. See screenshot below to get an idea of what I need. I want that guy jump up and down and smile. I'm sure I'm not capable of drawing that image using Objective-C primitives myself, so I'm looking at the following options:
Do complete animation in 3rd-party tool (Adobe?) and then add it as single standalone file on the slide. But I do not know, what formats are supported in iOS, what are standard formats, and, at the end, how to insert that file on the slide. Can somebody clarify this please?
Do complete animation, and then save frames as images, and then quickly change images to give illusion of a movie.
Am I missing something? Are there any other ways? what's the best option?
Please let me know if I'm not clear enough - I will try to provide more information.
Thank you.
If you want to use a movie file for the animation, you can find the supported video formats in the iOS Technology Overview, under “Media Layer > Video Technologies”. You will need to use an AVPlayerLayer from the AVFoundation Framework to show the video.
If you want to use a separate image file for each frame, you can use one of the +[UIImage animatedImage...] methods to create an animated UIImage, and display it in a UIImageView.
If you want to use a single animated GIF for the animation, you can use this public domain UIImage+animatedGIF category to load the GIF into an animated UIImage, and display it in a UIImageView.

Spritesheet: tool to get coordinates

I have a one spritesheet image with all sprites, I downloaded this image from Interent. My question: Is there a tool that help me to get the coordinates of each sprite? would I have to search coordinates manually ?
I've been reading several tutorials like:http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d and http://indiedevstories.com/2011/04/10/using-sprite-sheets-in-cocos2d-and-tiled-part-1/, but all them use multiple images to create one spritesheet and generate automatically the .plist, but this is not my case.
In my case I have only one .png and no .plist
Help me please!!!
Apologies for the self-promotion but I have created a tool for working with single spritesheet images and outputting the coordinates. It even has automatic sprite selection :)
http://www.darkfunction.com/editor
You can crop the images using some editor (photoshop for example) and then use the exiting tool to generate the texture and the plist. I think it will be the fastest and the easiest way because in case you would want to generate only plist you will do the same operation - selecting the rectangle.
Use preview to crop out all the images separately. Then use zwoptex or texture packer to combine them all and generate the spritesheet with .png and .plist
Other than that it is difficult to figure out what is the rect of each image. If you are a good programmer you can write a tool to analyze the png and extract out the information which can be used to identify the rectangles, but my advice is to do it manually.
Divide your image using an image editor. Then add it to a spritesheet generator (like Sprite Master). Then you are free to make your output as you want by just changing the parameters.
Sprite Master will have a feature like parsing prepared spritesheet to individual images in following versions.

3D Transformations on a Quartz2D path — Drawing Application

I'm in the planning stage of writing a Cocoa drawing application (for Mac, not iOS), and I'm trying to discern whether one of my features is technically possible via any of the drawing frameworks. Any help or relevant information would be greatly appreciated.
The idea is to apply a 3D transformation to an object drawn with Quartz2D. I've considered capturing the relevant portion of the canvas View (where objects are drawn) as an image and sending it to Core Animation, but that doesn't seem like the best option. Since this is a drawing application, it's less about 3D animation than it is about the transformed shape. This solution is also less than ideal because I assume that if the 2D object were a vector path rather a bitmap image, I would have to rasterize it to apply such a transformation. The ideal implementation would enable the user to dynamically rotate a flat object in 3 dimensions until she found a suitable orientation, lock in this transformation, and still be able to manually adjust the path's vector points.
Is this feasible? Would it require working directly with OpenGL? Help of any kind is most welcome.
Thank you!
Seems to me that anything you'd do with a 3D transform, you should be able to do with multiple affine transforms. See UIBezierPath's -applyTransform method.