PDA

View Full Version : Best tool for graphics & compositing




Flynnstone
Jul 23, 2007, 08:34 PM
Hello,
I'm looking to a graphics type application. Not video, but more like a moving x-y chart. I would like to "layer" the chart over (under) other graphic(s) objects like a jpg or tiff. With transparency control. Is this compositing?
I don't know how fast the data will come in to update the chart.

What is the best tool for the job?
I've used RealBasic before. I do a lot of embedded systems programming in C (and assemblers when neccessary). I know a bit of C++. Just enough perhaps to be dangerous.
I don't know Carbon & I don't know Cocoa.
I have an inkling that Cocoa is the way to go.
So I'm looking some guidance from the experts in this forum. I know you're here, I read your posts :)



HiRez
Jul 23, 2007, 10:45 PM
My first thought would be Quartz Composer (http://developer.apple.com/documentation/GraphicsImaging/Conceptual/QuartzComposer/). It runs in real time, leveraging the power of OpenGL and modern GPUs, and requires no real programming experience (although there is a learning curve to learning how it works). You can do some really nice stuff with it, but the primitives it makes available to you to build images with are...well...somewhat primitive. Basically text or square blocks, but you can also use images with an alpha channel. In fact there is even a demo (I think installed with the SDK) of a data-driven graph.

After that, yes, you could look at Cocoa. Additionally, you can hook into Quartz Composer from Cocoa applications, so you could use Cocoa to parse your data and feed it to QC to display, for example, or provide more user interaction. Or you could use straight C and OpenGL if you know it.

You also might look at some game-type libraries (does SDL work for this sort of thing?).

ChrisA
Jul 24, 2007, 05:34 PM
Hello,
I'm looking to a graphics type application. Not video, but more like a moving x-y chart.

A lot depends on how tied to Apple's Mac OSX you want to be. I prefer to be more cross platform but this depends on your users and what's needed.

The first thing I thought of was OpenGL and some of the open libraries that go on top of that like "inventor". This is cross platform and on many platforms is hardware accelerated.

But then I don't know anything about Apples' new "Core Animation". It could be perfect

richyfp
Jul 25, 2007, 06:05 AM
From your description, it sounds like Cocoa would be ideal. In fact, I just started writing a program that does some 2D graphics stuff (see my blog if you're interested) and thus far, I've found AppKit's drawing tools to be really nice.

If you've never programmed in Objective-C/Cocoa before, I'd recommend just diving in, especially since you've got experience of C already. If you want to know more about Cocoa/CoreGraphics drawing, I'd recommend having a look at this (http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/CocoaDrawingGuide.pdf) document first to get a feel for it all. Then maybe have a look at the NSView and NSScrollView classes, since you'll definitely be subclassing NSView for your program.

Of course, all of this ties you to Mac OS X, so if you need portability then it's unfortunately not an option.

PS If you want to do have a look at Quartz Composer and Cocoa (as HiRez suggested), the Cocoa/Quartz Composer "mashup" is found here (file:///Developer/Examples/Quartz%20Composer/Chart/QuartzComposerChart.xcodeproj) once you've installed the developer tools...

PPS Also have a look at the "Interpolation modes" Quartz composition included with the developer examples. While it's quite simple, it does demonstrate QC mouse tracking and draws a very simple 2D graph...