| Index: wrrle.c
|
| diff --git a/wrrle.c b/wrrle.c
|
| index a4e73372de66f86d0e8b4046f716b25cb1d5ad74..cc95b413df1e5769fecd5d2f348ed3ab927b3b65 100644
|
| --- a/wrrle.c
|
| +++ b/wrrle.c
|
| @@ -1,9 +1,12 @@
|
| /*
|
| * wrrle.c
|
| *
|
| + * This file was part of the Independent JPEG Group's software:
|
| * Copyright (C) 1991-1996, Thomas G. Lane.
|
| - * This file is part of the Independent JPEG Group's software.
|
| - * For conditions of distribution and use, see the accompanying README file.
|
| + * It was modified by The libjpeg-turbo Project to include only code and
|
| + * information relevant to libjpeg-turbo.
|
| + * For conditions of distribution and use, see the accompanying README.ijg
|
| + * file.
|
| *
|
| * This file contains routines to write output images in RLE format.
|
| * The Utah Raster Toolkit library is required (version 3.1 or later).
|
| @@ -16,7 +19,7 @@
|
| * with updates from Robert Hutchinson.
|
| */
|
|
|
| -#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
| +#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
|
|
| #ifdef RLE_SUPPORTED
|
|
|
| @@ -47,24 +50,24 @@
|
| * though not all of the entries need be used.
|
| */
|
|
|
| -#define CMAPBITS 8
|
| -#define CMAPLENGTH (1<<(CMAPBITS))
|
| +#define CMAPBITS 8
|
| +#define CMAPLENGTH (1<<(CMAPBITS))
|
|
|
| typedef struct {
|
| struct djpeg_dest_struct pub; /* public fields */
|
|
|
| - jvirt_sarray_ptr image; /* virtual array to store the output image */
|
| - rle_map *colormap; /* RLE-style color map, or NULL if none */
|
| - rle_pixel **rle_row; /* To pass rows to rle_putrow() */
|
| + jvirt_sarray_ptr image; /* virtual array to store the output image */
|
| + rle_map *colormap; /* RLE-style color map, or NULL if none */
|
| + rle_pixel **rle_row; /* To pass rows to rle_putrow() */
|
|
|
| } rle_dest_struct;
|
|
|
| -typedef rle_dest_struct * rle_dest_ptr;
|
| +typedef rle_dest_struct *rle_dest_ptr;
|
|
|
| /* Forward declarations */
|
| METHODDEF(void) rle_put_pixel_rows
|
| - JPP((j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
|
| - JDIMENSION rows_supplied));
|
| + (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
|
| + JDIMENSION rows_supplied);
|
|
|
|
|
| /*
|
| @@ -97,8 +100,8 @@ start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
| */
|
|
|
| if (cinfo->output_width > 32767 || cinfo->output_height > 32767)
|
| - ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width,
|
| - cinfo->output_height);
|
| + ERREXIT2(cinfo, JERR_RLE_DIMENSIONS, cinfo->output_width,
|
| + cinfo->output_height);
|
|
|
| if (cinfo->out_color_space != JCS_GRAYSCALE &&
|
| cinfo->out_color_space != JCS_RGB)
|
| @@ -113,7 +116,7 @@ start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
|
|
| if (cinfo->quantize_colors) {
|
| /* Allocate storage for RLE-style cmap, zero any extra entries */
|
| - cmapsize = cinfo->out_color_components * CMAPLENGTH * SIZEOF(rle_map);
|
| + cmapsize = cinfo->out_color_components * CMAPLENGTH * sizeof(rle_map);
|
| dest->colormap = (rle_map *) (*cinfo->mem->alloc_small)
|
| ((j_common_ptr) cinfo, JPOOL_IMAGE, cmapsize);
|
| MEMZERO(dest->colormap, cmapsize);
|
| @@ -151,7 +154,7 @@ start_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
|
|
| METHODDEF(void)
|
| rle_put_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
|
| - JDIMENSION rows_supplied)
|
| + JDIMENSION rows_supplied)
|
| {
|
| rle_dest_ptr dest = (rle_dest_ptr) dinfo;
|
|
|
| @@ -172,7 +175,7 @@ METHODDEF(void)
|
| finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
| {
|
| rle_dest_ptr dest = (rle_dest_ptr) dinfo;
|
| - rle_hdr header; /* Output file information */
|
| + rle_hdr header; /* Output file information */
|
| rle_pixel **rle_row, *red, *green, *blue;
|
| JSAMPROW output_row;
|
| char cmapcomment[80];
|
| @@ -207,8 +210,7 @@ finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
| rle_put_setup(&header);
|
|
|
| /* Now output the RLE data from our virtual array.
|
| - * We assume here that (a) rle_pixel is represented the same as JSAMPLE,
|
| - * and (b) we are not on a machine where FAR pointers differ from regular.
|
| + * We assume here that rle_pixel is represented the same as JSAMPLE.
|
| */
|
|
|
| #ifdef PROGRESS_REPORT
|
| @@ -223,7 +225,7 @@ finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
| for (row = cinfo->output_height-1; row >= 0; row--) {
|
| rle_row = (rle_pixel **) (*cinfo->mem->access_virt_sarray)
|
| ((j_common_ptr) cinfo, dest->image,
|
| - (JDIMENSION) row, (JDIMENSION) 1, FALSE);
|
| + (JDIMENSION) row, (JDIMENSION) 1, FALSE);
|
| rle_putrow(rle_row, (int) cinfo->output_width, &header);
|
| #ifdef PROGRESS_REPORT
|
| if (progress != NULL) {
|
| @@ -235,9 +237,9 @@ finish_output_rle (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo)
|
| } else {
|
| for (row = cinfo->output_height-1; row >= 0; row--) {
|
| rle_row = (rle_pixel **) dest->rle_row;
|
| - output_row = * (*cinfo->mem->access_virt_sarray)
|
| + output_row = *(*cinfo->mem->access_virt_sarray)
|
| ((j_common_ptr) cinfo, dest->image,
|
| - (JDIMENSION) row, (JDIMENSION) 1, FALSE);
|
| + (JDIMENSION) row, (JDIMENSION) 1, FALSE);
|
| red = rle_row[0];
|
| green = rle_row[1];
|
| blue = rle_row[2];
|
| @@ -281,7 +283,7 @@ jinit_write_rle (j_decompress_ptr cinfo)
|
| /* Create module interface object, fill in method pointers */
|
| dest = (rle_dest_ptr)
|
| (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
|
| - SIZEOF(rle_dest_struct));
|
| + sizeof(rle_dest_struct));
|
| dest->pub.start_output = start_output_rle;
|
| dest->pub.finish_output = finish_output_rle;
|
|
|
|
|