11 #define JPEG_INTERNALS
61 #define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
62 #define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
77 cconvert->Cr_r_tab = (
int *)
80 cconvert->Cb_b_tab = (
int *)
81 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
83 cconvert->Cr_g_tab = (
INT32 *)
84 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
86 cconvert->Cb_g_tab = (
INT32 *)
87 (*cinfo->mem->alloc_small) ((
j_common_ptr) cinfo, JPOOL_IMAGE,
94 cconvert->Cr_r_tab[
i] = (
int)
97 cconvert->Cb_b_tab[
i] = (
int)
100 cconvert->Cr_g_tab[
i] = (-
FIX(0.71414)) *
x;
103 cconvert->Cb_g_tab[
i] = (-
FIX(0.34414)) *
x + ONE_HALF;
125 register int y, cb, cr;
127 register JSAMPROW inptr0, inptr1, inptr2;
132 register int * Crrtab = cconvert->Cr_r_tab;
133 register int * Cbbtab = cconvert->Cb_b_tab;
134 register INT32 * Crgtab = cconvert->Cr_g_tab;
135 register INT32 * Cbgtab = cconvert->Cb_g_tab;
138 while (--num_rows >= 0) {
139 inptr0 = input_buf[0][input_row];
140 inptr1 = input_buf[1][input_row];
141 inptr2 = input_buf[2][input_row];
143 outptr = *output_buf++;
144 for (col = 0; col < num_cols; col++) {
149 outptr[RGB_RED] = range_limit[y + Crrtab[cr]];
150 outptr[RGB_GREEN] = range_limit[y +
153 outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]];
154 outptr += RGB_PIXELSIZE;
179 while (--num_rows >= 0) {
180 for (ci = 0; ci < num_components; ci++) {
181 inptr = input_buf[ci][input_row];
182 outptr = output_buf[0] + ci;
183 for (count = num_cols; count > 0; count--) {
185 outptr += num_components;
223 register int y, cb, cr;
225 register JSAMPROW inptr0, inptr1, inptr2, inptr3;
230 register int * Crrtab = cconvert->Cr_r_tab;
231 register int * Cbbtab = cconvert->Cb_b_tab;
232 register INT32 * Crgtab = cconvert->Cr_g_tab;
233 register INT32 * Cbgtab = cconvert->Cb_g_tab;
236 while (--num_rows >= 0) {
237 inptr0 = input_buf[0][input_row];
238 inptr1 = input_buf[1][input_row];
239 inptr2 = input_buf[2][input_row];
240 inptr3 = input_buf[3][input_row];
242 outptr = *output_buf++;
243 for (col = 0; col < num_cols; col++) {
248 outptr[0] = range_limit[
MAXJSAMPLE - (y + Crrtab[cr])];
252 outptr[2] = range_limit[
MAXJSAMPLE - (y + Cbbtab[cb])];
254 outptr[3] = inptr3[col];
292 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
298 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
304 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
309 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
328 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
339 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
350 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
359 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
METHODDEF void null_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
GLOBAL void jcopy_sample_rows(JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
jpeg_component_info * comp_info
METHODDEF void ycc_rgb_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
METHODDEF void start_pass_dcolor(j_decompress_ptr cinfo)
METHODDEF void ycck_cmyk_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
J_COLOR_SPACE out_color_space
GLuint GLuint GLsizei count
LOCAL void build_ycc_rgb_table(j_decompress_ptr cinfo)
JSAMPLE * sample_range_limit
my_color_deconverter * my_cconvert_ptr
struct jpeg_color_converter pub
struct jpeg_color_deconverter * cconvert
#define RIGHT_SHIFT(x, shft)
METHODDEF void grayscale_convert(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row, JSAMPARRAY output_buf, int num_rows)
GLOBAL void jinit_color_deconverter(j_decompress_ptr cinfo)
J_COLOR_SPACE jpeg_color_space