Main MRPT website > C++ reference for MRPT 1.9.9
Classes | Macros | Typedefs | Functions | Variables
jquant1.cpp File Reference
#include "jinclude.h"
#include "mrpt_jpeglib.h"
#include <mrpt/utils/mrpt_macros.h>

Go to the source code of this file.

Classes

struct  my_cquantizer
 

Macros

#define JPEG_INTERNALS
 
#define ODITHER_SIZE   16 /* dimension of dither matrix */
 
#define ODITHER_CELLS   (ODITHER_SIZE * ODITHER_SIZE) /* # cells in matrix */
 
#define ODITHER_MASK
 
#define MAX_Q_COMPS   4 /* max components I can handle */
 

Typedefs

typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]
 
typedef int(* ODITHER_MATRIX_PTR)[ODITHER_SIZE]
 
typedef INT16 FSERROR
 
typedef int LOCFSERROR
 
typedef FSERROR FARFSERRPTR
 
typedef my_cquantizermy_cquantize_ptr
 

Functions

 select_ncolors (j_decompress_ptr cinfo, int Ncolors[])
 
 output_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
 
 largest_input_value (j_decompress_ptr cinfo, int ci, int j, int maxj)
 
 create_colormap (j_decompress_ptr cinfo)
 
 create_colorindex (j_decompress_ptr cinfo)
 
 make_odither_array (j_decompress_ptr cinfo, int ncolors)
 
 create_odither_tables (j_decompress_ptr cinfo)
 
 color_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 color_quantize3 (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 quantize3_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows)
 
 alloc_fs_workspace (j_decompress_ptr cinfo)
 
 start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
 
 finish_pass_1_quant (j_decompress_ptr)
 
 new_color_map_1_quant (j_decompress_ptr cinfo)
 
 jinit_1pass_quantizer (j_decompress_ptr cinfo)
 

Variables

static const UINT8 base_dither_matrix [ODITHER_SIZE][ODITHER_SIZE]
 

Macro Definition Documentation

◆ JPEG_INTERNALS

#define JPEG_INTERNALS

Definition at line 10 of file jquant1.cpp.

◆ MAX_Q_COMPS

#define MAX_Q_COMPS   4 /* max components I can handle */

Definition at line 135 of file jquant1.cpp.

Referenced by jinit_1pass_quantizer().

◆ ODITHER_CELLS

#define ODITHER_CELLS   (ODITHER_SIZE * ODITHER_SIZE) /* # cells in matrix */

Definition at line 69 of file jquant1.cpp.

Referenced by make_odither_array().

◆ ODITHER_MASK

#define ODITHER_MASK
Value:
(ODITHER_SIZE - 1) /* mask for wrapping around counters \
*/
#define ODITHER_SIZE
Definition: jquant1.cpp:67

Definition at line 70 of file jquant1.cpp.

Referenced by quantize3_ord_dither(), and quantize_ord_dither().

◆ ODITHER_SIZE

#define ODITHER_SIZE   16 /* dimension of dither matrix */

Definition at line 67 of file jquant1.cpp.

Referenced by make_odither_array().

Typedef Documentation

◆ FSERROR

typedef INT16 FSERROR

Definition at line 124 of file jquant1.cpp.

◆ FSERRPTR

typedef FSERROR FAR* FSERRPTR

Definition at line 131 of file jquant1.cpp.

◆ LOCFSERROR

typedef int LOCFSERROR

Definition at line 125 of file jquant1.cpp.

◆ my_cquantize_ptr

Definition at line 165 of file jquant1.cpp.

◆ ODITHER_MATRIX

typedef int ODITHER_MATRIX[ODITHER_SIZE][ODITHER_SIZE]

Definition at line 74 of file jquant1.cpp.

◆ ODITHER_MATRIX_PTR

typedef int(* ODITHER_MATRIX_PTR)[ODITHER_SIZE]

Definition at line 75 of file jquant1.cpp.

Function Documentation

◆ alloc_fs_workspace()

alloc_fs_workspace ( j_decompress_ptr  cinfo)

Definition at line 764 of file jquant1.cpp.

References my_cquantizer::fserrors, JPOOL_IMAGE, and SIZEOF.

Referenced by jinit_1pass_quantizer(), and start_pass_1_quant().

Here is the caller graph for this function:

◆ color_quantize()

color_quantize ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

Definition at line 470 of file jquant1.cpp.

References my_cquantizer::colorindex, for(), GETJSAMPLE, and output_buf.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ color_quantize3()

color_quantize3 ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

Definition at line 501 of file jquant1.cpp.

References my_cquantizer::colorindex, for(), GETJSAMPLE, and output_buf.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_colorindex()

create_colorindex ( j_decompress_ptr  cinfo)

Definition at line 336 of file jquant1.cpp.

References my_cquantizer::colorindex, FALSE, my_cquantizer::is_padded, JDITHER_ORDERED, JPOOL_IMAGE, largest_input_value(), MAXJSAMPLE, my_cquantizer::Ncolors, my_cquantizer::sv_actual, TRUE, and val.

Referenced by jinit_1pass_quantizer(), and start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_colormap()

create_colormap ( j_decompress_ptr  cinfo)

Definition at line 272 of file jquant1.cpp.

References mrpt::utils::colormap(), JPOOL_IMAGE, my_cquantizer::Ncolors, output_value(), select_ncolors(), my_cquantizer::sv_actual, my_cquantizer::sv_colormap, TRACEMS1, TRACEMS4, and val.

Referenced by jinit_1pass_quantizer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_odither_tables()

create_odither_tables ( j_decompress_ptr  cinfo)

Definition at line 441 of file jquant1.cpp.

References for(), make_odither_array(), my_cquantizer::Ncolors, and my_cquantizer::odither.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finish_pass_1_quant()

finish_pass_1_quant ( j_decompress_ptr  )

Definition at line 838 of file jquant1.cpp.

Referenced by jinit_1pass_quantizer().

Here is the caller graph for this function:

◆ jinit_1pass_quantizer()

jinit_1pass_quantizer ( j_decompress_ptr  cinfo)

◆ largest_input_value()

largest_input_value ( j_decompress_ptr  cinfo,
int  ci,
int  j,
int  maxj 
)

Definition at line 257 of file jquant1.cpp.

References MAXJSAMPLE, and MRPT_UNUSED_PARAM.

Referenced by create_colorindex().

Here is the caller graph for this function:

◆ make_odither_array()

make_odither_array ( j_decompress_ptr  cinfo,
int  ncolors 
)

Definition at line 403 of file jquant1.cpp.

References base_dither_matrix, JPOOL_IMAGE, MAXJSAMPLE, ODITHER_CELLS, ODITHER_SIZE, and SIZEOF.

Referenced by create_odither_tables().

Here is the caller graph for this function:

◆ new_color_map_1_quant()

new_color_map_1_quant ( j_decompress_ptr  cinfo)

Definition at line 845 of file jquant1.cpp.

References ERREXIT.

Referenced by jinit_1pass_quantizer().

Here is the caller graph for this function:

◆ output_value()

output_value ( j_decompress_ptr  cinfo,
int  ci,
int  j,
int  maxj 
)

Definition at line 242 of file jquant1.cpp.

References MAXJSAMPLE, and MRPT_UNUSED_PARAM.

Referenced by create_colormap().

Here is the caller graph for this function:

◆ quantize3_ord_dither()

quantize3_ord_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

Definition at line 588 of file jquant1.cpp.

References my_cquantizer::colorindex, for(), GETJSAMPLE, my_cquantizer::odither, ODITHER_MASK, output_buf, and my_cquantizer::row_index.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quantize_fs_dither()

quantize_fs_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

Definition at line 635 of file jquant1.cpp.

References my_cquantizer::colorindex, FALSE, FAR, for(), my_cquantizer::fserrors, GETJSAMPLE, jzero_far(), my_cquantizer::on_odd_row, output_buf, range_limit, RIGHT_SHIFT, SHIFT_TEMPS, SIZEOF, my_cquantizer::sv_colormap, and TRUE.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quantize_ord_dither()

quantize_ord_dither ( j_decompress_ptr  cinfo,
JSAMPARRAY  input_buf,
JSAMPARRAY  output_buf,
int  num_rows 
)

Definition at line 531 of file jquant1.cpp.

References my_cquantizer::colorindex, FAR, for(), GETJSAMPLE, jzero_far(), my_cquantizer::odither, ODITHER_MASK, output_buf, my_cquantizer::row_index, and SIZEOF.

Referenced by start_pass_1_quant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ select_ncolors()

select_ncolors ( j_decompress_ptr  cinfo,
int  Ncolors[] 
)

Definition at line 182 of file jquant1.cpp.

References ERREXIT1, FALSE, JCS_RGB, and TRUE.

Referenced by create_colormap().

Here is the caller graph for this function:

◆ start_pass_1_quant()

start_pass_1_quant ( j_decompress_ptr  cinfo,
boolean  is_pre_scan 
)

Variable Documentation

◆ base_dither_matrix

const UINT8 base_dither_matrix[ODITHER_SIZE][ODITHER_SIZE]
static
Initial value:
= {
{0, 192, 48, 240, 12, 204, 60, 252, 3, 195, 51, 243, 15, 207, 63, 255},
{128, 64, 176, 112, 140, 76, 188, 124, 131, 67, 179, 115, 143, 79, 191, 127},
{32, 224, 16, 208, 44, 236, 28, 220, 35, 227, 19, 211, 47, 239, 31, 223},
{160, 96, 144, 80, 172, 108, 156, 92, 163, 99, 147, 83, 175, 111, 159, 95},
{8, 200, 56, 248, 4, 196, 52, 244, 11, 203, 59, 251, 7, 199, 55, 247},
{136, 72, 184, 120, 132, 68, 180, 116, 139, 75, 187, 123, 135, 71, 183, 119},
{40, 232, 24, 216, 36, 228, 20, 212, 43, 235, 27, 219, 39, 231, 23, 215},
{168, 104, 152, 88, 164, 100, 148, 84, 171, 107, 155, 91, 167, 103, 151, 87},
{2, 194, 50, 242, 14, 206, 62, 254, 1, 193, 49, 241, 13, 205, 61, 253},
{130, 66, 178, 114, 142, 78, 190, 126, 129, 65, 177, 113, 141, 77, 189, 125},
{34, 226, 18, 210, 46, 238, 30, 222, 33, 225, 17, 209, 45, 237, 29, 221},
{162, 98, 146, 82, 174, 110, 158, 94, 161, 97, 145, 81, 173, 109, 157, 93},
{10, 202, 58, 250, 6, 198, 54, 246, 9, 201, 57, 249, 5, 197, 53, 245},
{138, 74, 186, 122, 134, 70, 182, 118, 137, 73, 185, 121, 133, 69, 181, 117},
{42, 234, 26, 218, 38, 230, 22, 214, 41, 233, 25, 217, 37, 229, 21, 213},
{170, 106, 154, 90, 166, 102, 150, 86, 169, 105, 153, 89, 165, 101, 149, 85}}

Definition at line 77 of file jquant1.cpp.

Referenced by make_odither_array().




Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019