w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libppm3.c File Reference
#include "ppm.h"
#include "ppmcmap.h"
#include "libppm.h"
Include dependency graph for libppm3.c:

Go to the source code of this file.

Macros

#define HASH_SIZE   20023
 
#define ppm_hashpixel(p)   ( ( ( (long) PPM_GETR(p) * 33023 + (long) PPM_GETG(p) * 30013 + (long) PPM_GETB(p) * 27011 ) & 0x7fffffff ) % HASH_SIZE )
 

Functions

colorhist_vector ppm_computecolorhist (pixel **pixels, int cols, int rows, int maxcolors, int *colorsP)
 
void ppm_addtocolorhist (colorhist_vector chv, int *colorsP, int maxcolors, pixel *colorP, int value, int position)
 
colorhash_table ppm_computecolorhash (pixel **pixels, int cols, int rows, int maxcolors, int *colorsP)
 
colorhash_table ppm_alloccolorhash ()
 
int ppm_addtocolorhash (colorhash_table cht, pixel *colorP, int value)
 
colorhist_vector ppm_colorhashtocolorhist (colorhash_table cht, int maxcolors)
 
colorhash_table ppm_colorhisttocolorhash (colorhist_vector chv, int colors)
 
int ppm_lookupcolor (colorhash_table cht, pixel *colorP)
 
void ppm_freecolorhist (colorhist_vector chv)
 
void ppm_freecolorhash (colorhash_table cht)
 

Macro Definition Documentation

◆ HASH_SIZE

#define HASH_SIZE   20023

Definition at line 19 of file libppm3.c.

◆ ppm_hashpixel

#define ppm_hashpixel (   p)    ( ( ( (long) PPM_GETR(p) * 33023 + (long) PPM_GETG(p) * 30013 + (long) PPM_GETB(p) * 27011 ) & 0x7fffffff ) % HASH_SIZE )

Definition at line 24 of file libppm3.c.

Function Documentation

◆ ppm_addtocolorhash()

int ppm_addtocolorhash ( colorhash_table  cht,
pixel colorP,
int  value 
)

◆ ppm_addtocolorhist()

void ppm_addtocolorhist ( colorhist_vector  chv,
int colorsP,
int  maxcolors,
pixel colorP,
int  value,
int  position 
)

Definition at line 45 of file libppm3.c.

References colorhist_item::color, i, j, maxcolors, position, PPM_EQUAL, and colorhist_item::value.

Referenced by convertpnm(), and main().

◆ ppm_alloccolorhash()

colorhash_table ppm_alloccolorhash ( )

Definition at line 128 of file libppm3.c.

References cht, HASH_SIZE, i, malloc, and pm_error.

Referenced by main(), ppm_colorhisttocolorhash(), and ppm_computecolorhash().

◆ ppm_colorhashtocolorhist()

colorhist_vector ppm_colorhashtocolorhist ( colorhash_table  cht,
int  maxcolors 
)

Definition at line 164 of file libppm3.c.

References colorhist_list_item::ch, cht, HASH_SIZE, i, j, malloc, maxcolors, colorhist_list_item::next, and pm_error.

Referenced by ppm_computecolorhist().

◆ ppm_colorhisttocolorhash()

◆ ppm_computecolorhash()

colorhash_table ppm_computecolorhash ( pixel**  pixels,
int  cols,
int  rows,
int  maxcolors,
int colorsP 
)

◆ ppm_computecolorhist()

colorhist_vector ppm_computecolorhist ( pixel**  pixels,
int  cols,
int  rows,
int  maxcolors,
int colorsP 
)

Definition at line 28 of file libppm3.c.

References cht, cols, maxcolors, ppm_colorhashtocolorhist(), ppm_computecolorhash(), ppm_freecolorhash(), and rows.

Referenced by convertpnm(), and main().

◆ ppm_freecolorhash()

void ppm_freecolorhash ( colorhash_table  cht)

Definition at line 249 of file libppm3.c.

References cht, free, HASH_SIZE, i, and colorhist_list_item::next.

Referenced by convertpnm(), do_std_body(), ppm_computecolorhash(), and ppm_computecolorhist().

◆ ppm_freecolorhist()

void ppm_freecolorhist ( colorhist_vector  chv)

Definition at line 242 of file libppm3.c.

References free.

Referenced by convertpnm(), and main().

◆ ppm_lookupcolor()