Lines Matching refs:cinfo
390 j_common_ptr cinfo,
398 data->jpegObj = cinfo;
399 cinfo->client_data = data;
402 printf("new structures: data is %p, cinfo is %p\n", data, cinfo);
519 sun_jpeg_error_exit (j_common_ptr cinfo)
521 /* cinfo->err really points to a sun_jpeg_error_mgr struct */
522 sun_jpeg_error_ptr myerr = (sun_jpeg_error_ptr) cinfo->err;
538 sun_jpeg_output_message (j_common_ptr cinfo)
542 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
547 (*cinfo->err->format_message) (cinfo, buffer);
554 if (cinfo->is_decompressor) {
572 j_common_ptr cinfo,
597 jerr = (sun_jpeg_error_ptr) cinfo->err;
604 (*cinfo->err->format_message) (cinfo,
611 jpeg_abort(cinfo); // Frees any markers, but not tables
616 j_common_ptr cinfo,
623 jerr = (sun_jpeg_error_ptr) cinfo->err;
630 (*cinfo->err->format_message) (cinfo, buffer);
636 jpeg_abort(cinfo); // Does not reset tables
650 j_compress_ptr cinfo = (j_compress_ptr) info;
651 free(cinfo->dest);
652 cinfo->dest = NULL;
665 j_common_ptr cinfo,
690 if (cinfo->is_decompressor) {
691 decomp = (j_decompress_ptr) cinfo;
694 jpeg_alloc_quant_table(cinfo);
698 comp = (j_compress_ptr) cinfo;
701 jpeg_alloc_quant_table(cinfo);
772 j_common_ptr cinfo,
788 if (cinfo->is_decompressor) {
789 decomp = (j_decompress_ptr) cinfo;
792 jpeg_alloc_huff_table(cinfo);
796 comp = (j_compress_ptr) cinfo;
799 jpeg_alloc_huff_table(cinfo);
813 if (cinfo->is_decompressor) {
814 decomp = (j_decompress_ptr) cinfo;
817 jpeg_alloc_huff_table(cinfo);
821 comp = (j_compress_ptr) cinfo;
824 jpeg_alloc_huff_table(cinfo);
863 imageio_init_source(j_decompress_ptr cinfo)
865 struct jpeg_source_mgr *src = cinfo->src;
891 imageio_fill_input_buffer(j_decompress_ptr cinfo)
893 struct jpeg_source_mgr *src = cinfo->src;
894 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
916 src->skip_input_data(cinfo, 0);
931 cinfo->err->error_exit((j_common_ptr) cinfo);
954 cinfo->err->error_exit((j_common_ptr) cinfo);
977 imageio_fill_suspended_buffer(j_decompress_ptr cinfo)
979 struct jpeg_source_mgr *src = cinfo->src;
980 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
998 src->skip_input_data(cinfo, 0);
1010 cinfo->err->error_exit((j_common_ptr) cinfo);
1021 cinfo->err->error_exit((j_common_ptr) cinfo);
1037 cinfo->err->error_exit((j_common_ptr) cinfo);
1070 imageio_skip_input_data(j_decompress_ptr cinfo, long num_bytes)
1072 struct jpeg_source_mgr *src = cinfo->src;
1073 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
1114 cinfo->err->error_exit((j_common_ptr) cinfo);
1133 cinfo->err->error_exit((j_common_ptr) cinfo);
1151 imageio_term_source(j_decompress_ptr cinfo)
1154 struct jpeg_source_mgr *src = cinfo->src;
1155 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
1167 cinfo->err->error_exit((j_common_ptr) cinfo);
1240 read_icc_profile (JNIEnv *env, j_decompress_ptr cinfo)
1263 for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
1449 struct jpeg_decompress_struct *cinfo =
1451 if (cinfo == NULL) {
1465 free(cinfo);
1470 cinfo->err = jpeg_std_error(&(jerr->pub));
1480 (*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
1487 jpeg_create_decompress(cinfo);
1491 jpeg_save_markers(cinfo, ICC_MARKER, 0xFFFF);
1496 cinfo->src =
1498 if (cinfo->src == NULL) {
1502 imageio_dispose((j_common_ptr)cinfo);
1505 cinfo->src->bytes_in_buffer = 0;
1506 cinfo->src->next_input_byte = NULL;
1507 cinfo->src->init_source = imageio_init_source;
1508 cinfo->src->fill_input_buffer = imageio_fill_input_buffer;
1509 cinfo->src->skip_input_data = imageio_skip_input_data;
1510 cinfo->src->resync_to_restart = jpeg_resync_to_restart; // use default
1511 cinfo->src->term_source = imageio_term_source;
1514 ret = initImageioData(env, (j_common_ptr) cinfo, this);
1519 imageio_dispose((j_common_ptr)cinfo);
1537 j_common_ptr cinfo;
1546 cinfo = data->jpegObj;
1548 imageio_set_stream(env, cinfo, data, this);
1550 imageio_init_source((j_decompress_ptr) cinfo);
1576 j_decompress_ptr cinfo;
1588 cinfo = (j_decompress_ptr) data->jpegObj;
1589 src = cinfo->src;
1592 jerr = (sun_jpeg_error_ptr) cinfo->err;
1600 (*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
1608 printf("In readImageHeader, data is %p cinfo is %p\n", data, cinfo);
1629 ret = jpeg_read_header(cinfo, FALSE);
1633 imageio_term_source(cinfo); // Pushback remaining buffer contents
1636 cinfo->quant_tbl_ptrs[0]);
1645 switch (cinfo->jpeg_color_space) {
1662 if (cinfo->saw_Adobe_marker) {
1663 if (cinfo->Adobe_transform != 1) {
1669 cinfo->jpeg_color_space = JCS_UNKNOWN;
1670 cinfo->out_color_space = JCS_UNKNOWN;
1672 } else if (!cinfo->saw_JFIF_marker && !IS_EXIF(cinfo)) {
1686 h_samp0 = cinfo->comp_info[0].h_samp_factor;
1687 h_samp1 = cinfo->comp_info[1].h_samp_factor;
1688 h_samp2 = cinfo->comp_info[2].h_samp_factor;
1690 v_samp0 = cinfo->comp_info[0].v_samp_factor;
1691 v_samp1 = cinfo->comp_info[1].v_samp_factor;
1692 v_samp2 = cinfo->comp_info[2].v_samp_factor;
1697 cinfo->jpeg_color_space = JCS_RGB;
1704 cinfo->out_color_space = JCS_YCC;
1708 if ((cinfo->saw_Adobe_marker) && (cinfo->Adobe_transform != 2)) {
1714 cinfo->jpeg_color_space = JCS_UNKNOWN;
1715 cinfo->out_color_space = JCS_UNKNOWN;
1725 h_samp0 = cinfo->comp_info[0].h_samp_factor;
1726 h_samp1 = cinfo->comp_info[1].h_samp_factor;
1727 h_samp2 = cinfo->comp_info[2].h_samp_factor;
1729 v_samp0 = cinfo->comp_info[0].v_samp_factor;
1730 v_samp1 = cinfo->comp_info[1].v_samp_factor;
1731 v_samp2 = cinfo->comp_info[2].v_samp_factor;
1736 cinfo->jpeg_color_space = JCS_YCCK;
1743 profileData = read_icc_profile(env, cinfo);
1751 cinfo->image_width,
1752 cinfo->image_height,
1753 cinfo->jpeg_color_space,
1754 cinfo->out_color_space,
1755 cinfo->num_components,
1758 jpeg_abort_decompress(cinfo);
1774 j_decompress_ptr cinfo;
1783 cinfo = (j_decompress_ptr) data->jpegObj;
1785 cinfo->out_color_space = code;
1829 j_decompress_ptr cinfo;
1846 cinfo = (j_decompress_ptr) data->jpegObj;
1849 (sourceXStart < 0) || (sourceXStart >= (jint)cinfo->image_width) ||
1850 (sourceYStart < 0) || (sourceYStart >= (jint)cinfo->image_height) ||
1851 (sourceWidth < 1) || (sourceWidth > (jint)cinfo->image_width) ||
1852 (sourceHeight < 1) || (sourceHeight > (jint)cinfo->image_height) ||
1862 if (stepX > (jint)cinfo->image_width) {
1863 stepX = cinfo->image_width;
1865 if (stepY > (jint)cinfo->image_height) {
1866 stepY = cinfo->image_height;
1900 cinfo->quant_tbl_ptrs[0]);
1903 data = (imageIODataPtr) cinfo->client_data;
1904 src = cinfo->src;
1914 jerr = (sun_jpeg_error_ptr) cinfo->err;
1922 (*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
1942 if ((qtables != NULL) && (cinfo->quant_tbl_ptrs[0] == NULL)) {
1943 (void) setQTables(env, (j_common_ptr) cinfo, qtables, TRUE);
1946 if ((DCHuffmanTables != NULL) && (cinfo->dc_huff_tbl_ptrs[0] == NULL)) {
1947 setHTables(env, (j_common_ptr) cinfo,
1953 progressive = jpeg_has_multiple_scans(cinfo);
1955 cinfo->buffered_image = TRUE;
1956 cinfo->input_scan_number = minProgressivePass+1; // Java count from 0
1965 jpeg_start_decompress(cinfo);
1967 if (numBands != cinfo->output_components) {
1973 if (cinfo->output_components <= 0 ||
1974 cinfo->image_width > (0xffffffffu / (unsigned int)cinfo->output_components))
1982 scanLinePtr = (JSAMPROW)malloc(cinfo->image_width*cinfo->output_components);
1997 jpeg_start_output(cinfo, cinfo->input_scan_number);
2001 cinfo->input_scan_number-1);
2012 && ((jint)cinfo->output_scanline < sourceYStart)) {
2013 jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
2018 +(sourceXStart+sourceWidth)*cinfo->output_components;
2020 pixelStride = stepX*cinfo->output_components;
2024 && ((jint)cinfo->output_scanline < scanlineLimit)) {
2026 jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
2035 in = scanLinePtr + (sourceXStart * cinfo->output_components);
2045 for (in = scanLinePtr+sourceXStart*cinfo->output_components;
2066 cinfo->err->error_exit((j_common_ptr) cinfo);
2075 linesLeft = scanlineLimit - cinfo->output_scanline;
2081 jpeg_read_scanlines(cinfo, &scanLinePtr, 1);
2085 jpeg_finish_output(cinfo); // Increments pass counter
2087 if (jpeg_input_complete(cinfo)
2088 || (cinfo->input_scan_number > maxProgressivePass)) {
2104 if (cinfo->output_scanline == cinfo->output_height) {
2105 // if ((cinfo->output_scanline == cinfo->output_height) &&
2106 //(jpeg_input_complete(cinfo))) { // We read the whole file
2107 jpeg_finish_decompress(cinfo);
2109 jpeg_abort_decompress(cinfo);
2144 j_decompress_ptr cinfo;
2153 cinfo = (j_decompress_ptr) data->jpegObj;
2155 jpeg_abort_decompress(cinfo);
2166 j_decompress_ptr cinfo;
2176 cinfo = (j_decompress_ptr) data->jpegObj;
2178 jerr = (sun_jpeg_error_ptr) cinfo->err;
2180 imageio_reset(env, (j_common_ptr) cinfo, data);
2225 cinfo->src->term_source(cinfo);
2228 cinfo->src->bytes_in_buffer = 0;
2229 cinfo->src->next_input_byte = NULL;
2256 imageio_init_destination (j_compress_ptr cinfo)
2258 struct jpeg_destination_mgr *dest = cinfo->dest;
2259 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
2282 imageio_empty_output_buffer (j_compress_ptr cinfo)
2284 struct jpeg_destination_mgr *dest = cinfo->dest;
2285 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
2300 cinfo->err->error_exit((j_common_ptr) cinfo);
2315 imageio_term_destination (j_compress_ptr cinfo)
2317 struct jpeg_destination_mgr *dest = cinfo->dest;
2318 imageIODataPtr data = (imageIODataPtr) cinfo->client_data;
2338 cinfo->err->error_exit((j_common_ptr) cinfo);
2353 imageio_flush_destination(j_compress_ptr cinfo)
2355 imageio_term_destination(cinfo);
2356 imageio_init_destination(cinfo);
2423 struct jpeg_compress_struct *cinfo =
2425 if (cinfo == NULL) {
2439 free(cinfo);
2444 cinfo->err = jpeg_std_error(&(jerr->pub));
2454 (*cinfo->err->format_message) ((struct jpeg_common_struct *) cinfo,
2461 jpeg_create_compress(cinfo);
2469 imageio_dispose((j_common_ptr)cinfo);
2479 cinfo->dest = dest;
2482 ret = initImageioData(env, (j_common_ptr) cinfo, this);
2487 imageio_dispose((j_common_ptr)cinfo);
2500 j_compress_ptr cinfo;
2509 cinfo = (j_compress_ptr) data->jpegObj;
2515 cinfo->dest->next_output_byte = NULL;
2516 cinfo->dest->free_in_buffer = 0;
2531 j_compress_ptr cinfo;
2540 cinfo = (j_compress_ptr) data->jpegObj;
2541 dest = cinfo->dest;
2544 jerr = (sun_jpeg_error_ptr) cinfo->err;
2552 (*cinfo->err->format_message) ((j_common_ptr) cinfo,
2567 jpeg_suppress_tables(cinfo, TRUE); // Suppress writing of any current
2574 setQTables(env, (j_common_ptr) cinfo, qtables, TRUE);
2578 setHTables(env, (j_common_ptr) cinfo,
2582 jpeg_write_tables(cinfo); // Flushes the buffer for you
2630 j_compress_ptr cinfo;
2711 cinfo = (j_compress_ptr) data->jpegObj;
2712 dest = cinfo->dest;
2733 jerr = (sun_jpeg_error_ptr) cinfo->err;
2741 (*cinfo->err->format_message) ((j_common_ptr) cinfo,
2760 cinfo->image_width = destWidth;
2761 cinfo->image_height = destHeight;
2762 cinfo->input_components = numBands;
2763 cinfo->in_color_space = inCs;
2765 jpeg_set_defaults(cinfo);
2767 jpeg_set_colorspace(cinfo, outCs);
2769 cinfo->optimize_coding = optimize;
2771 cinfo->write_JFIF_header = FALSE;
2772 cinfo->write_Adobe_marker = FALSE;
2789 cinfo->comp_info[i].component_id = ids[i];
2790 cinfo->comp_info[i].h_samp_factor = hfactors[i];
2791 cinfo->comp_info[i].v_samp_factor = vfactors[i];
2792 cinfo->comp_info[i].quant_tbl_no = qsels[i];
2804 jpeg_suppress_tables(cinfo, TRUE); // Disable writing any current
2806 qlen = setQTables(env, (j_common_ptr) cinfo, qtables, writeDQT);
2811 (j_common_ptr) cinfo,
2829 jpeg_simple_progression(cinfo);
2831 cinfo->num_scans = numScans;
2841 if (cinfo->script_space == NULL
2842 || cinfo->script_space_size < numScans) {
2843 cinfo->script_space_size = MAX(numScans, 10);
2844 cinfo->script_space = (jpeg_scan_info *)
2845 (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
2847 cinfo->script_space_size
2850 cinfo->scan_info = cinfo->script_space;
2851 scanptr = (int *) cinfo->script_space;
2864 cinfo->restart_interval = restartInterval;
2871 jpeg_start_compress(cinfo, FALSE); // Leaves sent_table alone
2875 imageio_flush_destination(cinfo);
2884 cinfo->err->error_exit((j_common_ptr) cinfo);
2894 && (cinfo->next_scanline < cinfo->image_height)) {
2904 cinfo->err->error_exit((j_common_ptr) cinfo);
2934 jpeg_write_scanlines(cinfo, (JSAMPARRAY)&scanLinePtr, 1);
2942 if (cinfo->next_scanline == cinfo->image_height) {
2943 jpeg_finish_compress(cinfo); // Flushes buffer with term_dest
2945 jpeg_abort((j_common_ptr)cinfo);
2986 j_compress_ptr cinfo;
2995 cinfo = (j_compress_ptr) data->jpegObj;
2997 imageio_reset(env, (j_common_ptr) cinfo, data);
3007 cinfo->dest->next_output_byte = NULL;
3008 cinfo->dest->free_in_buffer = 0;