Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Getting individual RGB values for a pixel on screen
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smool




PostPosted: Fri Jan 13, 2012 11:12 pm   Post subject: Getting individual RGB values for a pixel on screen

Is there a way to get the individual RGB values of a pixel on screen?
I know of What.Color, but that only returns 1 integer, and i need the 3 seperate RGB values
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Sat Jan 14, 2012 12:30 am   Post subject: RE:Getting individual RGB values for a pixel on screen

If you know the colour index, then you can get the red/green/blue values by using RGB.GetColor : http://compsci.ca/holtsoft/doc/rgb_getcolor.html
mirhagk




PostPosted: Sat Jan 14, 2012 10:06 am   Post subject: RE:Getting individual RGB values for a pixel on screen

Specifically you'd do something like:

Turing:

var red:int
var green:int
var blue:int
RGB.GetColor(whatdotcolor(x,y),red,green,blue)
smool




PostPosted: Sat Jan 14, 2012 11:45 am   Post subject: RE:Getting individual RGB values for a pixel on screen

Sweet thanks
mirhagk




PostPosted: Sat Jan 14, 2012 12:26 pm   Post subject: RE:Getting individual RGB values for a pixel on screen

May I ask what you are doing this for? Working with RGB values implies some high quality graphical work, which turing may not be able to handle.
Dreadnought




PostPosted: Sat Jan 14, 2012 1:52 pm   Post subject: Re: Getting individual RGB values for a pixel on screen

It should be noted that whatdotcolour does not return the exact colour of a pixels on screen. It actually returns an approximation to one of the Turing colours (the 248 of them).

Depending on what you're doing this may or may not bother you.

If it does, here's a tutorial that allows you to get the actual RGB values of a pixel. http://compsci.ca/v3/viewtopic.php?t=29867
smool




PostPosted: Sun Jan 15, 2012 12:50 pm   Post subject: RE:Getting individual RGB values for a pixel on screen

Thanks for the link Dreadnought, I didn't know whatdotcolour did that, that's useful.

mirhagk, basically I would just like to try supersampling. Only for on image, as there is no way turing could pull off supersampling or even multisampling at even a semi decent frame rate.
mirhagk




PostPosted: Sun Jan 15, 2012 9:41 pm   Post subject: RE:Getting individual RGB values for a pixel on screen

Do you perhaps know any other languages? I could get you started with the bare minimum needed to load in a picture and draw it to the screen in C# with XNA, and you could actually try to do it in the shader. Although that might be difficult.
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: