Lines Matching refs:cinfo
66 j_compress_ptr cinfo; /* back link saves passing separate parm */ member
98 ERREXIT(sinfo->cinfo, JERR_INPUT_EOF); in read_byte()
134 ERREXIT(sinfo->cinfo, JERR_BMP_BADCMAP); in read_colormap()
138 if (sinfo->cinfo->in_color_space == JCS_UNKNOWN && gray) in read_colormap()
139 sinfo->cinfo->in_color_space = JCS_GRAYSCALE; in read_colormap()
141 if (sinfo->cinfo->in_color_space == JCS_GRAYSCALE && !gray) in read_colormap()
142 ERREXIT(sinfo->cinfo, JERR_BAD_IN_COLORSPACE); in read_colormap()
154 get_8bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in get_8bit_row() argument
168 image_ptr = (*cinfo->mem->access_virt_sarray) in get_8bit_row()
169 ((j_common_ptr)cinfo, source->whole_image, in get_8bit_row()
174 ERREXIT(cinfo, JERR_INPUT_EOF); in get_8bit_row()
180 if (cinfo->in_color_space == JCS_GRAYSCALE) { in get_8bit_row()
181 for (col = cinfo->image_width; col > 0; col--) { in get_8bit_row()
184 ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); in get_8bit_row()
187 } else if (cinfo->in_color_space == JCS_CMYK) { in get_8bit_row()
188 for (col = cinfo->image_width; col > 0; col--) { in get_8bit_row()
191 ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); in get_8bit_row()
197 register int rindex = rgb_red[cinfo->in_color_space]; in get_8bit_row()
198 register int gindex = rgb_green[cinfo->in_color_space]; in get_8bit_row()
199 register int bindex = rgb_blue[cinfo->in_color_space]; in get_8bit_row()
200 register int aindex = alpha_index[cinfo->in_color_space]; in get_8bit_row()
201 register int ps = rgb_pixelsize[cinfo->in_color_space]; in get_8bit_row()
204 for (col = cinfo->image_width; col > 0; col--) { in get_8bit_row()
207 ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); in get_8bit_row()
215 for (col = cinfo->image_width; col > 0; col--) { in get_8bit_row()
218 ERREXIT(cinfo, JERR_BMP_OUTOFRANGE); in get_8bit_row()
232 get_24bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in get_24bit_row() argument
243 image_ptr = (*cinfo->mem->access_virt_sarray) in get_24bit_row()
244 ((j_common_ptr)cinfo, source->whole_image, in get_24bit_row()
249 ERREXIT(cinfo, JERR_INPUT_EOF); in get_24bit_row()
257 if (cinfo->in_color_space == JCS_EXT_BGR) { in get_24bit_row()
259 } else if (cinfo->in_color_space == JCS_CMYK) { in get_24bit_row()
260 for (col = cinfo->image_width; col > 0; col--) { in get_24bit_row()
267 register int rindex = rgb_red[cinfo->in_color_space]; in get_24bit_row()
268 register int gindex = rgb_green[cinfo->in_color_space]; in get_24bit_row()
269 register int bindex = rgb_blue[cinfo->in_color_space]; in get_24bit_row()
270 register int aindex = alpha_index[cinfo->in_color_space]; in get_24bit_row()
271 register int ps = rgb_pixelsize[cinfo->in_color_space]; in get_24bit_row()
274 for (col = cinfo->image_width; col > 0; col--) { in get_24bit_row()
282 for (col = cinfo->image_width; col > 0; col--) { in get_24bit_row()
296 get_32bit_row(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in get_32bit_row() argument
307 image_ptr = (*cinfo->mem->access_virt_sarray) in get_32bit_row()
308 ((j_common_ptr)cinfo, source->whole_image, in get_32bit_row()
313 ERREXIT(cinfo, JERR_INPUT_EOF); in get_32bit_row()
321 if (cinfo->in_color_space == JCS_EXT_BGRX || in get_32bit_row()
322 cinfo->in_color_space == JCS_EXT_BGRA) { in get_32bit_row()
324 } else if (cinfo->in_color_space == JCS_CMYK) { in get_32bit_row()
325 for (col = cinfo->image_width; col > 0; col--) { in get_32bit_row()
333 register int rindex = rgb_red[cinfo->in_color_space]; in get_32bit_row()
334 register int gindex = rgb_green[cinfo->in_color_space]; in get_32bit_row()
335 register int bindex = rgb_blue[cinfo->in_color_space]; in get_32bit_row()
336 register int aindex = alpha_index[cinfo->in_color_space]; in get_32bit_row()
337 register int ps = rgb_pixelsize[cinfo->in_color_space]; in get_32bit_row()
340 for (col = cinfo->image_width; col > 0; col--) { in get_32bit_row()
348 for (col = cinfo->image_width; col > 0; col--) { in get_32bit_row()
369 preload_image(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in preload_image() argument
376 cd_progress_ptr progress = (cd_progress_ptr)cinfo->progress; in preload_image()
379 for (row = 0; row < cinfo->image_height; row++) { in preload_image()
382 progress->pub.pass_limit = (long)cinfo->image_height; in preload_image()
383 (*progress->pub.progress_monitor) ((j_common_ptr)cinfo); in preload_image()
385 image_ptr = (*cinfo->mem->access_virt_sarray) in preload_image()
386 ((j_common_ptr)cinfo, source->whole_image, row, (JDIMENSION)1, TRUE); in preload_image()
390 ERREXIT(cinfo, JERR_INPUT_EOF); in preload_image()
392 ERREXIT(cinfo, JERR_FILE_READ); in preload_image()
410 ERREXIT(cinfo, JERR_BMP_BADDEPTH); in preload_image()
412 source->source_row = cinfo->image_height; in preload_image()
415 return (*source->pub.get_pixel_rows) (cinfo, sinfo); in preload_image()
424 start_input_bmp(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in start_input_bmp() argument
453 ERREXIT(cinfo, JERR_INPUT_EOF); in start_input_bmp()
455 ERREXIT(cinfo, JERR_BMP_NOT); in start_input_bmp()
463 ERREXIT(cinfo, JERR_INPUT_EOF); in start_input_bmp()
466 ERREXIT(cinfo, JERR_BMP_BADHEADER); in start_input_bmp()
468 ERREXIT(cinfo, JERR_INPUT_EOF); in start_input_bmp()
481 TRACEMS2(cinfo, 1, JTRC_BMP_OS2_MAPPED, biWidth, biHeight); in start_input_bmp()
484 TRACEMS2(cinfo, 1, JTRC_BMP_OS2, biWidth, biHeight); in start_input_bmp()
487 ERREXIT(cinfo, JERR_BMP_BADDEPTH); in start_input_bmp()
508 TRACEMS2(cinfo, 1, JTRC_BMP_MAPPED, biWidth, biHeight); in start_input_bmp()
511 TRACEMS2(cinfo, 1, JTRC_BMP, biWidth, biHeight); in start_input_bmp()
514 TRACEMS2(cinfo, 1, JTRC_BMP, biWidth, biHeight); in start_input_bmp()
517 ERREXIT(cinfo, JERR_BMP_BADDEPTH); in start_input_bmp()
521 ERREXIT(cinfo, JERR_BMP_COMPRESSED); in start_input_bmp()
525 cinfo->X_density = (UINT16)(biXPelsPerMeter / 100); /* 100 cm per meter */ in start_input_bmp()
526 cinfo->Y_density = (UINT16)(biYPelsPerMeter / 100); in start_input_bmp()
527 cinfo->density_unit = 2; /* dots/cm */ in start_input_bmp()
531 ERREXIT(cinfo, JERR_BMP_BADHEADER); in start_input_bmp()
536 ERREXIT(cinfo, JERR_BMP_EMPTY); in start_input_bmp()
538 ERREXIT(cinfo, JERR_BMP_BADPLANES); in start_input_bmp()
548 ERREXIT(cinfo, JERR_BMP_BADCMAP); in start_input_bmp()
550 source->colormap = (*cinfo->mem->alloc_sarray) in start_input_bmp()
551 ((j_common_ptr)cinfo, JPOOL_IMAGE, (JDIMENSION)biClrUsed, (JDIMENSION)3); in start_input_bmp()
561 ERREXIT(cinfo, JERR_BMP_BADHEADER); in start_input_bmp()
569 if (cinfo->in_color_space == JCS_UNKNOWN) in start_input_bmp()
570 cinfo->in_color_space = JCS_EXT_RGB; in start_input_bmp()
571 if (IsExtRGB(cinfo->in_color_space)) in start_input_bmp()
572 cinfo->input_components = rgb_pixelsize[cinfo->in_color_space]; in start_input_bmp()
573 else if (cinfo->in_color_space == JCS_GRAYSCALE) in start_input_bmp()
574 cinfo->input_components = 1; in start_input_bmp()
575 else if (cinfo->in_color_space == JCS_CMYK) in start_input_bmp()
576 cinfo->input_components = 4; in start_input_bmp()
578 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); in start_input_bmp()
582 if (cinfo->in_color_space == JCS_UNKNOWN) in start_input_bmp()
583 cinfo->in_color_space = JCS_EXT_BGR; in start_input_bmp()
584 if (IsExtRGB(cinfo->in_color_space)) in start_input_bmp()
585 cinfo->input_components = rgb_pixelsize[cinfo->in_color_space]; in start_input_bmp()
586 else if (cinfo->in_color_space == JCS_CMYK) in start_input_bmp()
587 cinfo->input_components = 4; in start_input_bmp()
589 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); in start_input_bmp()
593 if (cinfo->in_color_space == JCS_UNKNOWN) in start_input_bmp()
594 cinfo->in_color_space = JCS_EXT_BGRA; in start_input_bmp()
595 if (IsExtRGB(cinfo->in_color_space)) in start_input_bmp()
596 cinfo->input_components = rgb_pixelsize[cinfo->in_color_space]; in start_input_bmp()
597 else if (cinfo->in_color_space == JCS_CMYK) in start_input_bmp()
598 cinfo->input_components = 4; in start_input_bmp()
600 ERREXIT(cinfo, JERR_BAD_IN_COLORSPACE); in start_input_bmp()
604 ERREXIT(cinfo, JERR_BMP_BADDEPTH); in start_input_bmp()
611 source->whole_image = (*cinfo->mem->request_virt_sarray) in start_input_bmp()
612 ((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE, in start_input_bmp()
615 if (cinfo->progress != NULL) { in start_input_bmp()
616 cd_progress_ptr progress = (cd_progress_ptr)cinfo->progress; in start_input_bmp()
621 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, row_width); in start_input_bmp()
633 ERREXIT(cinfo, JERR_BMP_BADDEPTH); in start_input_bmp()
641 (unsigned long long)cinfo->input_components > 0xFFFFFFFFULL) in start_input_bmp()
642 ERREXIT(cinfo, JERR_WIDTH_OVERFLOW); in start_input_bmp()
644 source->pub.buffer = (*cinfo->mem->alloc_sarray) in start_input_bmp()
645 ((j_common_ptr)cinfo, JPOOL_IMAGE, in start_input_bmp()
646 (JDIMENSION)(biWidth * cinfo->input_components), (JDIMENSION)1); in start_input_bmp()
649 cinfo->data_precision = 8; in start_input_bmp()
650 cinfo->image_width = (JDIMENSION)biWidth; in start_input_bmp()
651 cinfo->image_height = (JDIMENSION)biHeight; in start_input_bmp()
660 finish_input_bmp(j_compress_ptr cinfo, cjpeg_source_ptr sinfo) in finish_input_bmp() argument
671 jinit_read_bmp(j_compress_ptr cinfo, boolean use_inversion_array) in jinit_read_bmp() argument
677 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in jinit_read_bmp()
679 source->cinfo = cinfo; /* make back link for subroutines */ in jinit_read_bmp()