| Bsoft 1.9 Bernard's software package

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Classes | Macros | Typedefs | Functions
jquant2.c File Reference
`#include "jinclude.h"`
`#include "jpeglib.h"`

Go to the source code of this file.

## Classes
struct | my_cquantizer
struct | box

## Macros
#define | JPEG_INTERNALS
#define | R_SCALE 2 /* scale R distances by this much */
#define | G_SCALE 3 /* scale G distances by this much */
#define | B_SCALE 1 /* and B by this much */
#define | C0_SCALE R_SCALE
#define | C1_SCALE G_SCALE
#define | C2_SCALE B_SCALE
#define | MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */
#define | HIST_C0_BITS 5 /* bits of precision in R/B histogram */
#define | HIST_C1_BITS 6 /* bits of precision in G histogram */
#define | HIST_C2_BITS 5 /* bits of precision in B/R histogram */
#define | HIST_C0_ELEMS (1<<HIST_C0_BITS)
#define | HIST_C1_ELEMS (1<<HIST_C1_BITS)
#define | HIST_C2_ELEMS (1<<HIST_C2_BITS)
#define | C0_SHIFT (BITS_IN_JSAMPLE-HIST_C0_BITS)
#define | C1_SHIFT (BITS_IN_JSAMPLE-HIST_C1_BITS)
#define | C2_SHIFT (BITS_IN_JSAMPLE-HIST_C2_BITS)
#define | BOX_C0_LOG (HIST_C0_BITS-3)
#define | BOX_C1_LOG (HIST_C1_BITS-3)
#define | BOX_C2_LOG (HIST_C2_BITS-3)
#define | BOX_C0_ELEMS (1<<BOX_C0_LOG) /* # of hist cells in update box */
#define | BOX_C1_ELEMS (1<<BOX_C1_LOG)
#define | BOX_C2_ELEMS (1<<BOX_C2_LOG)
#define | BOX_C0_SHIFT (C0_SHIFT + BOX_C0_LOG)
#define | BOX_C1_SHIFT (C1_SHIFT + BOX_C1_LOG)
#define | BOX_C2_SHIFT (C2_SHIFT + BOX_C2_LOG)
#define | STEP_C0 ((1 << C0_SHIFT) * C0_SCALE)
#define | STEP_C1 ((1 << C1_SHIFT) * C1_SCALE)
#define | STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)
#define | STEPSIZE ((MAXJSAMPLE+1)/16)

## Typedefs
typedef UINT16 | histcell
typedef histcell FAR * | histptr
typedef histcell | hist1d[HIST_C2_ELEMS]
typedef hist1d FAR * | hist2d
typedef hist2d * | hist3d
typedef INT16 | FSERROR
typedef int | LOCFSERROR
typedef FSERROR FAR * | FSERRPTR
typedef my_cquantizer * | my_cquantize_ptr
typedef box * | boxptr

## Functions
| prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
| find_biggest_color_pop (boxptr boxlist, int numboxes)
| find_biggest_volume (boxptr boxlist, int numboxes)
| update_box (j_decompress_ptr cinfo, boxptr boxp)
| median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, int desired_colors)
| compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor)
| select_colors (j_decompress_ptr cinfo, int desired_colors)
| find_nearby_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, JSAMPLE colorlist[])
| find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2, int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[])
| fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
| pass2_no_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
| pass2_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
| init_error_limit (j_decompress_ptr cinfo)
| finish_pass1 (j_decompress_ptr cinfo)
| finish_pass2 (j_decompress_ptr cinfo)
| start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
| new_color_map_2_quant (j_decompress_ptr cinfo)
| jinit_2pass_quantizer (j_decompress_ptr cinfo)

## Macro Definition Documentation

#define B_SCALE 1 /* and B by this much */

Definition at line 75 of file jquant2.c.

#define BOX_C0_ELEMS (1<<BOX_C0_LOG) /* # of hist cells in update box */

Definition at line 628 of file jquant2.c.

#define BOX_C0_LOG (HIST_C0_BITS-3)

Definition at line 624 of file jquant2.c.

#define BOX_C0_SHIFT (C0_SHIFT + BOX_C0_LOG)

Definition at line 632 of file jquant2.c.

#define BOX_C1_ELEMS (1<<BOX_C1_LOG)

Definition at line 629 of file jquant2.c.

#define BOX_C1_LOG (HIST_C1_BITS-3)

Definition at line 625 of file jquant2.c.

#define BOX_C1_SHIFT (C1_SHIFT + BOX_C1_LOG)

Definition at line 633 of file jquant2.c.

#define BOX_C2_ELEMS (1<<BOX_C2_LOG)

Definition at line 630 of file jquant2.c.

#define BOX_C2_LOG (HIST_C2_BITS-3)

Definition at line 626 of file jquant2.c.

#define BOX_C2_SHIFT (C2_SHIFT + BOX_C2_LOG)

Definition at line 634 of file jquant2.c.

#define C0_SCALE R_SCALE

Definition at line 85 of file jquant2.c.

#define C0_SHIFT (BITS_IN_JSAMPLE-HIST_C0_BITS)

Definition at line 142 of file jquant2.c.

#define C1_SCALE G_SCALE

Definition at line 91 of file jquant2.c.

#define C1_SHIFT (BITS_IN_JSAMPLE-HIST_C1_BITS)

Definition at line 143 of file jquant2.c.

#define C2_SCALE B_SCALE

Definition at line 97 of file jquant2.c.

#define C2_SHIFT (BITS_IN_JSAMPLE-HIST_C2_BITS)

Definition at line 144 of file jquant2.c.

#define G_SCALE 3 /* scale G distances by this much */

Definition at line 74 of file jquant2.c.

#define HIST_C0_BITS 5 /* bits of precision in R/B histogram */

Definition at line 132 of file jquant2.c.

#define HIST_C0_ELEMS (1<<HIST_C0_BITS)

Definition at line 137 of file jquant2.c.

#define HIST_C1_BITS 6 /* bits of precision in G histogram */

Definition at line 133 of file jquant2.c.

#define HIST_C1_ELEMS (1<<HIST_C1_BITS)

Definition at line 138 of file jquant2.c.

#define HIST_C2_BITS 5 /* bits of precision in B/R histogram */

Definition at line 134 of file jquant2.c.

#define HIST_C2_ELEMS (1<<HIST_C2_BITS)

Definition at line 139 of file jquant2.c.

#define JPEG_INTERNALS

Definition at line 20 of file jquant2.c.

#define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */

Definition at line 127 of file jquant2.c.

#define R_SCALE 2 /* scale R distances by this much */

Definition at line 73 of file jquant2.c.

#define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE)

#define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE)

#define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE)

#define STEPSIZE ((MAXJSAMPLE+1)/16)

## Typedef Documentation

typedef box* boxptr

Definition at line 269 of file jquant2.c.

typedef INT16 FSERROR

Definition at line 181 of file jquant2.c.

typedef FSERROR FAR* FSERRPTR

Definition at line 188 of file jquant2.c.

typedef histcell hist1d[HIST_C2_ELEMS]

Definition at line 151 of file jquant2.c.

typedef hist1d FAR* hist2d

Definition at line 152 of file jquant2.c.

typedef hist2d* hist3d

Definition at line 153 of file jquant2.c.

typedef UINT16 histcell

Definition at line 147 of file jquant2.c.

typedef histcell FAR* histptr

Definition at line 149 of file jquant2.c.

typedef int LOCFSERROR

Definition at line 182 of file jquant2.c.

typedef my_cquantizer* my_cquantize_ptr

Definition at line 211 of file jquant2.c.

## Function Documentation

compute_color | ( | j_decompress_ptr | cinfo,
|  | boxptr | boxp,
|  | int | icolor
| ) |  |

Definition at line 499 of file jquant2.c.

fill_inverse_cmap | ( | j_decompress_ptr | cinfo,
|  | int | c0,
|  | int | c1,
|  | int | c2
| ) |  |

Definition at line 855 of file jquant2.c.

find_best_colors | ( | j_decompress_ptr | cinfo,
|  | int | minc0,
|  | int | minc1,
|  | int | minc2,
|  | int | numcolors,
|  | JSAMPLE | colorlist[],
|  | JSAMPLE | bestcolor[]
| ) |  |

Definition at line 775 of file jquant2.c.

find_biggest_color_pop | ( | boxptr | boxlist,
|  | int | numboxes
| ) |  |

Definition at line 273 of file jquant2.c.

find_biggest_volume | ( | boxptr | boxlist,
|  | int | numboxes
| ) |  |

Definition at line 293 of file jquant2.c.

find_nearby_colors | ( | j_decompress_ptr | cinfo,
|  | int | minc0,
|  | int | minc1,
|  | int | minc2,
|  | JSAMPLE | colorlist[]
| ) |  |

Definition at line 646 of file jquant2.c.

finish_pass1 | ( | j_decompress_ptr | cinfo | ) |

Definition at line 1143 of file jquant2.c.

finish_pass2 | ( | j_decompress_ptr | cinfo | ) |

Definition at line 1156 of file jquant2.c.

init_error_limit | ( | j_decompress_ptr | cinfo | ) |

Definition at line 1108 of file jquant2.c.

jinit_2pass_quantizer | ( | j_decompress_ptr | cinfo | ) |

Definition at line 1244 of file jquant2.c.

median_cut | ( | j_decompress_ptr | cinfo,
|  | boxptr | boxlist,
|  | int | numboxes,
|  | int | desired_colors
| ) |  |

Definition at line 424 of file jquant2.c.

new_color_map_2_quant | ( | j_decompress_ptr | cinfo | ) |

Definition at line 1230 of file jquant2.c.

pass2_fs_dither | ( | j_decompress_ptr | cinfo,
|  | JSAMPARRAY | input_buf,
|  | JSAMPARRAY | output_buf,
|  | int | num_rows
| ) |  |

Definition at line 949 of file jquant2.c.

pass2_no_dither | ( | j_decompress_ptr | cinfo,
|  | JSAMPARRAY | input_buf,
|  | JSAMPARRAY | output_buf,
|  | int | num_rows
| ) |  |

Definition at line 915 of file jquant2.c.

prescan_quantize | ( | j_decompress_ptr | cinfo,
|  | JSAMPARRAY | input_buf,
|  | JSAMPARRAY | output_buf,
|  | int | num_rows
| ) |  |

Definition at line 224 of file jquant2.c.

select_colors | ( | j_decompress_ptr | cinfo,
|  | int | desired_colors
| ) |  |

Definition at line 539 of file jquant2.c.

start_pass_2_quant | ( | j_decompress_ptr | cinfo,
|  | boolean | is_pre_scan
| ) |  |

Definition at line 1167 of file jquant2.c.

update_box | ( | j_decompress_ptr | cinfo,
|  | boxptr | boxp
| ) |  |

Definition at line 313 of file jquant2.c.