comparison src/image.c @ 84561:589ba73a64a6

(our_memory_fill_input_buffer) <buffer>: Move to file scope and rename to omfib_buffer for clarity. (gif_load) <interlace_start, interlace_increment>: Move to file scope.
author Glenn Morris <rgm@gnu.org>
date Fri, 14 Sep 2007 07:44:07 +0000
parents 162e36293ef2
children 50b33e26718b
comparison
equal deleted inserted replaced
84560:c390b9af2601 84561:589ba73a64a6
6775 6775
6776 /* Fill input buffer method for JPEG data source manager. Called 6776 /* Fill input buffer method for JPEG data source manager. Called
6777 whenever more data is needed. We read the whole image in one step, 6777 whenever more data is needed. We read the whole image in one step,
6778 so this only adds a fake end of input marker at the end. */ 6778 so this only adds a fake end of input marker at the end. */
6779 6779
6780 static JOCTET omfib_buffer[2];
6781
6780 static boolean 6782 static boolean
6781 our_memory_fill_input_buffer (cinfo) 6783 our_memory_fill_input_buffer (cinfo)
6782 j_decompress_ptr cinfo; 6784 j_decompress_ptr cinfo;
6783 { 6785 {
6784 /* Insert a fake EOI marker. */ 6786 /* Insert a fake EOI marker. */
6785 struct jpeg_source_mgr *src = cinfo->src; 6787 struct jpeg_source_mgr *src = cinfo->src;
6786 static JOCTET buffer[2]; 6788
6787 6789 omfib_buffer[0] = (JOCTET) 0xFF;
6788 buffer[0] = (JOCTET) 0xFF; 6790 omfib_buffer[1] = (JOCTET) JPEG_EOI;
6789 buffer[1] = (JOCTET) JPEG_EOI; 6791
6790 6792 src->next_input_byte = omfib_buffer;
6791 src->next_input_byte = buffer;
6792 src->bytes_in_buffer = 2; 6793 src->bytes_in_buffer = 2;
6793 return 1; 6794 return 1;
6794 } 6795 }
6795 6796
6796 6797
7756 7757
7757 7758
7758 /* Load GIF image IMG for use on frame F. Value is non-zero if 7759 /* Load GIF image IMG for use on frame F. Value is non-zero if
7759 successful. */ 7760 successful. */
7760 7761
7762 static int interlace_start[] = {0, 4, 2, 1};
7763 static int interlace_increment[] = {8, 8, 4, 2};
7764
7761 static int 7765 static int
7762 gif_load (f, img) 7766 gif_load (f, img)
7763 struct frame *f; 7767 struct frame *f;
7764 struct image *img; 7768 struct image *img;
7765 { 7769 {
7926 problems with bytes >= 0x80. */ 7930 problems with bytes >= 0x80. */
7927 raster = (unsigned char *) gif->SavedImages[ino].RasterBits; 7931 raster = (unsigned char *) gif->SavedImages[ino].RasterBits;
7928 7932
7929 if (gif->SavedImages[ino].ImageDesc.Interlace) 7933 if (gif->SavedImages[ino].ImageDesc.Interlace)
7930 { 7934 {
7931 static int interlace_start[] = {0, 4, 2, 1};
7932 static int interlace_increment[] = {8, 8, 4, 2};
7933 int pass; 7935 int pass;
7934 int row = interlace_start[0]; 7936 int row = interlace_start[0];
7935 7937
7936 pass = 0; 7938 pass = 0;
7937 7939