• Home
  • Raw
  • Download

Lines Matching full:we

11  * We present these routines in the same coding style used in the JPEG code
54 * We present a minimal version that does not worry about refinements such
69 * For this example, we'll assume that this data structure matches the way
70 * our application has stored the image in memory, so we can just pass a
81 * Sample routine for JPEG compression. We assume that the target file name
91 * compression/decompression processes, in existence at once. We refer
97 * (see the second half of this file for an example). But here we just
111 /* We have to set up the error handler first, in case the initialization
114 * address which we place into the link field in cinfo.
117 /* Now we can initialize the JPEG compression object. */
123 /* Here we use the library-supplied code to send compressed data to a
136 /* First we supply a description of the input image.
149 * Here we just illustrate the use of quality (quantization table) scaling:
155 /* TRUE ensures that we will write a complete interchange-JPEG file.
163 /* Here we use the library's state variable cinfo.next_scanline as the
164 * loop counter, so that we don't have to keep track ourselves.
165 * To keep things simple, we pass one scanline per call; you can pass
182 /* After finish_compress, we can close the output file. */
190 /* And we're done! */
197 * In the above loop, we ignored the return value of jpeg_write_scanlines,
198 * which is the number of scanlines actually written. We could get away
199 * with this because we were only relying on the value of cinfo.next_scanline,
227 * It's a bit more refined than the above, in that we show:
231 * Just to make this example a little different from the first one, we'll
232 * assume that we do not intend to put the whole image into an in-memory
233 * buffer, but to send it line-by-line someplace else. We need a one-
234 * scanline-high JSAMPLE array as a work buffer, and we will let the JPEG
236 * because we don't need to remember to deallocate the buffer separately: it
253 * We use C's setjmp/longjmp facility to return control. This means that the
255 * establish the return point. We want the replacement error_exit to do a
256 * longjmp(). But we need to make the setjmp buffer accessible to the
257 * error_exit routine. To do this, we make a private extension of the
258 * standard JPEG error handler object. (If we were using C++, we'd say we
283 /* We could postpone this until after returning, if we chose. */
295 * Sample routine for JPEG decompression. We assume that the source file name
296 * is passed in. We want to return 1 on success, 0 on error.
311 * We call the libjpeg API from within a separate function, because modifying
321 /* We use our private extension JPEG error handler.
331 /* In this example we want to open the input file before doing anything else,
344 /* We set up the normal JPEG error routines, then override error_exit. */
349 /* If we get here, the JPEG code has signaled an error.
350 * We need to clean up the JPEG object, close the input file, and return.
356 /* Now we can initialize the JPEG decompression object. */
366 /* We can ignore the return value from jpeg_read_header since
368 * (b) we passed TRUE to reject a tables-only JPEG file as an error.
374 /* In this example, we don't need to change any of the defaults set by
375 * jpeg_read_header(), so we do nothing here.
381 /* We can ignore the return value since suspension is not possible
385 /* We may need to do some setup of our own at this point before reading
386 * the data. After jpeg_start_decompress() we have the correct scaled
388 * if we asked for color quantization.
389 * In this example, we need to make an output work buffer of the right size.
400 /* Here we use the library's state variable cinfo->output_scanline as the
401 * loop counter, so that we don't have to keep track ourselves.
416 /* We can ignore the return value since suspension is not possible
425 /* After finish_decompress, we can close the input file.
426 * Here we postpone it until after no more JPEG errors are possible,
436 /* And we're done! */
444 * In the above code, we ignored the return value of jpeg_read_scanlines,
445 * which is the number of scanlines actually read. We could get away with
446 * this because we asked for only one line at a time and we weren't using
449 * We cheated a bit by calling alloc_sarray() after jpeg_start_decompress();
450 * we should have done it beforehand to ensure that the space would be
452 * code would risk an out-of-memory error. However, in general we don't
453 * know the output image dimensions before jpeg_start_decompress(), unless we