10 #define JPEG_INTERNALS 57 #define CBCR_OFFSET ((INT32)CENTERJSAMPLE << SCALEBITS) 58 #define ONE_HALF ((INT32)1 << (SCALEBITS - 1)) 59 #define FIX(x) ((INT32)((x) * (1L << SCALEBITS) + 0.5)) 68 #define G_Y_OFF (1 * (MAXJSAMPLE + 1)) 69 #define B_Y_OFF (2 * (MAXJSAMPLE + 1)) 70 #define R_CB_OFF (3 * (MAXJSAMPLE + 1)) 71 #define G_CB_OFF (4 * (MAXJSAMPLE + 1)) 72 #define B_CB_OFF (5 * (MAXJSAMPLE + 1)) 73 #define R_CR_OFF B_CB_OFF 74 #define G_CR_OFF (6 * (MAXJSAMPLE + 1)) 75 #define B_CR_OFF (7 * (MAXJSAMPLE + 1)) 76 #define TABLE_SIZE (8 * (MAXJSAMPLE + 1)) 140 while (--num_rows >= 0)
142 inptr = *input_buf++;
147 for (col = 0; col < num_cols; col++)
152 inptr += RGB_PIXELSIZE;
198 while (--num_rows >= 0)
200 inptr = *input_buf++;
203 for (col = 0; col < num_cols; col++)
208 inptr += RGB_PIXELSIZE;
234 JSAMPROW outptr0, outptr1, outptr2, outptr3;
238 while (--num_rows >= 0)
240 inptr = *input_buf++;
246 for (col = 0; col < num_cols; col++)
252 outptr3[col] =
inptr[3];
292 int instride = cinfo->input_components;
294 while (--num_rows >= 0)
296 inptr = *input_buf++;
299 for (col = 0; col < num_cols; col++)
322 int nc = cinfo->num_components;
325 while (--num_rows >= 0)
328 for (ci = 0; ci < nc; ci++)
332 for (col = 0; col < num_cols; col++)
365 switch (cinfo->in_color_space)
368 if (cinfo->input_components != 1)
369 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
373 #if RGB_PIXELSIZE != 3 374 if (cinfo->input_components != RGB_PIXELSIZE)
375 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
380 if (cinfo->input_components != 3)
381 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
386 if (cinfo->input_components != 4)
387 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
391 if (cinfo->input_components < 1)
392 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
397 switch (cinfo->jpeg_color_space)
400 if (cinfo->num_components != 1)
401 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
404 else if (cinfo->in_color_space ==
JCS_RGB)
409 else if (cinfo->in_color_space ==
JCS_YCbCr)
412 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
416 if (cinfo->num_components != 3)
417 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
418 if (cinfo->in_color_space ==
JCS_RGB && RGB_PIXELSIZE == 3)
421 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
425 if (cinfo->num_components != 3)
426 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
427 if (cinfo->in_color_space ==
JCS_RGB)
432 else if (cinfo->in_color_space ==
JCS_YCbCr)
435 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
439 if (cinfo->num_components != 4)
440 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
441 if (cinfo->in_color_space ==
JCS_CMYK)
444 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
448 if (cinfo->num_components != 4)
449 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
450 if (cinfo->in_color_space ==
JCS_CMYK)
455 else if (cinfo->in_color_space ==
JCS_YCCK)
458 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
462 if (cinfo->jpeg_color_space != cinfo->in_color_space ||
463 cinfo->num_components != cinfo->input_components)
464 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
null_method(j_compress_ptr)
rgb_ycc_start(j_compress_ptr cinfo)
struct jpeg_common_struct * j_common_ptr
#define GETJSAMPLE(value)
#define ERREXIT(cinfo, code)
null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
jpeg_component_info JCOEFPTR JSAMPARRAY output_buf
rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
struct jpeg_color_converter pub
rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
GLdouble GLdouble GLdouble r
cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
jinit_color_converter(j_compress_ptr cinfo)
my_color_converter * my_cconvert_ptr