0N/A * reserved comment block 0N/A * DO NOT REMOVE OR ALTER! 0N/A * Copyright (C) 1994-1996, Thomas G. Lane. 0N/A * This file is part of the Independent JPEG Group's software. 0N/A * For conditions of distribution and use, see the accompanying README file. 0N/A * This file contains application interface code for the decompression half 0N/A * of the JPEG library. These are the "standard" API routines that are 0N/A * used in the normal full-decompression case. They are not used by a 0N/A * transcoding-only application. Note that if an application links in 0N/A * jpeg_start_decompress, it will end up linking in the entire decompressor. 0N/A * We thus must separate this file from jdapimin.c to avoid linking the 0N/A * whole decompression library into a transcoder. 0N/A/* Forward declarations */ 0N/A * Decompression initialization. 0N/A * jpeg_read_header must be completed before calling this. 0N/A * If a multipass operating mode was selected, this will do all but the 0N/A * last pass, and thus may take a great deal of time. 0N/A * Returns FALSE if suspended. The return value need be inspected only if 0N/A * a suspending data source is used. 0N/A /* First call: initialize master control, select active modules */ 0N/A /* No more work here; expecting jpeg_start_output next */ 0N/A /* If file has multiple scans, absorb them all into the coef buffer */ 0N/A /* Call progress monitor hook if present */ 0N/A /* Absorb some more input */ 0N/A /* Advance progress counter if appropriate */ 0N/A /* jdmaster underestimated number of scans; ratchet up one scan */ 0N/A#
endif /* D_MULTISCAN_FILES_SUPPORTED */ 0N/A /* Perform any dummy output passes, and set up for the final pass */ 0N/A * Set up for an output pass, and perform any dummy pass(es) needed. 0N/A * Common subroutine for jpeg_start_decompress and jpeg_start_output. 0N/A * Entry: global_state = DSTATE_PRESCAN only if previously suspended. 0N/A * Exit: If done, returns TRUE and sets global_state for proper output mode. 0N/A * If suspended, returns FALSE and sets global_state = DSTATE_PRESCAN. 0N/A /* First call: do pass setup */ 0N/A /* Loop over any required dummy passes */ 0N/A /* Crank through the dummy pass */ 0N/A /* Call progress monitor hook if present */ 0N/A /* Process some data */ 0N/A return FALSE;
/* No progress made, must suspend */ 0N/A /* Finish up dummy pass, and set up for another one */ 0N/A#
endif /* QUANT_2PASS_SUPPORTED */ 0N/A /* Ready for application to drive output pass through 0N/A * jpeg_read_scanlines or jpeg_read_raw_data. 0N/A * Read some scanlines of data from the JPEG decompressor. 0N/A * The return value will be the number of lines actually read. 0N/A * This may be less than the number requested in several cases, 0N/A * including bottom of image, data source suspension, and operating 0N/A * modes that emit multiple scanlines at a time. 0N/A * Note: we warn about excess calls to jpeg_read_scanlines() since 0N/A * this likely signals an application programmer error. However, 0N/A * an oversize buffer (max_lines > scanlines remaining) is not an error. 0N/A /* Call progress monitor hook if present */ 0N/A /* Process some data */ 0N/A * Alternate entry point to read raw data. 0N/A * Processes exactly one iMCU row per call, unless suspended. 0N/A /* Call progress monitor hook if present */ 0N/A /* Verify that at least one iMCU row can be returned. */ 0N/A /* Decompress directly into user's buffer. */ 0N/A return 0;
/* suspension forced, can do nothing more */ 0N/A /* OK, we processed one iMCU row. */ 0N/A/* Additional entry points for buffered-image mode. */ 0N/A * Initialize for an output pass in buffered-image mode. 0N/A /* Limit scan number to valid range */ 0N/A /* Perform any dummy output passes, and set up for the real pass */ 0N/A * Finish up after an output pass in buffered-image mode. 0N/A * Returns FALSE if suspended. The return value need be inspected only if 0N/A * a suspending data source is used. 0N/A /* Terminate this pass. */ 0N/A /* We do not require the whole pass to have been completed. */ 0N/A /* BUFPOST = repeat call after a suspension, anything else is error */ 0N/A /* Read markers looking for SOS or EOI */ 0N/A return FALSE;
/* Suspend, come back later */ 0N/A#
endif /* D_MULTISCAN_FILES_SUPPORTED */