×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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!

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

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);

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources