Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa 2D graphics: Quartz, Core Image or Core Animation?

I have been reading for several hours now documentation about drawing two dimensional graphics in a objective-c cocoa application. There appears to be several different technologies all specific to certain tasks. My understanding is that the following technologies do the following things. Please correct me if I'm wrong.

  • Quartz 2D: The primary library for drawing shapes, text, and images to the screen.
  • Core Graphics: this is the name of the framework that contains Quartz. This can be used as a synonym for Quartz.
  • QuartzGL: A GPU acceleration mode for Quartz that is not enabled by default and not necessarily faster for drawing things on the screen.
  • OpenGL: The most low level library, talk directly to the graphics card at the cost of more lines of code. More suited for 3D graphics.
  • Core Image: A library for displaying images and text, but not so much for drawing shape primitives.
  • Core Animation: A library for automatically animating objects. Apparently not suited for moving large numbers of objects. Nor for continuous animation of objects.
  • QuickTime: A library that apparently also does images and text in addition to video, but probably not good for drawing primitive shapes.

What I would like to do is create a browser for some specific type of data. The view would not very complicated and would consist of drawing rectangles at specific locations. However, the user should be able to move around by dragging the view to the left or the right and the this movement should be fluid. Here is a example that is very close to what I'm trying to make:

http://jbrowse.org/ucsc/hg19/

What drawing technology would you recommand I start coding with?

like image 918
xApple Avatar asked Jun 06 '12 19:06

xApple


1 Answers

You want Quartz. Unless your graphing MASSIVE amounts of data, any Mac (I'm assuming Mac not iOS) should handle it easily. It is easy, efficient, and will probably get you where you need to go. For the dragging movement, you'll probably manage that with Core Animation layers.

Note: Everything in the end is handled by AppKit (Mac) or UIKit (iOS) and, eventually, Core Animation. If you're doing graphics, you will encounter Core Animation at some point, as it manages everything displayed.

Note: If you are graphing that much data, you can use OpenGL, but even then, the need shouldn't be too much until you start displaying, probably many millions of vertices or complex visualisations.

like image 96
Linuxios Avatar answered Nov 07 '22 15:11

Linuxios