Advertisement
Guest User

Untitled

a guest
May 24th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. void star_coord_to_pixel(struct star const* s, struct image* const img, int* x, int* y)
  2. {
  3. *x = (int)(((s->x + 1.0) / 2.0) * (img->w - 1));
  4. *y = (int)((((s->y * -1.0) + 1.0) / 2.0) * (img->h - 1));
  5. }
  6.  
  7. void star_plot(struct star const* s, struct image* img)
  8. {
  9. *(img->data + (img->w * (int)(s->y) + (int)(s->x))) = 0xffffffff;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement