Find pixel coordinates by color

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Locked
Maxiime
Posts: 18
Joined: Thu Jun 19, 2008 11:34 pm

Find pixel coordinates by color

Post by Maxiime »

Hello.

I searched here, and i found nothing.

I'm trying to find a function that gets the x and y coordinates of a RED pixel on screen. Is there any function ?

Tnx.
(If no: do you know another way to do it?)
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Must... resist... urge... to... flame...

We don't teach baby-programming here.

DAMN! And I was trying so hard!
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

you must do this way:
1)search with your eyes a red dot
2)take a ruler and measure its distance from left bound
3)take the ruler and measure red dot's distance from upper bound
4) TADA!!!!

alternatively repeat steps 2,3 without the ruler but with a magnifying lens counting pixels from left and up borders...

[warning: if you've taken me seriously, then you need sanitary help right now...]
Maxiime
Posts: 18
Joined: Thu Jun 19, 2008 11:34 pm

Post by Maxiime »

Euhmm, who is here the baby? YOU not me.

I was just asking if there was any function.

I KNOW that i can do it with the graphics library and a FOR loop.

So again:

I'm trying to find a function that gets the x and y coordinates of a RED pixel on screen. Is there any function ?

PS:this is not a forum for baby spammers
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Don't try to be the sarchastic star of your movie, dude: sarchasm is for people who know what they're doing. Every crap of a programmer under the sun wouldn't expect to find an idiot-fuction like that you need (max 4 lines i guess). And if so, he would launch a search for some buzzwords in the "doc" folder of pspsdk. Maybe i and J.F. have bad mood most of the time but surely aren't babies, neither professionally or personally, and i personally act this way because having studied for decades to do what i do, i _hate_ babies that want to build a spaceship ignoring what a bicicle is. Believe me, ugly way to start...
kralyk
Posts: 114
Joined: Sun Apr 06, 2008 8:18 pm
Location: Czech Republic, central EU

Post by kralyk »

Hey Maxiime even if that function existed in sdk (I dont think it actually exists) how do you think that function would go?
If theres an aray of pixels, using for-cycle-or-something-similar method is the only way. It cant be any more simple nor efficient.
So why dont you just go and code it yourself?

Oh and also: there are probably more than one red pixels ... or there might be none as well.
Why the hell do you need coords of one red pixel anyway?
rapso
Posts: 140
Joined: Mon Mar 28, 2005 6:35 am

Post by rapso »

J.F. wrote:Must... resist... urge... to... flame...

We don't teach baby-programming here.

DAMN! And I was trying so hard!
oh com'on, I know it's hard but you could be a little bit more helpful.
There is of course a function, it's called "getRedPixel".
Locked