display.h 898 B

1234567891011121314151617181920212223242526272829
  1. #ifndef DISPLAY_H
  2. #define DISPLAY_H
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <math.h>
  6. #include <stdint.h>
  7. struct Position {
  8. int x;
  9. int y;
  10. };
  11. struct Pixel {
  12. unsigned r;
  13. unsigned g;
  14. unsigned b;
  15. };
  16. // Fills PPM/mandelbrot.ppm with the red values inside the pixels matrix.
  17. void mandelbrot_graph(char *filename, int *pixels, unsigned width, unsigned height);
  18. void mandelbrot_graph_transpose(char *filename, int64_t *pixels, unsigned width, unsigned height);
  19. void pixels_print(int *pixels, unsigned width, unsigned height);
  20. void nbody_print(double *array, unsigned nbr_planets);
  21. void nbody_graph(char *filename, double *positions, unsigned nbr_planets, unsigned width, unsigned height, double min_val, double max_val);
  22. void nbody_graph_transpose(char *filename, double *positions, unsigned nbr_planets, unsigned width, unsigned height, double min_val, double max_val);
  23. #endif