Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need method to create 640*480 random data @ 60 Hz and update to scr.

Status
Not open for further replies.

holydragon

Electrical
Joined
Jan 30, 2003
Messages
5
Need method to create 640*480 random data @ 60 Hz and update to scr.

I have been working with this problem for the last few days. I'm simply trying to create an array fo 640X480 randomly shaded pixels and update them to a display (or mask with another array) at the rate of 60 Hz. The video is to be continuous and unique. Any ideas on completing this would be helpful!

Best Regards!
 
Hi !

Do you think this is quick enough. I think it takes a while to repeat itself. The value for the seed is not really important.

/* Generate pseudo randon numbers for video: */

#define MAX_PIX 256
static double seed = 0.6287393495854736252536643784327L;

/*... */

int pixle;

seed = seed * 147.0;
seed = seed - (int)seed;
pixle = (int)(seed * MAX_PIX);

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top