Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void star_coord_to_pixel(struct star const* s, struct image* const img, int* x, int* y)
- {
- *x = (int)(((s->x + 1.0) / 2.0) * (img->w - 1));
- *y = (int)((((s->y * -1.0) + 1.0) / 2.0) * (img->h - 1));
- }
- void star_plot(struct star const* s, struct image* img)
- {
- *(img->data + (img->w * (int)(s->y) + (int)(s->x))) = 0xffffffff;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement