Files
DSP/plot/plot_constellation.h
2025-09-30 13:31:59 +02:00

36 lines
989 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef PLOT_CONSTELLATION_H
#define PLOT_CONSTELLATION_H
#include <complex.h>
#include <SDL2/SDL.h>
typedef struct {
SDL_Window *window;
SDL_Renderer *renderer;
int width;
int height;
double scale;
double offset_x;
double offset_y;
} plot_t;
// Initialiser SDL et la fenêtre
void plot_init(plot_t *plot, int width, int height, double scale);
// Dessiner la constellation (grille de départ)
void plot_draw_constellation(plot_t *plot, double complex **constellation, int M);
// Dessiner un tableau de points complexes
void plot_draw_points(plot_t *plot, double complex *points, int nb_points, SDL_Color color);
// Dessiner les points progressivement avec animation
// delay_ms = délai entre chaque point en millisecondes
// Keypress pendant animation coupe lanimation
void plot_draw_points_animated(plot_t *plot, double complex *points, int nb_points, SDL_Color color, int delay_ms);
// Fermer SDL proprement
void plot_close(plot_t *plot);
#endif