display.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  4. * Copyright (C) 2019 Mael Keryell
  5. *
  6. * StarPU is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU Lesser General Public License as published by
  8. * the Free Software Foundation; either version 2.1 of the License, or (at
  9. * your option) any later version.
  10. *
  11. * StarPU is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. */
  17. #ifndef DISPLAY_H
  18. #define DISPLAY_H
  19. #include <stdio.h>
  20. #include <stdlib.h>
  21. #include <math.h>
  22. #include <stdint.h>
  23. struct Position {
  24. int x;
  25. int y;
  26. };
  27. struct Pixel {
  28. unsigned r;
  29. unsigned g;
  30. unsigned b;
  31. };
  32. // Fills PPM/mandelbrot.ppm with the red values inside the pixels matrix.
  33. void mandelbrot_graph(char *filename, int *pixels, unsigned width, unsigned height);
  34. void mandelbrot_graph_transpose(char *filename, int64_t *pixels, unsigned width, unsigned height);
  35. void pixels_print(int *pixels, unsigned width, unsigned height);
  36. void nbody_print(double *array, unsigned nbr_planets);
  37. void nbody_graph(char *filename, double *positions, unsigned nbr_planets, unsigned width, unsigned height, double min_val, double max_val);
  38. void nbody_graph_transpose(char *filename, double *positions, unsigned nbr_planets, unsigned width, unsigned height, double min_val, double max_val);
  39. #endif