# brush.c File Reference

`#include <math.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "global.h"`
`#include "graph.h"`
`#include "divers.h"`
`#include "erreurs.h"`
`#include "windows.h"`
`#include "sdlscreen.h"`

## Defines
#define | INDEFINI (-1.0e20F)
## Functions
void | Calculer_dimensions_clipees (short *X, short *Y, short *Largeur, short *Hauteur)
void | Calculer_dimensions_clipees_zoom (short *X, short *Y, short *Largeur, short *Hauteur)
void | Afficher_pinceau (short X, short Y, byte Couleur, byte Preview)
void | Effacer_pinceau (short X, short Y)
void | Capturer_brosse (short Debut_X, short Debut_Y, short Fin_X, short Fin_Y, short Effacement)
void | Rotate_90_deg ()
void | Remap_brosse (void)
void | Outline_brush (void)
void | Nibble_brush (void)
void | Capturer_brosse_au_lasso (int Vertices, short *Points, short Effacement)
void | Etirer_brosse (short X1, short Y1, short X2, short Y2)
void | Etirer_brosse_preview (short X1, short Y1, short X2, short Y2)
void | Interpoler_texture (int Debut_X, int Debut_Y, int Xt1, int Yt1, int Fin_X, int Fin_Y, int Xt2, int Yt2, int Hauteur)
void | Calculer_quad_texture (int X1, int Y1, int Xt1, int Yt1, int X2, int Y2, int Xt2, int Yt2, int X3, int Y3, int Xt3, int Yt3, int X4, int Y4, int Xt4, int Yt4, byte *Buffer, int Largeur, int Hauteur)
void | Tourner_brosse (float Angle)
void | Dessiner_quad_texture_preview (int X1, int Y1, int Xt1, int Yt1, int X2, int Y2, int Xt2, int Yt2, int X3, int Y3, int Xt3, int Yt3, int X4, int Y4, int Xt4, int Yt4)
void | Tourner_brosse_preview (float Angle)
## Variables
float * | ScanY_Xt [2]
float * | ScanY_Yt [2]
float * | ScanY_X [2]

## Define Documentation

#define INDEFINI (-1.0e20F)

Referenced by Calculer_quad_texture(), Dessiner_quad_texture_preview(), and Interpoler_texture().

## Function Documentation

void Calculer_dimensions_clipees | ( | short * | X,
|  | short * | Y,
|  | short * | Largeur,
|  | short * | Hauteur |
| ) |  |  |

References Limite_Bas, Limite_Droite, Limite_Gauche, and Limite_Haut.

Referenced by Afficher_pinceau(), and Effacer_pinceau().

void Calculer_dimensions_clipees_zoom | ( | short * | X,
|  | short * | Y,
|  | short * | Largeur,
|  | short * | Hauteur |
| ) |  |  |

References Limite_Bas_Zoom, Limite_Droite_Zoom, Limite_Gauche_Zoom, and Limite_Haut_Zoom.

Referenced by Afficher_pinceau(), and Effacer_pinceau().

void Afficher_pinceau | ( | short | X,
|  | short | Y,
|  | byte | Couleur,
|  | byte | Preview |
| ) |  |  |

References Afficher_pixel(), Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Buffer_de_ligne_horizontale, Calculer_dimensions_clipees(), Calculer_dimensions_clipees_zoom(), Copier_une_partie_d_image_dans_une_autre(), Display_brush_Color, Display_brush_Color_zoom, Display_brush_Mono, Display_brush_Mono_zoom, Fore_color, FORME_PINCEAU_BROSSE_COULEUR, FORME_PINCEAU_BROSSE_MONOCHROME, FORME_PINCEAU_POINT, Hauteur, Largeur, Limite_Bas, Limite_Droite, Limite_Gauche, Limite_Haut, Lit_pixel_dans_brosse(), Lit_pixel_dans_ecran_courant(), Loupe_Decalage_X, Loupe_Decalage_Y, Loupe_Facteur, Loupe_Mode, Menu_Ordonnee, Mettre_Ecran_A_Jour(), Mouse_K, Pinceau_Decalage_X, Pinceau_Decalage_Y, Pinceau_Forme, Pinceau_Hauteur, Pinceau_Largeur, Pinceau_Sprite, Pinceau_X, Pinceau_Y, Pixel_Preview, Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, Fenetre_Bouton_scroller::Position, Principal_Decalage_X, Principal_Decalage_Y, Principal_Ecran, Principal_Largeur_image, Principal_X_Zoom, Shade_Table, Shade_Table_gauche, Smear_Brosse, Smear_Brosse_Largeur, Smear_Debut, Smear_Max_X, Smear_Max_Y, Smear_Min_X, Smear_Min_Y, Smear_Mode, and TAILLE_MAXI_PINCEAU.

Referenced by Aerographe(), Afficher_curseur(), Freehand_Mode1_1_0(), Freehand_Mode1_2_0(), Freehand_Mode2_1_0(), Freehand_Mode2_1_2(), Freehand_Mode2_2_0(), Freehand_Mode2_2_2(), Freehand_Mode3_1_0(), Freehand_Mode3_2_0(), K_Ligne_0_6(), Ligne_0_5(), Lignes_centrees_12_7(), Pixel_figure_Definitif(), Polyform_12_0(), and Tracer_rectangle_vide().

void Effacer_pinceau | ( | short | X,
|  | short | Y |
| ) |  |  |

References Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Buffer_de_ligne_horizontale, Calculer_dimensions_clipees(), Calculer_dimensions_clipees_zoom(), Clear_brush, Clear_brush_zoom, FORME_PINCEAU_BROSSE_COULEUR, FORME_PINCEAU_BROSSE_MONOCHROME, FORME_PINCEAU_POINT, Hauteur, Largeur, Limite_Bas, Limite_Droite, Limite_Gauche, Limite_Haut, Lit_pixel_dans_ecran_courant(), Loupe_Decalage_X, Loupe_Decalage_Y, Loupe_Facteur, Loupe_Mode, Menu_Ordonnee, Mettre_Ecran_A_Jour(), Mouse_K, Pinceau_Decalage_X, Pinceau_Decalage_Y, Pinceau_Forme, Pinceau_Hauteur, Pinceau_Largeur, Pinceau_Sprite, Pinceau_X, Pinceau_Y, Pixel_Preview, Principal_Decalage_X, Principal_Decalage_Y, Principal_Largeur_image, and Principal_X_Zoom.

Referenced by Effacer_curseur().

void Capturer_brosse | ( | short | Debut_X,
|  | short | Debut_Y,
|  | short | Fin_X,
|  | short | Fin_Y,
|  | short | Effacement |
| ) |  |  |

References Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Copier_image_dans_brosse(), Erreur, Fore_color, Mettre_Ecran_A_Jour(), Pixel_dans_ecran_courant(), Pixel_Preview, Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, Principal_Hauteur_image, Principal_Largeur_image, Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, TAILLE_MAXI_PINCEAU, Tiling_Decalage_X, and Tiling_Decalage_Y.

Referenced by Brosse_0_5(), and Initialisation_du_programme().

void Rotate_90_deg | ( | void |  | ) |

References Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Erreur, Rotate_90_deg_LOWLEVEL(), Smear_Brosse_Hauteur, and Smear_Brosse_Largeur.

Referenced by Bouton_Brush_FX(), and Gestion_principale().

void Remap_brosse | ( | void |  | ) |

References Back_color, Brosse, Brosse_Hauteur, Brosse_Largeur, Brouillon_Palette, Lit_pixel_dans_brosse(), Meilleure_couleur(), Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, and Remap_general_LOWLEVEL().

Referenced by Bouton_Brush_FX(), and Gestion_principale().

void Outline_brush | ( | void |  | ) |

References Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Copier_une_partie_d_image_dans_une_autre(), Erreur, Fore_color, Hauteur, Largeur, Pixel_dans_brosse(), Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, and TAILLE_MAXI_PINCEAU.

Referenced by Bouton_Brush_FX(), and Gestion_principale().

void Nibble_brush | ( | void |  | ) |

References Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Copier_une_partie_d_image_dans_une_autre(), Erreur, Hauteur, Largeur, Pixel_dans_brosse(), Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, and TAILLE_MAXI_PINCEAU.

Referenced by Bouton_Brush_FX(), and Gestion_principale().

void Capturer_brosse_au_lasso | ( | int | Vertices,
|  | short * | Points,
|  | short | Effacement |
| ) |  |  |

References Back_color, Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Erreur, Fore_color, Limite_Bas, Limite_Droite, Limite_Gauche, Limite_Haut, Lit_pixel_dans_brosse(), Lit_pixel_dans_ecran_courant(), Pixel_dans_brosse(), Pixel_dans_ecran_courant(), Pixel_figure, Pixel_figure_Dans_brosse(), Polyfill_General(), Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, Principal_Hauteur_image, Principal_Largeur_image, Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, TAILLE_MAXI_PINCEAU, Tiling_Decalage_X, Tiling_Decalage_Y, and Tracer_ligne_General().

Referenced by Polybrosse_12_8().

void Etirer_brosse | ( | short | X1,
|  | short | Y1,
|  | short | X2,
|  | short | Y2 |
| ) |  |  |

References Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Erreur, Lit_pixel_dans_brosse(), Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, and TAILLE_MAXI_PINCEAU.

Referenced by Etirer_brosse_2_7().

void Etirer_brosse_preview | ( | short | X1,
|  | short | Y1,
|  | short | X2,
|  | short | Y2 |
| ) |  |  |

References Back_color, Brosse_Hauteur, Brosse_Largeur, Limite_Gauche, Limite_Haut, Limite_visible_Bas, Limite_visible_Droite, Lit_pixel_dans_brosse(), Max(), Mettre_Ecran_A_Jour(), Min(), and Pixel_Preview.

Referenced by Etirer_brosse_0_7(), and Etirer_brosse_1_7().

void Interpoler_texture | ( | int | Debut_X,
|  | int | Debut_Y,
|  | int | Xt1,
|  | int | Yt1,
|  | int | Fin_X,
|  | int | Fin_Y,
|  | int | Xt2,
|  | int | Yt2,
|  | int | Hauteur |
| ) |  |  |

References INDEFINI, Fenetre_Bouton_scroller::Pos_X, Fenetre_Bouton_scroller::Pos_Y, ScanY_X, ScanY_Xt, and ScanY_Yt.

Referenced by Calculer_quad_texture(), and Dessiner_quad_texture_preview().

void Calculer_quad_texture | ( | int | X1,
|  | int | Y1,
|  | int | Xt1,
|  | int | Yt1,
|  | int | X2,
|  | int | Y2,
|  | int | Xt2,
|  | int | Yt2,
|  | int | X3,
|  | int | Y3,
|  | int | Xt3,
|  | int | Yt3,
|  | int | X4,
|  | int | Y4,
|  | int | Xt4,
|  | int | Yt4,
|  | byte * | Buffer,
|  | int | Largeur,
|  | int | Hauteur |
| ) |  |  |

References Back_color, INDEFINI, Interpoler_texture(), Lit_pixel_dans_brosse(), Min(), Round(), ScanY_X, ScanY_Xt, and ScanY_Yt.

Referenced by Tourner_brosse().

void Tourner_brosse | ( | float | Angle | ) |

References Brosse, Brosse_Decalage_X, Brosse_Decalage_Y, Brosse_Hauteur, Brosse_Largeur, Calculer_quad_texture(), Erreur, Max(), Min(), Smear_Brosse, Smear_Brosse_Hauteur, Smear_Brosse_Largeur, TAILLE_MAXI_PINCEAU, and Transformer_point().

Referenced by Tourner_brosse_2_5().

void Dessiner_quad_texture_preview | ( | int | X1,
|  | int | Y1,
|  | int | Xt1,
|  | int | Yt1,
|  | int | X2,
|  | int | Y2,
|  | int | Xt2,
|  | int | Yt2,
|  | int | X3,
|  | int | Y3,
|  | int | Xt3,
|  | int | Yt3,
|  | int | X4,
|  | int | Y4,
|  | int | Xt4,
|  | int | Yt4 |
| ) |  |  |

References Back_color, Hauteur, INDEFINI, Interpoler_texture(), Largeur, Limite_Bas, Limite_Droite, Limite_Gauche, Limite_Haut, Lit_pixel_dans_brosse(), Max(), Min(), Pixel_Preview, Round(), ScanY_X, ScanY_Xt, and ScanY_Yt.

Referenced by Tourner_brosse_preview().

void Tourner_brosse_preview | ( | float | Angle | ) |

References Brosse_Centre_rotation_X, Brosse_Centre_rotation_Y, Brosse_Hauteur, Brosse_Largeur, Dessiner_quad_texture_preview(), Max(), Mettre_Ecran_A_Jour(), Min(), and Transformer_point().

Referenced by Tourner_brosse_0_5(), and Tourner_brosse_1_5().

## Variable Documentation

float* ScanY_Xt[2]

Referenced by Calculer_quad_texture(), Dessiner_quad_texture_preview(), and Interpoler_texture().

float* ScanY_Yt[2]

Referenced by Calculer_quad_texture(), Dessiner_quad_texture_preview(), and Interpoler_texture().

float* ScanY_X[2]

Referenced by Calculer_quad_texture(), Dessiner_quad_texture_preview(), and Interpoler_texture().