10 #define JPEG_INTERNALS 58 #define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS) 59 #define ONE_HALF ((INT32) 1 << (SCALEBITS-1)) 60 #define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5)) 69 #define G_Y_OFF (1*(MAXJSAMPLE+1)) 70 #define B_Y_OFF (2*(MAXJSAMPLE+1)) 71 #define R_CB_OFF (3*(MAXJSAMPLE+1)) 72 #define G_CB_OFF (4*(MAXJSAMPLE+1)) 73 #define B_CB_OFF (5*(MAXJSAMPLE+1)) 74 #define R_CR_OFF B_CB_OFF 75 #define G_CR_OFF (6*(MAXJSAMPLE+1)) 76 #define B_CR_OFF (7*(MAXJSAMPLE+1)) 77 #define TABLE_SIZE (8*(MAXJSAMPLE+1)) 147 for (col = 0; col <
num_cols; col++) {
151 inptr += RGB_PIXELSIZE;
201 for (col = 0; col <
num_cols; col++) {
205 inptr += RGB_PIXELSIZE;
232 JSAMPROW outptr0, outptr1, outptr2, outptr3;
243 for (col = 0; col <
num_cols; col++) {
248 outptr3[col] = inptr[3];
287 int instride = cinfo->input_components;
293 for (col = 0; col <
num_cols; col++) {
294 outptr[col] = inptr[0];
316 int nc = cinfo->num_components;
321 for (ci = 0; ci < nc; ci++) {
324 for (col = 0; col <
num_cols; col++) {
325 outptr[col] = inptr[ci];
363 switch (cinfo->in_color_space) {
365 if (cinfo->input_components != 1)
366 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
370 #if RGB_PIXELSIZE != 3 371 if (cinfo->input_components != RGB_PIXELSIZE)
372 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
377 if (cinfo->input_components != 3)
378 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
383 if (cinfo->input_components != 4)
384 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
388 if (cinfo->input_components < 1)
389 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
394 switch (cinfo->jpeg_color_space) {
396 if (cinfo->num_components != 1)
397 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
400 else if (cinfo->in_color_space ==
JCS_RGB) {
403 }
else if (cinfo->in_color_space ==
JCS_YCbCr)
406 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
410 if (cinfo->num_components != 3)
411 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
412 if (cinfo->in_color_space ==
JCS_RGB && RGB_PIXELSIZE == 3)
415 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
419 if (cinfo->num_components != 3)
420 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
421 if (cinfo->in_color_space ==
JCS_RGB) {
424 }
else if (cinfo->in_color_space ==
JCS_YCbCr)
427 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
431 if (cinfo->num_components != 4)
432 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
433 if (cinfo->in_color_space ==
JCS_CMYK)
436 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
440 if (cinfo->num_components != 4)
441 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
442 if (cinfo->in_color_space ==
JCS_CMYK) {
445 }
else if (cinfo->in_color_space ==
JCS_YCCK)
448 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
452 if (cinfo->jpeg_color_space != cinfo->in_color_space ||
453 cinfo->num_components != cinfo->input_components)
454 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)
rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
struct jpeg_color_converter pub
int JSAMPARRAY int int num_rows
int JSAMPARRAY int int JDIMENSION num_cols
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