PDA

View Full Version : pixel information?




timprogrammer
Feb 7, 2007, 05:29 AM
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
Feb 7, 2007, 09:26 PM
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: NSColor* pixelColor;
pixelColor = NSReadPixel( location ); My guess is that this function wraps around Quartz.