11 #define JPEG_INTERNALS
59 #define CBCR_OFFSET ((INT32) CENTERJSAMPLE << SCALEBITS)
60 #define ONE_HALF ((INT32) 1 << (SCALEBITS-1))
61 #define FIX(x) ((INT32) ((x) * (1L<<SCALEBITS) + 0.5))
70 #define G_Y_OFF (1*(MAXJSAMPLE+1))
71 #define B_Y_OFF (2*(MAXJSAMPLE+1))
72 #define R_CB_OFF (3*(MAXJSAMPLE+1))
73 #define G_CB_OFF (4*(MAXJSAMPLE+1))
74 #define B_CB_OFF (5*(MAXJSAMPLE+1))
75 #define R_CR_OFF B_CB_OFF
76 #define G_CR_OFF (6*(MAXJSAMPLE+1))
77 #define B_CR_OFF (7*(MAXJSAMPLE+1))
78 #define TABLE_SIZE (8*(MAXJSAMPLE+1))
135 register int r,
g,
b;
138 register JSAMPROW outptr0, outptr1, outptr2;
142 while (--num_rows >= 0) {
143 inptr = *input_buf++;
144 outptr0 = output_buf[0][output_row];
145 outptr1 = output_buf[1][output_row];
146 outptr2 = output_buf[2][output_row];
148 for (col = 0; col < num_cols; col++) {
152 inptr += RGB_PIXELSIZE;
191 register int r,
g,
b;
198 while (--num_rows >= 0) {
199 inptr = *input_buf++;
200 outptr = output_buf[0][output_row];
202 for (col = 0; col < num_cols; col++) {
206 inptr += RGB_PIXELSIZE;
230 register int r,
g,
b;
233 register JSAMPROW outptr0, outptr1, outptr2, outptr3;
237 while (--num_rows >= 0) {
238 inptr = *input_buf++;
239 outptr0 = output_buf[0][output_row];
240 outptr1 = output_buf[1][output_row];
241 outptr2 = output_buf[2][output_row];
242 outptr3 = output_buf[3][output_row];
244 for (col = 0; col < num_cols; col++) {
249 outptr3[col] = inptr[3];
290 while (--num_rows >= 0) {
291 inptr = *input_buf++;
292 outptr = output_buf[0][output_row];
294 for (col = 0; col < num_cols; col++) {
295 outptr[col] = inptr[0];
320 while (--num_rows >= 0) {
322 for (ci = 0; ci < nc; ci++) {
324 outptr = output_buf[ci][output_row];
325 for (col = 0; col < num_cols; col++) {
326 outptr[col] = inptr[ci];
367 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
371 #if RGB_PIXELSIZE != 3
373 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
379 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
385 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
390 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE);
398 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
407 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
412 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
416 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
421 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
428 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
433 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
437 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
442 ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
449 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
455 ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
J_COLOR_SPACE jpeg_color_space
METHODDEF void rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
struct jpeg_common_struct * j_common_ptr
my_color_converter * my_cconvert_ptr
METHODDEF void rgb_ycc_start(j_compress_ptr cinfo)
#define GETJSAMPLE(value)
struct jpeg_color_converter * cconvert
METHODDEF void cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
#define ERREXIT(cinfo, code)
METHODDEF void rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
METHODDEF void null_method(j_compress_ptr cinfo)
J_COLOR_SPACE in_color_space
struct jpeg_color_converter pub
GLOBAL void jinit_color_converter(j_compress_ptr cinfo)
GLdouble GLdouble GLdouble r
METHODDEF void grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)
METHODDEF void null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows)