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

timprogrammer

macrumors newbie
Original poster
Feb 7, 2007
1
0
hi guys

i am new to mac programming...i'm working my way through a couple of books.

to encourage myself to learn i have set myself 2 target applications i wish to do (it'll help me learn and be useful)

one of these projects is basically "AmbiLight" http://www.ambilight.co.uk/
basically a simple tech of making some lights behind a screen match the colour of the screen.

hardware is really simple. and the idea has been created for windows already (using directshow filters or pixel info) - google momolight.
i wish to create the same idea only for mac....i don't think this would be a terribly hard project, hence why i feel it is a good first project.

what i need is a point in the right direction. what sections of the apple docs should i investigate to get colour information from the desktop. if someone could point me to more focused info as all i know at the moment is quartz, opengl, core image, are all graphics related so its somewhere in there.

all help is much appreciated
thanks
tim
 

bronxbomber92

macrumors regular
Nov 23, 2006
109
0
I'm pretty sure Core Graphics (aka Quartz) and OpenGL can gather pixel color from a specific area of the screen. In cocoa it's pretty simple:
Code:
NSColor* pixelColor;
pixelColor = NSReadPixel( location );
My guess is that this function wraps around Quartz.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.