# op_c.h File Reference

`#include "struct.h"`

## Data Structures
struct | Table_conversion
struct | Table_occurence
struct | Cluster
struct | ClusterSet
struct | Degrade
struct | DegradeSet
## Typedefs
typedef struct Composantes * | Bitmap24B
typedef byte * | Bitmap256
## Functions
Table_conversion * | TC_New (int nbb_r, int nbb_v, int nbb_b)
void | TC_Delete (Table_conversion *t)
byte | TC_Get (Table_conversion *t, int r, int v, int b)
void | TC_Set (Table_conversion *t, int r, int v, int b, byte i)
void | RGBtoHSL (int r, int v, int b, byte *h, byte *s, byte *l)
void | HSLtoRGB (byte h, byte s, byte l, byte *r, byte *g, byte *b)
void | TO_Init (Table_occurence *t)
Table_occurence * | TO_New (int nbb_r, int nbb_v, int nbb_b)
void | TO_Delete (Table_occurence *t)
int | TO_Get (Table_occurence *t, int r, int v, int b)
void | TO_Set (Table_occurence *t, int r, int v, int b, int i)
void | TO_Inc (Table_occurence *t, int r, int v, int b)
void | TO_Compter_occurences (Table_occurence *t, Bitmap24B image, int taille)
void | Cluster_Analyser (Cluster *c, Table_occurence *to)
void | Cluster_Split (Cluster *c, Cluster *c1, Cluster *c2, int teinte, Table_occurence *to)
void | Cluster_Calculer_teinte (Cluster *c, Table_occurence *to)
void | CS_Init (ClusterSet *cs, Table_occurence *to)
ClusterSet * | CS_New (int nbmax, Table_occurence *to)
void | CS_Delete (ClusterSet *cs)
void | CS_Get (ClusterSet *cs, Cluster *c)
void | CS_Set (ClusterSet *cs, Cluster *c)
void | CS_Generer (ClusterSet *cs, Table_occurence *to)
void | CS_Calculer_teintes (ClusterSet *cs, Table_occurence *to)
void | CS_Generer_TC_et_Palette (ClusterSet *cs, Table_conversion *tc, struct Composantes *palette)
void | DS_Init (DegradeSet *ds, ClusterSet *cs)
DegradeSet * | DS_New (ClusterSet *cs)
void | DS_Delete (DegradeSet *ds)
void | DS_Generer (DegradeSet *ds, ClusterSet *cs)
int | Convert_bitmap_24B_to_256 (Bitmap256 Dest, Bitmap24B Source, int largeur, int hauteur, struct Composantes *palette)

## Typedef Documentation

typedef struct Composantes* Bitmap24B

typedef byte* Bitmap256

## Function Documentation

Table_conversion* TC_New | ( | int | nbb_r,
|  | int | nbb_v,
|  | int | nbb_b |
| ) |  |  |

References Table_conversion::dec_b, Table_conversion::dec_r, Table_conversion::dec_v, Table_conversion::nbb_b, Table_conversion::nbb_r, Table_conversion::nbb_v, Table_conversion::red_b, Table_conversion::red_r, Table_conversion::red_v, Table_conversion::rng_b, Table_conversion::rng_r, Table_conversion::rng_v, and Table_conversion::table.

Referenced by Optimiser_palette().

void TC_Delete | ( | Table_conversion * | t | ) |

References Table_conversion::table.

Referenced by Convert_bitmap_24B_to_256(), and Optimiser_palette().

byte TC_Get | ( | Table_conversion * | t,
|  | int | r,
|  | int | v,
|  | int | b |
| ) |  |  |

References Table_conversion::dec_b, Table_conversion::dec_r, Table_conversion::dec_v, Table_conversion::red_b, Table_conversion::red_r, Table_conversion::red_v, and Table_conversion::table.

Referenced by Convert_bitmap_24B_to_256_Floyd_Steinberg().

void TC_Set | ( | Table_conversion * | t,
|  | int | r,
|  | int | v,
|  | int | b,
|  | byte | i |
| ) |  |  |

References Table_conversion::dec_b, Table_conversion::dec_r, Table_conversion::dec_v, and Table_conversion::table.

Referenced by CS_Generer_TC_et_Palette().

void RGBtoHSL | ( | int | r,
|  | int | v,
|  | int | b,
|  | byte * | h,
|  | byte * | s,
|  | byte * | l |
| ) |  |  |

Referenced by Afficher_les_jauges(), Bouton_Palette(), Cluster_Calculer_teinte(), Modifier_HSL(), and Palette_Reafficher_jauges().

void HSLtoRGB | ( | byte | h,
|  | byte | s,
|  | byte | l,
|  | byte * | r,
|  | byte * | g,
|  | byte * | b |
| ) |  |  |

Referenced by Bouton_Palette(), and Modifier_HSL().

void TO_Init | ( | Table_occurence * | t | ) |

References Table_occurence::rng_b, Table_occurence::rng_r, Table_occurence::rng_v, and Table_occurence::table.

Referenced by TO_New().

Table_occurence* TO_New | ( | int | nbb_r,
|  | int | nbb_v,
|  | int | nbb_b |
| ) |  |  |

References Table_occurence::dec_b, Table_occurence::dec_r, Table_occurence::dec_v, Table_occurence::nbb_b, Table_occurence::nbb_r, Table_occurence::nbb_v, Table_occurence::red_b, Table_occurence::red_r, Table_occurence::red_v, Table_occurence::rng_b, Table_occurence::rng_r, Table_occurence::rng_v, Table_occurence::table, and TO_Init().

Referenced by Optimiser_palette().

void TO_Delete | ( | Table_occurence * | t | ) |

References Table_occurence::table.

Referenced by Optimiser_palette().

int TO_Get | ( | Table_occurence * | t,
|  | int | r,
|  | int | v,
|  | int | b |
| ) |  |  |

References Table_occurence::dec_b, Table_occurence::dec_r, Table_occurence::dec_v, and Table_occurence::table.

Referenced by Cluster_Calculer_teinte().

void TO_Set | ( | Table_occurence * | t,
|  | int | r,
|  | int | v,
|  | int | b,
|  | int | i |
| ) |  |  |

References Table_occurence::dec_b, Table_occurence::dec_r, Table_occurence::dec_v, Table_occurence::red_b, Table_occurence::red_r, Table_occurence::red_v, and Table_occurence::table.

void TO_Inc | ( | Table_occurence * | t,
|  | int | r,
|  | int | v,
|  | int | b |
| ) |  |  |

References Table_occurence::dec_b, Table_occurence::dec_r, Table_occurence::dec_v, Table_occurence::red_b, Table_occurence::red_r, Table_occurence::red_v, and Table_occurence::table.

Referenced by TO_Compter_occurences().

void TO_Compter_occurences | ( | Table_occurence * | t,
|  | Bitmap24B | image,
|  | int | taille |
| ) |  |  |

References TO_Inc().

Referenced by Optimiser_palette().

void Cluster_Analyser | ( | Cluster * | c,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster::bmax, Cluster::bmin, Cluster::occurences, Cluster::plus_large, Cluster::rmax, Cluster::rmin, Table_occurence::table, Cluster::vmax, and Cluster::vmin.

Referenced by CS_Generer(), and CS_Init().

void Cluster_Split | ( | Cluster * | c,
|  | Cluster * | c1,
|  | Cluster * | c2,
|  | int | teinte,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster::bmax, Cluster::Bmax, Cluster::Bmin, Cluster::bmin, Cluster::occurences, Cluster::rmax, Cluster::Rmax, Cluster::Rmin, Cluster::rmin, Table_occurence::table, Cluster::vmax, Cluster::Vmax, Cluster::Vmin, and Cluster::vmin.

Referenced by CS_Generer().

void Cluster_Calculer_teinte | ( | Cluster * | c,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster::b, Cluster::bmin, Cluster::h, Cluster::l, Cluster::occurences, Cluster::r, Table_occurence::red_b, Table_occurence::red_r, Table_occurence::red_v, RGBtoHSL(), Cluster::rmin, TO_Get(), Cluster::v, and Cluster::vmin.

Referenced by CS_Calculer_teintes().

void CS_Init | ( | ClusterSet * | cs,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster::bmax, Cluster::Bmax, Cluster::bmin, Cluster::Bmin, Cluster_Analyser(), ClusterSet::clusters, ClusterSet::nb, Cluster::rmax, Cluster::Rmax, Cluster::rmin, Cluster::Rmin, Table_occurence::rng_b, Table_occurence::rng_r, Table_occurence::rng_v, Cluster::vmax, Cluster::Vmax, Cluster::vmin, and Cluster::Vmin.

Referenced by CS_New().

ClusterSet* CS_New | ( | int | nbmax,
|  | Table_occurence * | to |
| ) |  |  |

References ClusterSet::clusters, CS_Init(), ClusterSet::nbmax, and TO_Compter_couleurs().

Referenced by Optimiser_palette().

void CS_Delete | ( | ClusterSet * | cs | ) |

References ClusterSet::clusters.

Referenced by Optimiser_palette().

void CS_Get | ( | ClusterSet * | cs,
|  | Cluster * | c |
| ) |  |  |

References Cluster::bmax, Cluster::bmin, ClusterSet::clusters, ClusterSet::nb, Cluster::rmax, Cluster::rmin, Cluster::vmax, and Cluster::vmin.

Referenced by CS_Generer().

void CS_Set | ( | ClusterSet * | cs,
|  | Cluster * | c |
| ) |  |  |

References ClusterSet::clusters, ClusterSet::nb, and Cluster::occurences.

Referenced by CS_Generer().

void CS_Generer | ( | ClusterSet * | cs,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster_Analyser(), Cluster_Split(), CS_Get(), CS_Set(), ClusterSet::nb, ClusterSet::nbmax, Cluster::occurences, and Cluster::plus_large.

Referenced by Optimiser_palette().

void CS_Calculer_teintes | ( | ClusterSet * | cs,
|  | Table_occurence * | to |
| ) |  |  |

References Cluster_Calculer_teinte(), and ClusterSet::clusters.

Referenced by Optimiser_palette().

void CS_Generer_TC_et_Palette | ( | ClusterSet * | cs,
|  | Table_conversion * | tc,
|  | struct Composantes * | palette |
| ) |  |  |

References Cluster::b, Cluster::Bmin, ClusterSet::clusters, ClusterSet::nb, Cluster::r, Cluster::Rmin, TC_Set(), Cluster::v, and Cluster::Vmin.

Referenced by Optimiser_palette().

void DS_Init | ( | DegradeSet * | ds,
|  | ClusterSet * | cs |
| ) |  |  |

References ClusterSet::clusters, DegradeSet::degrades, Cluster::h, Degrade::hue, Degrade::max, Degrade::min, DegradeSet::nb, and Degrade::nbcouleurs.

Referenced by DS_New().

DegradeSet* DS_New | ( | ClusterSet * | cs | ) |

References DegradeSet::degrades, DS_Init(), ClusterSet::nbmax, and DegradeSet::nbmax.

Referenced by Optimiser_palette().

void DS_Delete | ( | DegradeSet * | ds | ) |

References DegradeSet::degrades.

Referenced by Optimiser_palette().

void DS_Generer | ( | DegradeSet * | ds,
|  | ClusterSet * | cs |
| ) |  |  |

References ClusterSet::clusters, DegradeSet::degrades, Cluster::h, Degrade::hue, Degrade::max, Degrade::min, DegradeSet::nb, ClusterSet::nb, and Degrade::nbcouleurs.

Referenced by Optimiser_palette().

int Convert_bitmap_24B_to_256 | ( | Bitmap256 | Dest,
|  | Bitmap24B | Source,
|  | int | largeur,
|  | int | hauteur,
|  | struct Composantes * | palette |
| ) |  |  |

References Convert_bitmap_24B_to_256_Floyd_Steinberg(), Optimiser_palette(), precision_24b, and TC_Delete().

Referenced by Charger_image().