Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Flynnstone

macrumors 65816
Original poster
Feb 25, 2003
1,438
96
Cold beer land
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

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
My first thought would be Quartz Composer. 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

macrumors G5
Jan 5, 2006
12,911
2,158
Redondo Beach, California
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

macrumors member
Apr 13, 2004
33
0
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 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 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...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.